Merge branch 'mesa_7_6_branch'
[mesa.git] / src / mesa / state_tracker / st_debug.c
index 5888bcb98a3155ec17a38ae96a2ab6818077fa80..3009cde9d5181c44c08546330121381790570a74 100644 (file)
@@ -31,7 +31,7 @@
 
 #include "pipe/p_state.h"
 #include "pipe/p_shader_tokens.h"
-#include "tgsi/util/tgsi_dump.h"
+#include "tgsi/tgsi_dump.h"
 
 #include "cso_cache/cso_cache.h"
 
 
 
 
+#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.
@@ -50,18 +76,23 @@ st_print_current(void)
 {
    GET_CURRENT_CONTEXT(ctx);
    struct st_context *st = ctx->st;
+
+#if 0
    int i;
 
    printf("Vertex Transform Inputs:\n");
-   for (i = 0; i < st->state.vs->cso->state.num_inputs; i++) {
+   for (i = 0; i < st->vp->state.num_inputs; i++) {
       printf("  Slot %d:  VERT_ATTRIB_%d\n", i, st->vp->index_to_input[i]);
    }
+#endif
 
-   tgsi_dump( st->state.vs->cso->state.tokens, 0 );
+   tgsi_dump( st->vp->state.tokens, 0 );
    if (st->vp->Base.Base.Parameters)
       _mesa_print_parameter_list(st->vp->Base.Base.Parameters);
 
-   tgsi_dump( st->state.fs->state.tokens, 0 );
+   tgsi_dump( st->fp->state.tokens, 0 );
    if (st->fp->Base.Base.Parameters)
       _mesa_print_parameter_list(st->fp->Base.Base.Parameters);
 }
+
+