brw_context.h File Reference

Include dependency graph for brw_context.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  brw_state_flags
struct  brw_vertex_program
struct  brw_fragment_program
struct  pipe_setup_linkage
struct  brw_texture
struct  brw_wm_prog_data
struct  brw_sf_prog_data
struct  brw_clip_prog_data
struct  brw_gs_prog_data
struct  brw_vs_prog_data
struct  brw_surface_binding_table
struct  brw_mem_pool
struct  brw_cache_item
struct  brw_cache
struct  brw_tracked_state
struct  brw_cached_batch_item
struct  brw_vertex_info
struct  brw_context

Defines

#define BRW_MAX_CURBE   (32*16)
#define BRW_NEW_VIEWPORT   0x1
#define BRW_NEW_RASTERIZER   0x2
#define BRW_NEW_FS   0x4
#define BRW_NEW_BLEND   0x8
#define BRW_NEW_CLIP   0x10
#define BRW_NEW_SCISSOR   0x20
#define BRW_NEW_STIPPLE   0x40
#define BRW_NEW_FRAMEBUFFER   0x80
#define BRW_NEW_ALPHA_TEST   0x100
#define BRW_NEW_DEPTH_STENCIL   0x200
#define BRW_NEW_SAMPLER   0x400
#define BRW_NEW_TEXTURE   0x800
#define BRW_NEW_CONSTANTS   0x1000
#define BRW_NEW_VBO   0x2000
#define BRW_NEW_VS   0x4000
#define BRW_NEW_URB_FENCE   0x10000
#define BRW_NEW_PSP   0x20000
#define BRW_NEW_CURBE_OFFSETS   0x40000
#define BRW_NEW_REDUCED_PRIMITIVE   0x80000
#define BRW_NEW_PRIMITIVE   0x100000
#define BRW_NEW_SCENE   0x200000
#define BRW_NEW_SF_LINKAGE   0x400000
#define DEBUG_TEXTURE   0x1
#define DEBUG_STATE   0x2
#define DEBUG_IOCTL   0x4
#define DEBUG_PRIMS   0x8
#define DEBUG_VERTS   0x10
#define DEBUG_FALLBACKS   0x20
#define DEBUG_VERBOSE   0x40
#define DEBUG_DRI   0x80
#define DEBUG_DMA   0x100
#define DEBUG_SANITY   0x200
#define DEBUG_SYNC   0x400
#define DEBUG_SLEEP   0x800
#define DEBUG_PIXEL   0x1000
#define DEBUG_STATS   0x2000
#define DEBUG_TILE   0x4000
#define DEBUG_SINGLE_THREAD   0x8000
#define DEBUG_WM   0x10000
#define DEBUG_URB   0x20000
#define DEBUG_VS   0x40000
#define DEBUG_BATCH   0x80000
#define DEBUG_BUFMGR   0x100000
#define DEBUG_BLIT   0x200000
#define DEBUG_REGION   0x400000
#define DEBUG_MIPTREE   0x800000
#define DBG(...)
#define PRINT(...)
#define BRW_MAX_TEX_UNIT   8
#define BRW_WM_MAX_SURF   BRW_MAX_TEX_UNIT + 1
#define CACHE_NEW_CC_VP   (1<<BRW_CC_VP)
#define CACHE_NEW_CC_UNIT   (1<<BRW_CC_UNIT)
#define CACHE_NEW_WM_PROG   (1<<BRW_WM_PROG)
#define CACHE_NEW_SAMPLER_DEFAULT_COLOR   (1<<BRW_SAMPLER_DEFAULT_COLOR)
#define CACHE_NEW_SAMPLER   (1<<BRW_SAMPLER)
#define CACHE_NEW_WM_UNIT   (1<<BRW_WM_UNIT)
#define CACHE_NEW_SF_PROG   (1<<BRW_SF_PROG)
#define CACHE_NEW_SF_VP   (1<<BRW_SF_VP)
#define CACHE_NEW_SF_UNIT   (1<<BRW_SF_UNIT)
#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)
#define ATTRIB_BIT_DWORDS   ((PIPE_MAX_ATTRIBS+31)/32)
#define BRW_NR_UPLOAD_BUFS   17
#define BRW_UPLOAD_INIT_SIZE   (128*1024)
#define BRW_PACKCOLOR8888(r, g, b, a)   ((r<<24) | (g<<16) | (b<<8) | a)

Enumerations

