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 <friedrich.vock@gmx.de>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30468>
This commit is contained in:
Konstantin 2024-08-01 13:13:49 +02:00 committed by Marge Bot
parent fb03aed435
commit cbf07628bc

View file

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