aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/cell/spu/spu_main.h
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-10-15 13:55:18 -0600
committerBrian Paul <[email protected]>2008-10-15 13:55:18 -0600
commitddeec1ed10d6c12403fe8d30c072ea68f044db99 (patch)
treeae7b571024a8417986fcad8ee30c659af1628cee /src/gallium/drivers/cell/spu/spu_main.h
parent53951531ae7bfd64afae1ae55aac7f6ebd3fe4f5 (diff)
cell: simplify spu debug code
Diffstat (limited to 'src/gallium/drivers/cell/spu/spu_main.h')
-rw-r--r--src/gallium/drivers/cell/spu/spu_main.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/gallium/drivers/cell/spu/spu_main.h b/src/gallium/drivers/cell/spu/spu_main.h
index ca72baea8b3..569b9e45d42 100644
--- a/src/gallium/drivers/cell/spu/spu_main.h
+++ b/src/gallium/drivers/cell/spu/spu_main.h
@@ -36,6 +36,19 @@
#include "pipe/p_state.h"
+#if DEBUG
+/* These debug macros use the unusual construction ", ##__VA_ARGS__"
+ * which expands to the expected comma + args if variadic arguments
+ * are supplied, but swallows the comma if there are no variadic
+ * arguments (which avoids syntax errors that would otherwise occur).
+ */
+#define D_PRINTF(flag, format,...) \
+ if (spu.init.debug_flags & (flag)) \
+ printf("SPU %u: " format, spu.init.id, ##__VA_ARGS__)
+#else
+#define D_PRINTF(...)
+#endif
+
#define MAX_WIDTH 1024
#define MAX_HEIGHT 1024
@@ -187,8 +200,6 @@ struct spu_global
extern struct spu_global spu;
-extern boolean Debug;
-