diff options
author | Emma Anholt <emma@anholt.net> | 2022-02-05 20:18:58 -0800 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2022-02-15 18:15:29 +0000 |
commit | 3652ff2fa1db74a1f742138d50f3130f7a7a0ab9 (patch) | |
tree | dcdcb4fa37179351b62eacd4abc68882bcb203df | |
parent | 780949c62bc2cd1805f99911a76fde016e430b6b (diff) |
draw: Don't look at .nir if !IR_NIR.
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 <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14896>
-rw-r--r-- | src/gallium/auxiliary/draw/draw_vs_llvm.c | 4 |
1 files changed, 1 insertions, 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) |