summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_debug.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2009-10-05 15:50:11 +0100
committerKeith Whitwell <[email protected]>2009-10-05 15:51:55 +0100
commitb02ef740b90029bc40629e5b81270a8cf77101d3 (patch)
tree784f5b3804fae4a74fc84130f5922ea5d22c1054 /src/mesa/state_tracker/st_debug.c
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.c')
-rw-r--r--src/mesa/state_tracker/st_debug.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_debug.c b/src/mesa/state_tracker/st_debug.c
index c7d26ce33cf..3009cde9d51 100644
--- a/src/mesa/state_tracker/st_debug.c
+++ b/src/mesa/state_tracker/st_debug.c
@@ -41,6 +41,32 @@
+#ifdef DEBUG
+int ST_DEBUG = 0;
+
+static const struct debug_named_value st_debug_flags[] = {
+ { "mesa", DEBUG_MESA },
+ { "tgsi", DEBUG_TGSI },
+ { "pipe", DEBUG_PIPE },
+ { "tex", DEBUG_TEX },
+ { "fallback", DEBUG_FALLBACK },
+ { "screen", DEBUG_SCREEN },
+ { "query", DEBUG_QUERY },
+ {NULL, 0}
+};
+#endif
+
+
+void
+st_debug_init(void)
+{
+#ifdef DEBUG
+ ST_DEBUG = debug_get_flags_option("ST_DEBUG", st_debug_flags, 0 );
+#endif
+}
+
+
+
/**
* Print current state. May be called from inside gdb to see currently
* bound vertex/fragment shaders and associated constants.
@@ -68,3 +94,5 @@ st_print_current(void)
if (st->fp->Base.Base.Parameters)
_mesa_print_parameter_list(st->fp->Base.Base.Parameters);
}
+
+