diff options
author | Keith Whitwell <[email protected]> | 2009-10-05 15:50:11 +0100 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2009-10-05 15:51:55 +0100 |
commit | b02ef740b90029bc40629e5b81270a8cf77101d3 (patch) | |
tree | 784f5b3804fae4a74fc84130f5922ea5d22c1054 /src/mesa/state_tracker/st_program.c | |
parent | 6a085184ebf251f145181796e317ffa179a38bae (diff) |
mesa/st: add ST_DEBUG environment variable
At last it's possible to turn on tgsi dumps and other debugging in the
state tracker without modifying sources...
Diffstat (limited to 'src/mesa/state_tracker/st_program.c')
-rw-r--r-- | src/mesa/state_tracker/st_program.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 927f60cc7e9..a9be80ce8f3 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -42,6 +42,7 @@ #include "draw/draw_context.h" #include "tgsi/tgsi_dump.h" +#include "st_debug.h" #include "st_context.h" #include "st_atom.h" #include "st_program.h" @@ -49,9 +50,6 @@ #include "cso_cache/cso_context.h" -#define TGSI_DEBUG 0 - - /** * Translate a Mesa vertex shader into a TGSI shader. * \param outputMapping to map vertex program output registers (VERT_RESULT_x) @@ -346,11 +344,15 @@ st_translate_vertex_program(struct st_context *st, stvp->num_inputs = vs_num_inputs; stvp->driver_shader = pipe->create_vs_state(pipe, &stvp->state); - if (0) + if ((ST_DEBUG & DEBUG_TGSI) && (ST_DEBUG & DEBUG_MESA)) { _mesa_print_program(&stvp->Base.Base); + debug_printf("\n"); + } - if (TGSI_DEBUG) + if (ST_DEBUG & DEBUG_TGSI) { tgsi_dump( stvp->state.tokens, 0 ); + debug_printf("\n"); + } } @@ -526,11 +528,15 @@ st_translate_fragment_program(struct st_context *st, stfp->driver_shader = pipe->create_fs_state(pipe, &stfp->state); - if (0) + if ((ST_DEBUG & DEBUG_TGSI) && (ST_DEBUG & DEBUG_MESA)) { _mesa_print_program(&stfp->Base.Base); + debug_printf("\n"); + } - if (TGSI_DEBUG) + if (ST_DEBUG & DEBUG_TGSI) { tgsi_dump( stfp->state.tokens, 0/*TGSI_DUMP_VERBOSE*/ ); + debug_printf("\n"); + } } |