enum  brw_mempool_id { BRW_GS_POOL, BRW_SS_POOL, BRW_MAX_POOL }

Functions

void brw_do_flush (struct brw_context *brw, unsigned flags)
void brw_validate_state (struct brw_context *brw)
void brw_init_state (struct brw_context *brw)
void brw_destroy_state (struct brw_context *brw)
void brwUpdateTextureState (struct brw_context *brw)
void brw_upload_urb_fence (struct brw_context *brw)
void brw_upload_constant_buffer_state (struct brw_context *brw)
void brw_init_surface_functions (struct brw_context *brw)
void brw_init_state_functions (struct brw_context *brw)
void brw_init_flush_functions (struct brw_context *brw)
void brw_init_string_functions (struct brw_context *brw)
static struct brw_contextbrw_context (struct pipe_context *ctx)

Variables

int BRW_DEBUG


Define Documentation

#define ATTRIB_BIT_DWORDS   ((PIPE_MAX_ATTRIBS+31)/32)

Definition at line 439 of file brw_context.h.

#define BRW_MAX_CURBE   (32*16)

Definition at line 124 of file brw_context.h.

#define BRW_MAX_TEX_UNIT   8

Definition at line 331 of file brw_context.h.

#define BRW_NEW_ALPHA_TEST   0x100

Definition at line 140 of file brw_context.h.

#define BRW_NEW_BLEND   0x8

Definition at line 135 of file brw_context.h.

#define BRW_NEW_CLIP   0x10

Definition at line 136 of file brw_context.h.

#define BRW_NEW_CONSTANTS   0x1000

Definition at line 144 of file brw_context.h.

#define BRW_NEW_CURBE_OFFSETS   0x40000

Definition at line 152 of file brw_context.h.

#define BRW_NEW_DEPTH_STENCIL   0x200

Definition at line 141 of file brw_context.h.

#define BRW_NEW_FRAMEBUFFER   0x80

Definition at line 139 of file brw_context.h.

#define BRW_NEW_FS   0x4

Definition at line 134 of file brw_context.h.

#define BRW_NEW_PRIMITIVE   0x100000

Definition at line 154 of file brw_context.h.

#define BRW_NEW_PSP   0x20000

Definition at line 151 of file brw_context.h.

#define BRW_NEW_RASTERIZER   0x2

Definition at line 133 of file brw_context.h.

#define BRW_NEW_REDUCED_PRIMITIVE   0x80000

Definition at line 153 of file brw_context.h.

#define BRW_NEW_SAMPLER   0x400

Definition at line 142 of file brw_context.h.

#define BRW_NEW_SCENE   0x200000

Definition at line 155 of file brw_context.h.

#define BRW_NEW_SCISSOR   0x20

Definition at line 137 of file brw_context.h.

#define BRW_NEW_SF_LINKAGE   0x400000

Definition at line 156 of file brw_context.h.

#define BRW_NEW_STIPPLE   0x40

Definition at line 138 of file brw_context.h.

#define BRW_NEW_TEXTURE   0x800

Definition at line 143 of file brw_context.h.

#define BRW_NEW_URB_FENCE   0x10000

Definition at line 150 of file brw_context.h.

#define BRW_NEW_VBO   0x2000

Definition at line 145 of file brw_context.h.

#define BRW_NEW_VIEWPORT   0x1

Definition at line 132 of file brw_context.h.

#define BRW_NEW_VS   0x4000

Definition at line 146 of file brw_context.h.

#define BRW_NR_UPLOAD_BUFS   17

Definition at line 503 of file brw_context.h.

#define BRW_PACKCOLOR8888 ( r,
g,
b,
 )     ((r<<24) | (g<<16) | (b<<8) | a)

Definition at line 638 of file brw_context.h.

#define BRW_UPLOAD_INIT_SIZE   (128*1024)

Definition at line 504 of file brw_context.h.

#define BRW_WM_MAX_SURF   BRW_MAX_TEX_UNIT + 1

Definition at line 332 of file brw_context.h.

#define CACHE_NEW_CC_UNIT   (1<<BRW_CC_UNIT)

Definition at line 400 of file brw_context.h.

#define CACHE_NEW_CC_VP   (1<<BRW_CC_VP)

Definition at line 399 of file brw_context.h.

#define CACHE_NEW_CLIP_PROG   (1<<BRW_CLIP_PROG)

Definition at line 414 of file brw_context.h.

