diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2007-05-13 17:14:19 +0100 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2007-05-13 17:15:58 +0100 |
commit | b11216f4b76ebc8e6fffa00672714fe2c7db7640 (patch) | |
tree | 69d5f524686c940f954970511a1c84f9a5bf85b1 | |
parent | d8137ca406c49c5393c38ab1db07111dbb866a82 (diff) |
Add assertions for indirect state validity.
-rw-r--r-- | src/mesa/drivers/dri/i915tex/i915_differencer.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i915tex/i915_differencer.c b/src/mesa/drivers/dri/i915tex/i915_differencer.c index 3f8cc43698..618f612280 100644 --- a/src/mesa/drivers/dri/i915tex/i915_differencer.c +++ b/src/mesa/drivers/dri/i915tex/i915_differencer.c @@ -148,9 +148,12 @@ static void emit_indirect( struct intel_context *intel, /* No state size dword for dynamic state: */ + EMIT_DWORD( ptr, state->sizes[i]-1 ); + assert(state->sizes[i] > 0); - EMIT_DWORD( ptr, - state->sizes[i]-1 ); + assert(intel->batch->segment_start_offset[2] <= state->offsets[i]); + assert(intel->batch->segment_finish_offset[2] >= + state->offsets[i] + state->sizes[i]*4 ); } else { assert( (state->offsets[i] & 4095) >= 4 ); @@ -161,6 +164,9 @@ static void emit_indirect( struct intel_context *intel, intel->batch->state_memflags, DRM_BO_MASK_MEM | DRM_BO_FLAG_EXE, ( (state->offsets[i] - 4) | flag | SIS0_BUFFER_VALID ) ); + + assert(intel->batch->segment_start_offset[1] <= state->offsets[i]); + assert(intel->batch->segment_finish_offset[1] >= state->offsets[i]); } } } |