From ac6725b8f9c331cacd08d95eb22d0c81b0bc9821 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Apr 2010 13:18:51 -0600 Subject: llvmpipe: dump shaders if LP_DEBUG=tgsi --- src/gallium/drivers/llvmpipe/lp_state_fs.c | 5 +++++ src/gallium/drivers/llvmpipe/lp_state_vs.c | 7 +++++++ 2 files changed, 12 insertions(+) (limited to 'src/gallium/drivers/llvmpipe') diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index bc1dc39392..d1afb535c4 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -967,6 +967,11 @@ llvmpipe_create_fs_state(struct pipe_context *pipe, /* we need to keep a local copy of the tokens */ shader->base.tokens = tgsi_dup_tokens(templ->tokens); + if (LP_DEBUG & DEBUG_TGSI) { + debug_printf("llvmpipe: Create fragment shader %p:\n", (void *) shader); + tgsi_dump(templ->tokens, 0); + } + return shader; } diff --git a/src/gallium/drivers/llvmpipe/lp_state_vs.c b/src/gallium/drivers/llvmpipe/lp_state_vs.c index 884e3878e6..118feccc8e 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_vs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_vs.c @@ -28,11 +28,13 @@ #include "pipe/p_defines.h" +#include "tgsi/tgsi_dump.h" #include "tgsi/tgsi_parse.h" #include "util/u_memory.h" #include "draw/draw_context.h" #include "lp_context.h" +#include "lp_debug.h" #include "lp_state.h" @@ -57,6 +59,11 @@ llvmpipe_create_vs_state(struct pipe_context *pipe, if (state->draw_data == NULL) goto fail; + if (LP_DEBUG & DEBUG_TGSI) { + debug_printf("llvmpipe: Create vertex shader %p:\n", (void *) state); + tgsi_dump(templ->tokens, 0); + } + return state; fail: -- cgit v1.2.3