summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_debug.h
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2009-10-05 15:50:11 +0100
committerKeith Whitwell <keithw@vmware.com>2009-10-05 15:51:55 +0100
commitb02ef740b90029bc40629e5b81270a8cf77101d3 (patch)
tree784f5b3804fae4a74fc84130f5922ea5d22c1054 /src/mesa/state_tracker/st_debug.h
parent6a085184ebf251f145181796e317ffa179a38bae (diff)
mesa/st: add ST_DEBUG environment variable
At last it's possible to turn on tgsi dumps and other debugging in the state tracker without modifying sources...
Diffstat (limited to 'src/mesa/state_tracker/st_debug.h')
-rw-r--r--src/mesa/state_tracker/st_debug.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_debug.h b/src/mesa/state_tracker/st_debug.h
index 49d752e1b2..4a060d7759 100644
--- a/src/mesa/state_tracker/st_debug.h
+++ b/src/mesa/state_tracker/st_debug.h
@@ -29,8 +29,44 @@
#ifndef ST_DEBUG_H
#define ST_DEBUG_H
+#include "pipe/p_compiler.h"
+#include "util/u_debug.h"
+
extern void
st_print_current(void);
+#define DEBUG_MESA 0x1
+#define DEBUG_TGSI 0x2
+#define DEBUG_CONSTANTS 0x4
+#define DEBUG_PIPE 0x8
+#define DEBUG_TEX 0x10
+#define DEBUG_FALLBACK 0x20
+#define DEBUG_QUERY 0x40
+#define DEBUG_SCREEN 0x80
+
+#ifdef DEBUG
+extern int ST_DEBUG;
+#define DBSTR(x) x
+#else
+#define ST_DEBUG 0
+#define DBSTR(x) ""
+#endif
+
+void st_debug_init( void );
+
+static INLINE void
+ST_DBG( unsigned flag, const char *fmt, ... )
+{
+ if (ST_DEBUG & flag)
+ {
+ va_list args;
+
+ va_start( args, fmt );
+ debug_vprintf( fmt, args );
+ va_end( args );
+ }
+}
+
+
#endif /* ST_DEBUG_H */