Move get_dirty() call to after reserving space in the batchbuffer as

this may trigger a batchbuffer flush and raise new dirty state.

Add assert_not_dirty() callback required by recent changes.
This commit is contained in:
Keith Whitwell 2006-09-26 11:36:32 +00:00
parent 87a0312068
commit f397a2a1e5

View file

@ -416,7 +416,7 @@ i830_emit_state(struct intel_context *intel)
struct i830_context *i830 = i830_context(&intel->ctx);
struct i830_hw_state *state = i830->current;
int i;
GLuint dirty = state->active & ~state->emitted;
GLuint dirty;
BATCH_LOCALS;
/* We don't hold the lock at this point, so want to make sure that
@ -428,6 +428,11 @@ i830_emit_state(struct intel_context *intel)
*/
intel_batchbuffer_require_space(intel->batch, get_state_size(state), 0);
/* Do this here as we may have flushed the batchbuffer above,
* causing more state to be dirty!
*/
dirty = state->active & ~state->emitted;
if (dirty & I830_UPLOAD_INVARIENT) {
DBG("I830_UPLOAD_INVARIENT:\n");
i830_emit_invarient_state(intel);
@ -575,6 +580,14 @@ i830_flush_cmd(void)
}
static void
i830_assert_not_dirty( struct intel_context *intel )
{
struct i830_context *i830 = i830_context(&intel->ctx);
struct i830_hw_state *state = i830->current;
GLuint dirty = state->active & ~state->emitted;
assert(!dirty);
}
void
@ -589,4 +602,5 @@ i830InitVtbl(struct i830_context *i830)
i830->intel.vtbl.update_texture_state = i830UpdateTextureState;
i830->intel.vtbl.flush_cmd = i830_flush_cmd;
i830->intel.vtbl.render_start = i830_render_start;
i830->intel.vtbl.assert_not_dirty = i830_assert_not_dirty;
}