📄 brw_context.h
字号:
#define CACHE_NEW_VS_UNIT (1<<BRW_VS_UNIT)#define CACHE_NEW_VS_PROG (1<<BRW_VS_PROG)#define CACHE_NEW_GS_UNIT (1<<BRW_GS_UNIT)#define CACHE_NEW_GS_PROG (1<<BRW_GS_PROG)#define CACHE_NEW_CLIP_VP (1<<BRW_CLIP_VP)#define CACHE_NEW_CLIP_UNIT (1<<BRW_CLIP_UNIT)#define CACHE_NEW_CLIP_PROG (1<<BRW_CLIP_PROG)#define CACHE_NEW_SURFACE (1<<BRW_SS_SURFACE)#define CACHE_NEW_SURF_BIND (1<<BRW_SS_SURF_BIND)struct brw_cached_batch_item { struct header *header; GLuint sz; struct brw_cached_batch_item *next;}; /* Protect against a future where VERT_ATTRIB_MAX > 32. Wouldn't life * be easier if C allowed arrays of packed elements? */#define ATTRIB_BIT_DWORDS ((VERT_ATTRIB_MAX+31)/32)struct brw_vertex_element { const struct gl_client_array *glarray; /** Size of a complete element */ GLuint element_size; /** Number of uploaded elements for this input. */ GLuint count; /** Byte stride between elements in the uploaded array */ GLuint stride; /** Offset of the first element within the buffer object */ unsigned int offset; /** Buffer object containing the uploaded vertex data */ dri_bo *bo;};struct brw_vertex_info { GLuint varying; /* varying:1[VERT_ATTRIB_MAX] */ GLuint sizes[ATTRIB_BIT_DWORDS * 2]; /* sizes:2[VERT_ATTRIB_MAX] */};/* Cache for TNL programs. */struct brw_tnl_cache_item { GLuint hash; void *key; void *data; struct brw_tnl_cache_item *next;};struct brw_tnl_cache { struct brw_tnl_cache_item **items; GLuint size, n_items;};struct brw_context { struct intel_context intel; GLuint primitive; GLboolean emit_state_always; GLboolean wrap; GLboolean tmp_fallback; GLboolean no_batch_wrap; struct { struct brw_state_flags dirty; struct brw_tracked_state **atoms; GLuint nr_atoms; GLuint nr_draw_regions; struct intel_region *draw_regions[MAX_DRAW_BUFFERS]; struct intel_region *depth_region; } state; struct brw_state_pointers attribs; struct brw_cache cache; struct brw_cached_batch_item *cached_batch_items; struct { struct brw_vertex_element inputs[VERT_ATTRIB_MAX];#define BRW_NR_UPLOAD_BUFS 17#define BRW_UPLOAD_INIT_SIZE (128*1024) struct { dri_bo *bo; GLuint offset; } upload; /* Summary of size and varying of active arrays, so we can check * for changes to this state: */ struct brw_vertex_info info; } vb; struct { /* Will be allocated on demand if needed. */ struct brw_state_pointers attribs; struct gl_vertex_program *vp; struct gl_fragment_program *fp, *fp_tex; struct gl_buffer_object *vbo; struct intel_region *saved_draw_region; GLuint saved_nr_draw_regions; struct intel_region *saved_depth_region; GLuint restore_draw_buffers[MAX_DRAW_BUFFERS]; GLuint restore_num_draw_buffers; struct gl_fragment_program *restore_fp; GLboolean active; } metaops; /* Track fixed function t&l in a vertex program: */ struct gl_vertex_program *tnl_program; struct brw_tnl_cache tnl_program_cache; /* Active vertex program: */ const struct gl_vertex_program *vertex_program; const struct gl_fragment_program *fragment_program; /* For populating the gtt: */ GLuint next_free_page; /* BRW_NEW_URB_ALLOCATIONS: */ struct { GLuint vsize; /* vertex size plus header in urb registers */ GLuint csize; /* constant buffer size in urb registers */ GLuint sfsize; /* setup data size in urb registers */ GLboolean constrained; GLuint nr_vs_entries; GLuint nr_gs_entries; GLuint nr_clip_entries; GLuint nr_sf_entries; GLuint nr_cs_entries;/* GLuint vs_size; *//* GLuint gs_size; *//* GLuint clip_size; *//* GLuint sf_size; *//* GLuint cs_size; */ GLuint vs_start; GLuint gs_start; GLuint clip_start; GLuint sf_start; GLuint cs_start; } urb; /* BRW_NEW_CURBE_OFFSETS: */ struct { GLuint wm_start; GLuint wm_size; GLuint clip_start; GLuint clip_size; GLuint vs_start; GLuint vs_size; GLuint total_size; /* Dynamic tracker which changes to reflect the state referenced * by active fp and vp program parameters: */ struct brw_tracked_state tracked_state; dri_bo *curbe_bo; /** Offset within curbe_bo of space for current curbe entry */ GLuint curbe_offset; /** Offset within curbe_bo of space for next curbe entry */ GLuint curbe_next_offset; GLfloat *last_buf; GLuint last_bufsz; } curbe; struct { struct brw_vs_prog_data *prog_data; dri_bo *prog_bo; dri_bo *state_bo; } vs; struct { struct brw_gs_prog_data *prog_data; GLboolean prog_active; dri_bo *prog_bo; dri_bo *state_bo; } gs; struct { struct brw_clip_prog_data *prog_data; dri_bo *prog_bo; dri_bo *state_bo; dri_bo *vp_bo; } clip; struct { struct brw_sf_prog_data *prog_data; dri_bo *prog_bo; dri_bo *state_bo; dri_bo *vp_bo; } sf; struct { struct brw_wm_prog_data *prog_data; struct brw_wm_compile *compile_data; /* Input sizes, calculated from active vertex program: */ GLuint input_size_masks[4]; /** Array of surface default colors (texture border color) */ dri_bo *sdc_bo[BRW_MAX_TEX_UNIT]; GLuint render_surf; GLuint nr_surfaces; GLuint max_threads; dri_bo *scratch_buffer; GLuint sampler_count; dri_bo *sampler_bo; /** Binding table of pointers to surf_bo entries */ dri_bo *bind_bo; dri_bo *surf_bo[BRW_WM_MAX_SURF]; dri_bo *prog_bo; dri_bo *state_bo; } wm; struct { dri_bo *prog_bo; dri_bo *state_bo; dri_bo *vp_bo; } cc; /* Used to give every program string a unique id */ GLuint program_id;};#define BRW_PACKCOLOR8888(r,g,b,a) ((r<<24) | (g<<16) | (b<<8) | a)/*====================================================================== * brw_vtbl.c */void brwInitVtbl( struct brw_context *brw );void brw_do_flush( struct brw_context *brw, GLuint flags );/*====================================================================== * brw_context.c */GLboolean brwCreateContext( const __GLcontextModes *mesaVis, __DRIcontextPrivate *driContextPriv, void *sharedContextPrivate);/*====================================================================== * brw_state.c */int brw_validate_state( struct brw_context *brw );void brw_init_state( struct brw_context *brw );void brw_destroy_state( struct brw_context *brw );/*====================================================================== * brw_state_dump.c */void brw_debug_batch(struct intel_context *intel);/*====================================================================== * brw_tex.c */void brwUpdateTextureState( struct intel_context *intel );void brw_FrameBufferTexInit( struct brw_context *brw, struct intel_region *region );void brw_FrameBufferTexDestroy( struct brw_context *brw );void brw_validate_textures( struct brw_context *brw );/*====================================================================== * brw_metaops.c */void brw_init_metaops( struct brw_context *brw );void brw_destroy_metaops( struct brw_context *brw );/*====================================================================== * brw_program.c */void brwInitFragProgFuncs( struct dd_function_table *functions );/* brw_urb.c */void brw_upload_urb_fence(struct brw_context *brw);void brw_upload_constant_buffer_state(struct brw_context *brw);/*====================================================================== * Inline conversion functions. These are better-typed than the * macros used previously: */static INLINE struct brw_context *brw_context( GLcontext *ctx ){ return (struct brw_context *)ctx;}#define DO_SETUP_BITS ((1<<(FRAG_ATTRIB_MAX)) - 1)#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -