radv: lower SHADER_RECORD_INDEX to non-uniform

This fixes an issue with RADV and NVIDIA-RTX/Donut-Samples with heap
support in vkd3d-proton.

Backport-to: 26.1
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40953>
This commit is contained in:
Samuel Pitoiset 2026-04-15 11:21:09 +02:00
parent 8e2869fa41
commit 477c44ba93

View file

@ -799,8 +799,12 @@ radv_shader_spirv_to_nir(struct radv_device *device, struct radv_shader_stage *s
NIR_PASS(progress, nir, nir_lower_flrp, lower_flrp, false /* always precise */);
if (stage->key.descriptor_heap) {
const vk_nir_lower_descriptor_heaps_options heap_options = {
.lower_shader_record_index_to_non_uniform = true,
};
progress = false;
NIR_PASS(progress, nir, vk_nir_lower_descriptor_heaps, stage->layout.mapping, NULL, &embedded_samplers);
NIR_PASS(progress, nir, vk_nir_lower_descriptor_heaps, stage->layout.mapping, &heap_options, &embedded_samplers);
if (progress) {
NIR_PASS(_, nir, nir_remove_dead_variables, nir_var_uniform | nir_var_image, NULL);
NIR_PASS(_, nir, nir_opt_dce);