llvmpipe: only dump tgsi shaders if they're actually tgsi shaders

this crashes otherwise

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11016>
This commit is contained in:
Mike Blumenkrantz 2021-05-26 09:24:28 -04:00 committed by Marge Bot
parent 9f5e4ccdb9
commit 621b8788bb
4 changed files with 4 additions and 4 deletions

View File

@ -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);

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}