diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2007-12-13 10:55:16 +0000 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2007-12-13 15:37:19 +0000 |
commit | 1f1506ec94f3d44091de88d8bcd7ab9c20a6e7b2 (patch) | |
tree | d3ed331c268ea05e2ba67e4e609c4a98e7d7f580 /src/mesa/pipe | |
parent | 4844b9fb9d24b119935d540dd345707dd81d9f4a (diff) |
965: use state atom array directly
Diffstat (limited to 'src/mesa/pipe')
-rw-r--r-- | src/mesa/pipe/i965simple/brw_state_upload.c | 37 |
1 files changed, 5 insertions, 32 deletions
diff --git a/src/mesa/pipe/i965simple/brw_state_upload.c b/src/mesa/pipe/i965simple/brw_state_upload.c index 1ca7484958..10f1d4812a 100644 --- a/src/mesa/pipe/i965simple/brw_state_upload.c +++ b/src/mesa/pipe/i965simple/brw_state_upload.c @@ -102,34 +102,13 @@ void brw_init_state( struct brw_context *brw ) brw_init_pools(brw); brw_init_caches(brw); - brw->state.atoms = MALLOC(sizeof(atoms)); - brw->state.nr_atoms = sizeof(atoms)/sizeof(*atoms); - memcpy(brw->state.atoms, atoms, sizeof(atoms)); - - /* Patch in a pointer to the dynamic state atom: - */ - for (i = 0; i < brw->state.nr_atoms; i++) - if (brw->state.atoms[i] == NULL) - brw->state.atoms[i] = &brw->curbe.tracked_state; - - memcpy(&brw->curbe.tracked_state, - &brw_constant_buffer, - sizeof(brw_constant_buffer)); - brw->state.dirty.brw = ~0; brw->emit_state_always = 0; - - } void brw_destroy_state( struct brw_context *brw ) { - if (brw->state.atoms) { - FREE(brw->state.atoms); - brw->state.atoms = NULL; - } - brw_destroy_caches(brw); brw_destroy_batch_cache(brw); brw_destroy_pools(brw); @@ -189,21 +168,17 @@ void brw_validate_state( struct brw_context *brw ) memset(&examined, 0, sizeof(examined)); prev = *state; - for (i = 0; i < brw->state.nr_atoms; i++) { - const struct brw_tracked_state *atom = brw->state.atoms[i]; + for (i = 0; i < Elements(atoms); i++) { + const struct brw_tracked_state *atom = atoms[i]; struct brw_state_flags generated; assert(atom->dirty.brw || atom->dirty.cache); assert(atom->update); - if (check_state(state, &atom->dirty) || atom->always_update) { + if (check_state(state, &atom->dirty)) { atom->update( brw ); - -/* emit_foo(brw); */ } - if (atom->emit_reloc != NULL) - atom->emit_reloc(brw); accumulate_state(&examined, &atom->dirty); @@ -218,12 +193,10 @@ void brw_validate_state( struct brw_context *brw ) } else { for (i = 0; i < Elements(atoms); i++) { - const struct brw_tracked_state *atom = brw->state.atoms[i]; + const struct brw_tracked_state *atom = atoms[i]; - if (check_state(state, &atom->dirty) || atom->always_update) + if (check_state(state, &atom->dirty)) atom->update( brw ); - if (atom->emit_reloc != NULL) - atom->emit_reloc(brw); } } |