summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2006-09-26 11:36:32 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2006-09-26 11:36:32 +0000
commitf397a2a1e5c5a0e954efe0eb98e4e6768edc264b (patch)
treeb46f2a0fc63a3727934e164b0e380059f7e3726a
parent87a031206853a7e37d7a475c985b621edd051c15 (diff)
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.
-rw-r--r--src/mesa/drivers/dri/i915/i830_vtbl.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i915/i830_vtbl.c b/src/mesa/drivers/dri/i915/i830_vtbl.c
index 4fd1617319..325ff86973 100644
--- a/src/mesa/drivers/dri/i915/i830_vtbl.c
+++ b/src/mesa/drivers/dri/i915/i830_vtbl.c
@@ -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;
}