#define CACHE_NEW_CLIP_UNIT   (1<<BRW_CLIP_UNIT)

Definition at line 413 of file brw_context.h.

#define CACHE_NEW_CLIP_VP   (1<<BRW_CLIP_VP)

Definition at line 412 of file brw_context.h.

#define CACHE_NEW_GS_PROG   (1<<BRW_GS_PROG)

Definition at line 411 of file brw_context.h.

#define CACHE_NEW_GS_UNIT   (1<<BRW_GS_UNIT)

Definition at line 410 of file brw_context.h.

#define CACHE_NEW_SAMPLER   (1<<BRW_SAMPLER)

Definition at line 403 of file brw_context.h.

#define CACHE_NEW_SAMPLER_DEFAULT_COLOR   (1<<BRW_SAMPLER_DEFAULT_COLOR)

Definition at line 402 of file brw_context.h.

#define CACHE_NEW_SF_PROG   (1<<BRW_SF_PROG)

Definition at line 405 of file brw_context.h.

#define CACHE_NEW_SF_UNIT   (1<<BRW_SF_UNIT)

Definition at line 407 of file brw_context.h.

#define CACHE_NEW_SF_VP   (1<<BRW_SF_VP)

Definition at line 406 of file brw_context.h.

#define CACHE_NEW_SURF_BIND   (1<<BRW_SS_SURF_BIND)

Definition at line 416 of file brw_context.h.

#define CACHE_NEW_SURFACE   (1<<BRW_SS_SURFACE)

Definition at line 415 of file brw_context.h.

#define CACHE_NEW_VS_PROG   (1<<BRW_VS_PROG)

Definition at line 409 of file brw_context.h.

#define CACHE_NEW_VS_UNIT   (1<<BRW_VS_UNIT)

Definition at line 408 of file brw_context.h.

#define CACHE_NEW_WM_PROG   (1<<BRW_WM_PROG)

Definition at line 401 of file brw_context.h.

#define CACHE_NEW_WM_UNIT   (1<<BRW_WM_UNIT)

Definition at line 404 of file brw_context.h.

#define DBG ( ...   ) 

Value:

do {                                            \
   if (BRW_DEBUG & FILE_DEBUG_FLAG)                             \
      debug_printf(__VA_ARGS__);                                \
} while(0)

Definition at line 185 of file brw_context.h.

#define DEBUG_BATCH   0x80000

Definition at line 179 of file brw_context.h.

#define DEBUG_BLIT   0x200000

Definition at line 181 of file brw_context.h.

#define DEBUG_BUFMGR   0x100000

Definition at line 180 of file brw_context.h.

#define DEBUG_DMA   0x100

Definition at line 168 of file brw_context.h.

#define DEBUG_DRI   0x80

Definition at line 167 of file brw_context.h.

#define DEBUG_FALLBACKS   0x20

Definition at line 165 of file brw_context.h.

#define DEBUG_IOCTL   0x4

Definition at line 162 of file brw_context.h.

#define DEBUG_MIPTREE   0x800000

Definition at line 183 of file brw_context.h.

#define DEBUG_PIXEL   0x1000

Definition at line 172 of file brw_context.h.

#define DEBUG_PRIMS   0x8

Definition at line 163 of file brw_context.h.

#define DEBUG_REGION   0x400000

Definition at line 182 of file brw_context.h.

#define DEBUG_SANITY   0x200

Definition at line 169 of file brw_context.h.

#define DEBUG_SINGLE_THREAD   0x8000

Definition at line 175 of file brw_context.h.

#define DEBUG_SLEEP   0x800

Definition at line 171 of file brw_context.h.

#define DEBUG_STATE   0x2

Definition at line 161 of file brw_context.h.

#define DEBUG_STATS   0x2000

Definition at line 173 of file brw_context.h.

#define DEBUG_SYNC   0x400

Definition at line 170 of file brw_context.h.

#define DEBUG_TEXTURE   0x1

Definition at line 160 of file brw_context.h.

#define DEBUG_TILE   0x4000

Definition at line 174 of file brw_context.h.

#define DEBUG_URB   0x20000

Definition at line 177 of file brw_context.h.

#define DEBUG_VERBOSE   0x40

Definition at line 166 of file brw_context.h.

#define DEBUG_VERTS   0x10

Definition at line 164 of file brw_context.h.

#define DEBUG_VS   0x40000

Definition at line 178 of file brw_context.h.

