From 621b8788bbfe65325f9229e26236562452142d5c Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 26 May 2021 09:24:28 -0400 Subject: [PATCH] llvmpipe: only dump tgsi shaders if they're actually tgsi shaders this crashes otherwise Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/llvmpipe/lp_state_fs.c | 2 +- src/gallium/drivers/llvmpipe/lp_state_gs.c | 2 +- src/gallium/drivers/llvmpipe/lp_state_tess.c | 2 +- src/gallium/drivers/llvmpipe/lp_state_vs.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index 2fe01ce48d6..563408ac8e0 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -3677,7 +3677,7 @@ llvmpipe_create_fs_state(struct pipe_context *pipe, shader->inputs[i].src_index = i+1; } - if (LP_DEBUG & DEBUG_TGSI) { + if (LP_DEBUG & DEBUG_TGSI && templ->type == PIPE_SHADER_IR_TGSI) { unsigned attrib; debug_printf("llvmpipe: Create fragment shader #%u %p:\n", shader->no, (void *) shader); diff --git a/src/gallium/drivers/llvmpipe/lp_state_gs.c b/src/gallium/drivers/llvmpipe/lp_state_gs.c index 302d599024d..763fb4e8ae8 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_gs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_gs.c @@ -51,7 +51,7 @@ llvmpipe_create_gs_state(struct pipe_context *pipe, goto no_state; /* debug */ - if (LP_DEBUG & DEBUG_TGSI) { + if (LP_DEBUG & DEBUG_TGSI && templ->type == PIPE_SHADER_IR_TGSI) { debug_printf("llvmpipe: Create geometry shader %p:\n", (void *)state); tgsi_dump(templ->tokens, 0); } diff --git a/src/gallium/drivers/llvmpipe/lp_state_tess.c b/src/gallium/drivers/llvmpipe/lp_state_tess.c index b3f8e74af97..b9e919e76fc 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_tess.c +++ b/src/gallium/drivers/llvmpipe/lp_state_tess.c @@ -49,7 +49,7 @@ llvmpipe_create_tcs_state(struct pipe_context *pipe, goto no_state; /* debug */ - if (LP_DEBUG & DEBUG_TGSI) { + if (LP_DEBUG & DEBUG_TGSI && templ->type == PIPE_SHADER_IR_TGSI) { debug_printf("llvmpipe: Create tess ctrl shader %p:\n", (void *)state); tgsi_dump(templ->tokens, 0); } diff --git a/src/gallium/drivers/llvmpipe/lp_state_vs.c b/src/gallium/drivers/llvmpipe/lp_state_vs.c index 96a00189b55..199e6191086 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_vs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_vs.c @@ -50,7 +50,7 @@ llvmpipe_create_vs_state(struct pipe_context *pipe, return NULL; } - if (LP_DEBUG & DEBUG_TGSI) { + if (LP_DEBUG & DEBUG_TGSI && templ->type == PIPE_SHADER_IR_TGSI) { debug_printf("llvmpipe: Create vertex shader %p:\n", (void *) vs); tgsi_dump(templ->tokens, 0); }