summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_debug.c
diff options
context:
space:
mode:
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);
}
+
+