i965: Combine offset/texture_offset fields.
[mesa.git] / src / mesa / state_tracker / st_debug.c
index 3009cde9d5181c44c08546330121381790570a74..de3e3a9cdb293fbae95c56d2f8a38459ed76ffcf 100644 (file)
@@ -1,6 +1,6 @@
 /**************************************************************************
  * 
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2007 VMware, Inc.
  * All Rights Reserved.
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -18,7 +18,7 @@
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -27,7 +27,7 @@
 
 
 #include "main/context.h"
-#include "shader/prog_print.h"
+#include "program/prog_print.h"
 
 #include "pipe/p_state.h"
 #include "pipe/p_shader_tokens.h"
 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}
+   { "mesa",     DEBUG_MESA, NULL },
+   { "tgsi",     DEBUG_TGSI, NULL },
+   { "constants",DEBUG_CONSTANTS, NULL },
+   { "pipe",     DEBUG_PIPE, NULL },
+   { "tex",      DEBUG_TEX, NULL },
+   { "fallback", DEBUG_FALLBACK, NULL },
+   { "screen",   DEBUG_SCREEN, NULL },
+   { "query",    DEBUG_QUERY, NULL },
+   { "draw",     DEBUG_DRAW, NULL },
+   { "buffer",   DEBUG_BUFFER, NULL },
+   { "wf",       DEBUG_WIREFRAME, NULL },
+   DEBUG_NAMED_VALUE_END
 };
+
+DEBUG_GET_ONCE_FLAGS_OPTION(st_debug, "ST_DEBUG", st_debug_flags, 0)
 #endif
 
 
@@ -61,7 +67,7 @@ void
 st_debug_init(void)
 {
 #ifdef DEBUG
-   ST_DEBUG = debug_get_flags_option("ST_DEBUG", st_debug_flags, 0 );
+   ST_DEBUG = debug_get_option_st_debug();
 #endif
 }
 
@@ -75,7 +81,7 @@ void
 st_print_current(void)
 {
    GET_CURRENT_CONTEXT(ctx);
-   struct st_context *st = ctx->st;
+   struct st_context *st = st_context(ctx);
 
 #if 0
    int i;
@@ -86,11 +92,12 @@ st_print_current(void)
    }
 #endif
 
-   tgsi_dump( st->vp->state.tokens, 0 );
+   if (st->vp->variants)
+      tgsi_dump( st->vp->variants[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->variants[0].tgsi.tokens, 0 );
    if (st->fp->Base.Base.Parameters)
       _mesa_print_parameter_list(st->fp->Base.Base.Parameters);
 }