diff options
author | Marek Olšák <[email protected]> | 2010-06-13 21:16:00 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2010-06-14 00:52:11 +0200 |
commit | c1f18bff3e40cb5a5534974eb41558e169065a8b (patch) | |
tree | bad25a0acf9cf7bb6fe9fd9b638d59fe2bfea377 /src/gallium/drivers/r300/r300_cb.h | |
parent | f558bcb397e4016558b58fef01997b323ed931b0 (diff) |
r300g: count CS dwords on debug builds only
Diffstat (limited to 'src/gallium/drivers/r300/r300_cb.h')
-rw-r--r-- | src/gallium/drivers/r300/r300_cb.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/gallium/drivers/r300/r300_cb.h b/src/gallium/drivers/r300/r300_cb.h index 934526323c6..9d3d4fc1b19 100644 --- a/src/gallium/drivers/r300/r300_cb.h +++ b/src/gallium/drivers/r300/r300_cb.h @@ -61,32 +61,38 @@ * that they neatly hide away, and don't have the cost of function setup, so * we're going to use them. */ +#ifdef DEBUG +#define CB_DEBUG(x) x +#else +#define CB_DEBUG(x) +#endif + /** * Command buffer setup. */ #define CB_LOCALS \ - int cs_count = 0; \ + CB_DEBUG(int cs_count = 0;) \ uint32_t *cs_ptr = NULL; \ - (void) cs_count; (void) cs_ptr; + CB_DEBUG((void) cs_count;) (void) cs_ptr; #define NEW_CB(ptr, size) do { \ assert(sizeof(*ptr) == sizeof(uint32_t)); \ cs_ptr = (ptr) = (uint32_t*)malloc((size) * sizeof(uint32_t)); \ - cs_count = size; \ + CB_DEBUG(cs_count = size;) \ } while (0) #define BEGIN_CB(ptr, size) do { \ assert(sizeof(*ptr) == sizeof(uint32_t)); \ cs_ptr = ptr; \ - cs_count = size; \ + CB_DEBUG(cs_count = size;) \ } while (0) #define END_CB do { \ - if (cs_count != 0) \ + CB_DEBUG(if (cs_count != 0) \ debug_printf("r300: Warning: cs_count off by %d at (%s, %s:%i)\n", \ - cs_count, __FUNCTION__, __FILE__, __LINE__); \ + cs_count, __FUNCTION__, __FILE__, __LINE__);) \ } while (0) @@ -97,13 +103,13 @@ #define OUT_CB(value) do { \ *cs_ptr = (value); \ cs_ptr++; \ - cs_count--; \ + CB_DEBUG(cs_count--;) \ } while (0) #define OUT_CB_TABLE(values, count) do { \ memcpy(cs_ptr, values, count * sizeof(uint32_t)); \ cs_ptr += count; \ - cs_count -= count; \ + CB_DEBUG(cs_count -= count;) \ } while (0) #define OUT_CB_32F(value) \ |