Merge branch '7.8' into master
[mesa.git] / src / mesa / state_tracker / st_debug.c
index c7d26ce33cf4a35ca40ad1234e3c88d72e5b24c3..5dbabfa5c2feac2a0c160c1f020eb2e8fa3cd7e8 100644 (file)
 
 
 
+#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.
@@ -60,11 +86,14 @@ st_print_current(void)
    }
 #endif
 
-   tgsi_dump( st->vp->state.tokens, 0 );
+   if (st->vp->varients)
+      tgsi_dump( st->vp->varients[0].tgsi.tokens, 0 );
    if (st->vp->Base.Base.Parameters)
       _mesa_print_parameter_list(st->vp->Base.Base.Parameters);
 
-   tgsi_dump( st->fp->state.tokens, 0 );
+   tgsi_dump( st->fp->tgsi.tokens, 0 );
    if (st->fp->Base.Base.Parameters)
       _mesa_print_parameter_list(st->fp->Base.Base.Parameters);
 }
+
+