radv: Work around shader_call_data variables in raygen shaders

Closes: #5326
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20930>
This commit is contained in:
Konstantin Seurer 2023-01-26 11:30:17 +01:00 committed by Marge Bot
parent 002707ff09
commit 4397c166c0

View file

@ -842,6 +842,12 @@ radv_shader_spirv_to_nir(struct radv_device *device, const struct radv_pipeline_
&device->physical_device->nir_options[stage->stage]);
nir->info.internal |= is_internal;
assert(nir->info.stage == stage->stage);
/* Work around applications that declare shader_call_data variables inside ray generation
* shaders. */
if (nir->info.stage == MESA_SHADER_RAYGEN)
NIR_PASS(_, nir, nir_remove_dead_variables, nir_var_shader_call_data, NULL);
nir_validate_shader(nir, "after spirv_to_nir");
free(spec_entries);