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