#define DEBUG_WM   0x10000

Definition at line 176 of file brw_context.h.

#define PRINT ( ...   ) 

Value:

do {                                            \
   debug_printf(__VA_ARGS__);                                   \
} while(0)

Definition at line 190 of file brw_context.h.


Enumeration Type Documentation

enum brw_mempool_id

Enumerator:
BRW_GS_POOL 
BRW_SS_POOL 
BRW_MAX_POOL 

Definition at line 421 of file brw_context.h.

00421                     {
00422    BRW_GS_POOL,
00423    BRW_SS_POOL,
00424    BRW_MAX_POOL
00425 };


Function Documentation

static struct brw_context* brw_context ( struct pipe_context ctx  )  [static, read]

Definition at line 678 of file brw_context.h.

00679 {
00680    return (struct brw_context *)ctx;
00681 }

void brw_destroy_state ( struct brw_context brw  ) 

Definition at line 104 of file brw_state_upload.c.

References brw_destroy_batch_cache(), brw_destroy_caches(), and brw_destroy_pools().

00105 {
00106    brw_destroy_caches(brw);
00107    brw_destroy_batch_cache(brw);
00108    brw_destroy_pools(brw);
00109 }

void brw_do_flush ( struct brw_context brw,
unsigned  flags 
)

void brw_init_flush_functions ( struct brw_context brw  ) 

Definition at line 70 of file brw_flush.c.

References brw_flush(), pipe_context::flush, and brw_context::pipe.

00071 {
00072    brw->pipe.flush = brw_flush;
00073 }

void brw_init_state ( struct brw_context brw  ) 

Definition at line 94 of file brw_state_upload.c.

References brw_state_flags::brw, brw_init_caches(), brw_init_pools(), brw_context::dirty, brw_context::emit_state_always, and brw_context::state.

00095 {
00096    brw_init_pools(brw);
00097    brw_init_caches(brw);
00098 
00099    brw->state.dirty.brw = ~0;
00100    brw->emit_state_always = 0;
00101 }

void brw_init_state_functions ( struct brw_context brw  ) 

Definition at line 431 of file brw_state.c.

References pipe_context::bind_blend_state, pipe_context::bind_depth_stencil_alpha_state, pipe_context::bind_fs_state, pipe_context::bind_rasterizer_state, pipe_context::bind_sampler_states, pipe_context::bind_vs_state, brw_bind_blend_state(), brw_bind_depth_stencil_state(), brw_bind_fs_state(), brw_bind_rasterizer_state(), brw_bind_sampler_states(), brw_bind_vs_state(), brw_create_blend_state(), brw_create_depth_stencil_state(), brw_create_fs_state(), brw_create_rasterizer_state(), brw_create_sampler_state(), brw_create_vs_state(), brw_delete_blend_state(), brw_delete_depth_stencil_state(), brw_delete_fs_state(), brw_delete_rasterizer_state(), brw_delete_sampler_state(), brw_delete_vs_state(), brw_set_blend_color(), brw_set_clip_state(), brw_set_constant_buffer(), brw_set_framebuffer_state(), brw_set_polygon_stipple(), brw_set_sampler_textures(), brw_set_scissor_state(), brw_set_vertex_buffers(), brw_set_vertex_elements(), brw_set_viewport_state(), pipe_context::create_blend_state, pipe_context::create_depth_stencil_alpha_state, pipe_context::create_fs_state, pipe_context::create_rasterizer_state, pipe_context::create_sampler_state, pipe_context::create_vs_state, pipe_context::delete_blend_state, pipe_context::delete_depth_stencil_alpha_state, pipe_context::delete_fs_state, pipe_context::delete_rasterizer_state, pipe_context::delete_sampler_state, pipe_context::delete_vs_state, brw_context::pipe, pipe_context::set_blend_color, pipe_context::set_clip_state, pipe_context::set_constant_buffer, pipe_context::set_framebuffer_state, pipe_context::set_polygon_stipple, pipe_context::set_sampler_textures, pipe_context::set_scissor_state, pipe_context::set_vertex_buffers, pipe_context::set_vertex_elements, and pipe_context::set_viewport_state.

