From cbf07628bcb51c275e155e62c1ad8819984a5fd9 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Thu, 1 Aug 2024 13:13:49 +0200 Subject: [PATCH] vtn: Remove dead shader_call_data from all RT stages Having multiple shader_call_data can cause incorrect behavior since the compiler expects there to be only one shader_call_data variable. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11585 Reviewed-by: Friedrich Vock Reviewed-by: Faith Ekstrand Part-of: --- src/compiler/spirv/spirv_to_nir.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index 2afdc557a47..0cf3a3fced0 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -7058,11 +7058,13 @@ spirv_to_nir(const uint32_t *words, size_t word_count, } /* Work around applications that declare shader_call_data variables inside - * ray generation shaders. + * ray generation shaders or multiple shader_call_data variables in callable + * shaders. * * https://gitlab.freedesktop.org/mesa/mesa/-/issues/5326 + * https://gitlab.freedesktop.org/mesa/mesa/-/issues/11585 */ - if (stage == MESA_SHADER_RAYGEN) + if (gl_shader_stage_is_rt(b->shader->info.stage)) NIR_PASS(_, b->shader, nir_remove_dead_variables, nir_var_shader_call_data, NULL);