summaryrefslogtreecommitdiff
path: root/src/mesa/main/debug.c
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-11-10 15:53:51 +1100
committerBen Skeggs <skeggsb@gmail.com>2008-11-10 15:53:51 +1100
commit32e6be6362e44609d36c2fb20a4c858f57c908fb (patch)
tree4ed99e93ef5f4a8bb51653917c911e04e42f5235 /src/mesa/main/debug.c
parent92674bc8889e10e580c630cf85c106fa6eb34d7b (diff)
parent399da3a337932c6074a69ac73e711138271308eb (diff)
Merge remote branch 'origin/gallium-0.2' into gallium-0.2
Diffstat (limited to 'src/mesa/main/debug.c')
-rw-r--r--src/mesa/main/debug.c54
1 files changed, 25 insertions, 29 deletions
diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c
index 98ca65b96a..77fef32558 100644
--- a/src/mesa/main/debug.c
+++ b/src/mesa/main/debug.c
@@ -150,36 +150,32 @@ void _mesa_print_info( void )
static void add_debug_flags( const char *debug )
{
#ifdef DEBUG
- if (_mesa_strstr(debug, "varray"))
- MESA_VERBOSE |= VERBOSE_VARRAY;
-
- if (_mesa_strstr(debug, "tex"))
- MESA_VERBOSE |= VERBOSE_TEXTURE;
-
- if (_mesa_strstr(debug, "imm"))
- MESA_VERBOSE |= VERBOSE_IMMEDIATE;
-
- if (_mesa_strstr(debug, "pipe"))
- MESA_VERBOSE |= VERBOSE_PIPELINE;
-
- if (_mesa_strstr(debug, "driver"))
- MESA_VERBOSE |= VERBOSE_DRIVER;
-
- if (_mesa_strstr(debug, "state"))
- MESA_VERBOSE |= VERBOSE_STATE;
-
- if (_mesa_strstr(debug, "api"))
- MESA_VERBOSE |= VERBOSE_API;
-
- if (_mesa_strstr(debug, "list"))
- MESA_VERBOSE |= VERBOSE_DISPLAY_LIST;
-
- if (_mesa_strstr(debug, "lighting"))
- MESA_VERBOSE |= VERBOSE_LIGHTING;
+ struct debug_option {
+ const char *name;
+ GLbitfield flag;
+ };
+ static const struct debug_option debug_opt[] = {
+ { "varray", VERBOSE_VARRAY },
+ { "tex", VERBOSE_TEXTURE },
+ { "imm", VERBOSE_IMMEDIATE },
+ { "pipe", VERBOSE_PIPELINE },
+ { "driver", VERBOSE_DRIVER },
+ { "state", VERBOSE_STATE },
+ { "api", VERBOSE_API },
+ { "list", VERBOSE_DISPLAY_LIST },
+ { "lighting", VERBOSE_LIGHTING },
+ { "disassem", VERBOSE_DISASSEM },
+ { "glsl", VERBOSE_GLSL }, /* report GLSL compile/link errors */
+ { "glsl_dump", VERBOSE_GLSL_DUMP } /* print shader GPU instructions */
+ };
+ GLuint i;
+
+ MESA_VERBOSE = 0x0;
+ for (i = 0; i < Elements(debug_opt); i++) {
+ if (_mesa_strstr(debug, debug_opt[i].name))
+ MESA_VERBOSE |= debug_opt[i].flag;
+ }
- if (_mesa_strstr(debug, "disassem"))
- MESA_VERBOSE |= VERBOSE_DISASSEM;
-
/* Debug flag:
*/
if (_mesa_strstr(debug, "flush"))