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

this may trigger a batchbuffer flush and raise new dirty state.
This commit is contained in:
Keith Whitwell 2006-09-26 10:39:42 +00:00
parent 520ba25dc3
commit ee525436cc

View file

@ -285,7 +285,7 @@ i915_emit_state(struct intel_context *intel)
struct i915_context *i915 = i915_context(&intel->ctx);
struct i915_hw_state *state = i915->current;
int i;
GLuint dirty = get_dirty(state);
GLuint dirty;
BATCH_LOCALS;
/* We don't hold the lock at this point, so want to make sure that
@ -297,6 +297,11 @@ i915_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 = get_dirty(state);
if (INTEL_DEBUG & DEBUG_STATE)
fprintf(stderr, "%s dirty: %x\n", __FUNCTION__, dirty);