00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef BRW_STATE_H
00034 #define BRW_STATE_H
00035
00036 #include "brw_context.h"
00037 #include "brw_winsys.h"
00038
00039
00040 const struct brw_tracked_state brw_blend_constant_color;
00041 const struct brw_tracked_state brw_cc_unit;
00042 const struct brw_tracked_state brw_cc_vp;
00043 const struct brw_tracked_state brw_clip_prog;
00044 const struct brw_tracked_state brw_clip_unit;
00045 const struct brw_tracked_state brw_constant_buffer_state;
00046 const struct brw_tracked_state brw_constant_buffer;
00047 const struct brw_tracked_state brw_curbe_offsets;
00048 const struct brw_tracked_state brw_invarient_state;
00049 const struct brw_tracked_state brw_gs_prog;
00050 const struct brw_tracked_state brw_gs_unit;
00051 const struct brw_tracked_state brw_drawing_rect;
00052 const struct brw_tracked_state brw_line_stipple;
00053 const struct brw_tracked_state brw_pipelined_state_pointers;
00054 const struct brw_tracked_state brw_binding_table_pointers;
00055 const struct brw_tracked_state brw_depthbuffer;
00056 const struct brw_tracked_state brw_polygon_stipple_offset;
00057 const struct brw_tracked_state brw_polygon_stipple;
00058 const struct brw_tracked_state brw_program_parameters;
00059 const struct brw_tracked_state brw_recalculate_urb_fence;
00060 const struct brw_tracked_state brw_sf_prog;
00061 const struct brw_tracked_state brw_sf_unit;
00062 const struct brw_tracked_state brw_sf_vp;
00063 const struct brw_tracked_state brw_state_base_address;
00064 const struct brw_tracked_state brw_urb_fence;
00065 const struct brw_tracked_state brw_vertex_state;
00066 const struct brw_tracked_state brw_vs_prog;
00067 const struct brw_tracked_state brw_vs_unit;
00068 const struct brw_tracked_state brw_wm_prog;
00069 const struct brw_tracked_state brw_wm_samplers;
00070 const struct brw_tracked_state brw_wm_surfaces;
00071 const struct brw_tracked_state brw_wm_unit;
00072
00073 const struct brw_tracked_state brw_psp_urb_cbs;
00074
00075 const struct brw_tracked_state brw_active_vertprog;
00076 const struct brw_tracked_state brw_tnl_vertprog;
00077 const struct brw_tracked_state brw_pipe_control;
00078
00079 const struct brw_tracked_state brw_clear_surface_cache;
00080 const struct brw_tracked_state brw_clear_batch_cache;
00081
00082
00083
00084
00085 unsigned brw_cache_data(struct brw_cache *cache,
00086 const void *data );
00087
00088 unsigned brw_cache_data_sz(struct brw_cache *cache,
00089 const void *data,
00090 unsigned data_sz);
00091
00092 unsigned brw_upload_cache( struct brw_cache *cache,
00093 const void *key,
00094 unsigned key_sz,
00095 const void *data,
00096 unsigned data_sz,
00097 const void *aux,
00098 void *aux_return );
00099
00100 boolean brw_search_cache( struct brw_cache *cache,
00101 const void *key,
00102 unsigned key_size,
00103 void *aux_return,
00104 unsigned *offset_return);
00105
00106 void brw_init_caches( struct brw_context *brw );
00107 void brw_destroy_caches( struct brw_context *brw );
00108
00109 static inline struct pipe_buffer *brw_cache_buffer(struct brw_context *brw,
00110 enum brw_cache_id id)
00111 {
00112 return brw->cache[id].pool->buffer;
00113 }
00114
00115
00116
00117
00118 #define BRW_CACHED_BATCH_STRUCT(brw, s) brw_cached_batch_struct( brw, (s), sizeof(*(s)) )
00119
00120 boolean brw_cached_batch_struct( struct brw_context *brw,
00121 const void *data,
00122 unsigned sz );
00123
00124 void brw_destroy_batch_cache( struct brw_context *brw );
00125
00126
00127
00128
00129
00130 void brw_init_pools( struct brw_context *brw );
00131 void brw_destroy_pools( struct brw_context *brw );
00132
00133 boolean brw_pool_alloc( struct brw_mem_pool *pool,
00134 unsigned size,
00135 unsigned alignment,
00136 unsigned *offset_return);
00137
00138 void brw_pool_fence( struct brw_context *brw,
00139 struct brw_mem_pool *pool,
00140 unsigned fence );
00141
00142
00143 void brw_pool_check_wrap( struct brw_context *brw,
00144 struct brw_mem_pool *pool );
00145
00146 void brw_clear_all_caches( struct brw_context *brw );
00147 void brw_invalidate_pools( struct brw_context *brw );
00148 void brw_clear_batch_cache_flush( struct brw_context *brw );
00149
00150
00151 #endif