diff options
author | Eric Anholt <[email protected]> | 2010-03-05 12:56:40 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2010-03-05 15:23:30 -0800 |
commit | 855515859ec1d94737ea91167220ba7b568c144d (patch) | |
tree | 341e4bb8d2cc7181d4a70a89e13940e02c5c09ec | |
parent | 7392002041f6c7ac6eb788d7b154f2b44eb6f403 (diff) |
intel: Only do batchbuffer debug if --enable-debug is used.
This saves 6.6KB on the 965 driver, and appears to speed
firefox-talos-gfx up by 1-2%. Unlike many other asserts in the
driver, when we make a mistake that would trigger one of these it
generally shows up all the time for developers, so turning it off for
release seems fine.
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_batchbuffer.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.h b/src/mesa/drivers/dri/intel/intel_batchbuffer.h index 5e0ea916b4e..e5ad2617ab9 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.h +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.h @@ -24,11 +24,13 @@ struct intel_batchbuffer GLuint size; +#ifdef DEBUG /** Tracking of BEGIN_BATCH()/OUT_BATCH()/ADVANCE_BATCH() debugging */ struct { GLuint total; GLubyte *start_ptr; } emit; +#endif GLuint dirty_state; GLuint reserved_space; @@ -97,7 +99,9 @@ intel_batchbuffer_space(struct intel_batchbuffer *batch) static INLINE void intel_batchbuffer_emit_dword(struct intel_batchbuffer *batch, GLuint dword) { +#ifdef DEBUG assert(intel_batchbuffer_space(batch) >= 4); +#endif *(GLuint *) (batch->ptr) = dword; batch->ptr += 4; } @@ -112,7 +116,9 @@ static INLINE void intel_batchbuffer_require_space(struct intel_batchbuffer *batch, GLuint sz) { +#ifdef DEBUG assert(sz < batch->size - 8); +#endif if (intel_batchbuffer_space(batch) < sz) intel_batchbuffer_flush(batch); } @@ -121,15 +127,18 @@ static INLINE void intel_batchbuffer_begin(struct intel_batchbuffer *batch, int n) { intel_batchbuffer_require_space(batch, n * 4); +#ifdef DEBUG assert(batch->map); assert(batch->emit.start_ptr == NULL); batch->emit.total = n * 4; batch->emit.start_ptr = batch->ptr; +#endif } static INLINE void intel_batchbuffer_advance(struct intel_batchbuffer *batch) { +#ifdef DEBUG unsigned int _n = batch->ptr - batch->emit.start_ptr; assert(batch->emit.start_ptr != NULL); if (_n != batch->emit.total) { @@ -138,6 +147,7 @@ intel_batchbuffer_advance(struct intel_batchbuffer *batch) abort(); } batch->emit.start_ptr = NULL; +#endif } /* Here are the crusty old macros, to be removed: |