00432 {
00433    brw->pipe.create_blend_state = brw_create_blend_state;
00434    brw->pipe.bind_blend_state = brw_bind_blend_state;
00435    brw->pipe.delete_blend_state = brw_delete_blend_state;
00436 
00437    brw->pipe.create_sampler_state = brw_create_sampler_state;
00438    brw->pipe.bind_sampler_states = brw_bind_sampler_states;
00439    brw->pipe.delete_sampler_state = brw_delete_sampler_state;
00440 
00441    brw->pipe.create_depth_stencil_alpha_state = brw_create_depth_stencil_state;
00442    brw->pipe.bind_depth_stencil_alpha_state = brw_bind_depth_stencil_state;
00443    brw->pipe.delete_depth_stencil_alpha_state = brw_delete_depth_stencil_state;
00444 
00445    brw->pipe.create_rasterizer_state = brw_create_rasterizer_state;
00446    brw->pipe.bind_rasterizer_state = brw_bind_rasterizer_state;
00447    brw->pipe.delete_rasterizer_state = brw_delete_rasterizer_state;
00448    brw->pipe.create_fs_state = brw_create_fs_state;
00449    brw->pipe.bind_fs_state = brw_bind_fs_state;
00450    brw->pipe.delete_fs_state = brw_delete_fs_state;
00451    brw->pipe.create_vs_state = brw_create_vs_state;
00452    brw->pipe.bind_vs_state = brw_bind_vs_state;
00453    brw->pipe.delete_vs_state = brw_delete_vs_state;
00454 
00455    brw->pipe.set_blend_color = brw_set_blend_color;
00456    brw->pipe.set_clip_state = brw_set_clip_state;
00457    brw->pipe.set_constant_buffer = brw_set_constant_buffer;
00458    brw->pipe.set_framebuffer_state = brw_set_framebuffer_state;
00459 
00460 //   brw->pipe.set_feedback_state = brw_set_feedback_state;
00461 //   brw->pipe.set_feedback_buffer = brw_set_feedback_buffer;
00462 
00463    brw->pipe.set_polygon_stipple = brw_set_polygon_stipple;
00464    brw->pipe.set_scissor_state = brw_set_scissor_state;
00465    brw->pipe.set_sampler_textures = brw_set_sampler_textures;
00466    brw->pipe.set_viewport_state = brw_set_viewport_state;
00467    brw->pipe.set_vertex_buffers = brw_set_vertex_buffers;
00468    brw->pipe.set_vertex_elements = brw_set_vertex_elements;
00469 }

void brw_init_string_functions ( struct brw_context brw  ) 

void brw_init_surface_functions ( struct brw_context brw  ) 

Definition at line 120 of file brw_surface.c.

References brw_surface_copy(), brw_surface_fill(), brw_context::pipe, pipe_context::surface_copy, and pipe_context::surface_fill.

00121 {
00122    brw->pipe.surface_copy  = brw_surface_copy;
00123    brw->pipe.surface_fill  = brw_surface_fill;
00124 }

void brw_upload_constant_buffer_state ( struct brw_context brw  ) 

Definition at line 142 of file brw_curbe.c.

References assert, brw_constant_buffer_state::bits0, BRW_CACHED_BATCH_STRUCT, CMD_CONST_BUFFER_STATE, brw_context::csize, brw_constant_buffer_state::header, header::length, brw_context::nr_cs_entries, brw_constant_buffer_state::nr_urb_entries, header::opcode, brw_context::urb, and brw_constant_buffer_state::urb_entry_size.

00143 {
00144    struct brw_constant_buffer_state cbs;
00145    memset(&cbs, 0, sizeof(cbs));
00146 
00147    /* It appears that this is the state packet for the CS unit, ie. the
00148     * urb entries detailed here are housed in the CS range from the
00149     * URB_FENCE command.
00150     */
00151    cbs.header.opcode = CMD_CONST_BUFFER_STATE;
00152    cbs.header.length = sizeof(cbs)/4 - 2;
00153 
00154    /* BRW_NEW_URB_FENCE */
00155    cbs.bits0.nr_urb_entries = brw->urb.nr_cs_entries;
00156    cbs.bits0.urb_entry_size = brw->urb.csize - 1;
00157 
00158    assert(brw->urb.nr_cs_entries);
00159    BRW_CACHED_BATCH_STRUCT(brw, &cbs);
00160 }

void brw_upload_urb_fence ( struct brw_context brw  ) 

Definition at line 160 of file brw_urb.c.

