Without this we do not end up with a deterministic NIR. NIR must
be deterministic here because we use it to produce a sha for the
radeonsi backends disk cache.

This fixes the shader cache for a bunch of shaders.
---
 src/gallium/drivers/radeonsi/si_shader_nir.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c 
b/src/gallium/drivers/radeonsi/si_shader_nir.c
index 7554f5b9f8b..96096abe4ea 100644
--- a/src/gallium/drivers/radeonsi/si_shader_nir.c
+++ b/src/gallium/drivers/radeonsi/si_shader_nir.c
@@ -848,6 +848,9 @@ si_lower_nir(struct si_shader_selector* sel)
        } while (progress);
 
        NIR_PASS_V(sel->nir, nir_lower_bool_to_int32);
+
+       nir_variable_mode mask = nir_var_function_temp;
+       nir_remove_dead_variables(sel->nir, mask);
 }
 
 static void declare_nir_input_vs(struct si_shader_context *ctx,
-- 
2.20.1

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to