From 3652ff2fa1db74a1f742138d50f3130f7a7a0ab9 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Sat, 5 Feb 2022 20:18:58 -0800 Subject: [PATCH] draw: Don't look at .nir if !IR_NIR. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I suspect this double-check and comment was due to originally using ir.nir as the condition, which might be uninitialized if !IR_NIR. You could only take the branch if IR_NIR was set, and you should always not take if it !IR_NIR, so it worked out in the end, but it would cause spurious valgrind warnings if you hadn't zeroed out your TGSI shader's struct. Reviewed-by: Zoltán Böszörményi Part-of: --- src/gallium/auxiliary/draw/draw_vs_llvm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/gallium/auxiliary/draw/draw_vs_llvm.c b/src/gallium/auxiliary/draw/draw_vs_llvm.c index 00c63ed5f45..a605ee102fe 100644 --- a/src/gallium/auxiliary/draw/draw_vs_llvm.c +++ b/src/gallium/auxiliary/draw/draw_vs_llvm.c @@ -94,9 +94,7 @@ draw_create_vs_llvm(struct draw_context *draw, if (!vs) return NULL; - /* due to some bugs in the feedback state tracker we have to check - for ir.nir & PIPE_SHADER_IR_NIR here. */ - if (state->ir.nir && state->type == PIPE_SHADER_IR_NIR) { + if (state->type == PIPE_SHADER_IR_NIR) { vs->base.state.ir.nir = state->ir.nir; nir_shader *nir = (nir_shader *)state->ir.nir; if (!nir->options->lower_uniforms_to_ubo)