References brw_urb_fence::bits0, brw_urb_fence::bits1, BRW_BATCH_STRUCT, brw_context::clip_start, brw_urb_fence::clp_fence, brw_urb_fence::clp_realloc, CMD_URB_FENCE, brw_urb_fence::cs_fence, brw_urb_fence::cs_realloc, brw_context::cs_start, brw_urb_fence::gs_fence, brw_urb_fence::gs_realloc, brw_context::gs_start, brw_urb_fence::header, brw_urb_fence::length, brw_urb_fence::opcode, brw_urb_fence::sf_fence, brw_urb_fence::sf_realloc, brw_context::sf_start, brw_context::urb, brw_urb_fence::vfe_realloc, brw_urb_fence::vs_fence, and brw_urb_fence::vs_realloc.

00161 {
00162    struct brw_urb_fence uf;
00163    memset(&uf, 0, sizeof(uf));
00164 
00165    uf.header.opcode = CMD_URB_FENCE;
00166    uf.header.length = sizeof(uf)/4-2;
00167    uf.header.vs_realloc = 1;
00168    uf.header.gs_realloc = 1;
00169    uf.header.clp_realloc = 1;
00170    uf.header.sf_realloc = 1;
00171    uf.header.vfe_realloc = 1;
00172    uf.header.cs_realloc = 1;
00173 
00174    /* The ordering below is correct, not the layout in the
00175     * instruction.
00176     *
00177     * There are 256 urb reg pairs in total.
00178     */
00179    uf.bits0.vs_fence  = brw->urb.gs_start;
00180    uf.bits0.gs_fence  = brw->urb.clip_start;
00181    uf.bits0.clp_fence = brw->urb.sf_start;
00182    uf.bits1.sf_fence  = brw->urb.cs_start;
00183    uf.bits1.cs_fence  = 256;
00184 
00185    BRW_BATCH_STRUCT(brw, &uf);
00186 }

void brw_validate_state ( struct brw_context brw  ) 

Definition at line 141 of file brw_state_upload.c.

References accumulate_state(), assert, brw_state_flags::brw, brw_clear_batch_cache_flush(), BRW_DEBUG, BRW_NEW_SCENE, brw_state_flags::cache, check_state(), brw_tracked_state::dirty, brw_context::dirty, Elements, brw_context::emit_state_always, brw_context::state, brw_tracked_state::update, and xor_states().

00142 {
00143    struct brw_state_flags *state = &brw->state.dirty;
00144    unsigned i;
00145 
00146    if (brw->emit_state_always) 
00147       state->brw |= ~0;
00148 
00149    if (state->cache == 0 &&
00150        state->brw == 0)
00151       return;
00152 
00153    if (brw->state.dirty.brw & BRW_NEW_SCENE)
00154       brw_clear_batch_cache_flush(brw);
00155 
00156    if (BRW_DEBUG) {
00157       /* Debug version which enforces various sanity checks on the
00158        * state flags which are generated and checked to help ensure
00159        * state atoms are ordered correctly in the list.
00160        */
00161       struct brw_state_flags examined, prev;
00162       memset(&examined, 0, sizeof(examined));
00163       prev = *state;
00164 
00165       for (i = 0; i < Elements(atoms); i++) {
00166          const struct brw_tracked_state *atom = atoms[i];
00167          struct brw_state_flags generated;
00168 
00169          assert(atom->dirty.brw ||
00170                 atom->dirty.cache);
00171          assert(atom->update);
00172 
00173          if (check_state(state, &atom->dirty)) {
00174             atom->update( brw );
00175          }
00176 
00177          accumulate_state(&examined, &atom->dirty);
00178 
00179          /* generated = (prev ^ state)
00180           * if (examined & generated)
00181           *     fail;
00182           */
00183          xor_states(&generated, &prev, state);
00184          assert(!check_state(&examined, &generated));
00185          prev = *state;
00186       }
00187    }
00188    else {
00189       for (i = 0; i < Elements(atoms); i++) {
00190          const struct brw_tracked_state *atom = atoms[i];
00191 
00192          assert(atom->dirty.brw ||
00193                 atom->dirty.cache);
00194          assert(atom->update);
00195 
00196          if (check_state(state, &atom->dirty))
00197             atom->update( brw );
00198       }
00199    }
00200 
00201    memset(state, 0, sizeof(*state));
00202 }

void brwUpdateTextureState ( struct brw_context brw  ) 


Variable Documentation

int BRW_DEBUG

Definition at line 47 of file brw_context.c.


Generated on Tue Sep 29 06:25:36 2009 for Gallium3D by  doxygen 1.5.4