From 5d4f59a3ed4498a08f440d2de39b3c5054aa3b51 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Wed, 9 Jul 2025 22:58:30 +0200 Subject: [PATCH] r600/sfn: catch remaining indirect inputs when lowering GS input arrays Lowering IO to temps leads to problems with RA with piglit spec@glsl-1.50@execution@geometry@max-input-component Not doing so results in an assertion failure with piglit spec@glsl-1.50@execution@geometry@dynamic_input_array_index because not all indirect IO access is lowered. Using nir_lower_indirect_derefs works around this limitations. v2: Fix formatting (Patrick Lerda) Fixes: 1186c73c6 (r600: implement gs indirect load_per_vertex_input) Signed-off-by: Gert Wollny Part-of: --- src/gallium/drivers/r600/sfn/sfn_nir.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gallium/drivers/r600/sfn/sfn_nir.cpp b/src/gallium/drivers/r600/sfn/sfn_nir.cpp index 1dac69b95f4..e7667ead4e7 100644 --- a/src/gallium/drivers/r600/sfn/sfn_nir.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_nir.cpp @@ -798,6 +798,11 @@ r600_finalize_nir_common(nir_shader *nir, enum amd_gfx_level gfx_level) if (nir->info.stage == MESA_SHADER_GEOMETRY) { NIR_PASS(_, nir, r600_gs_load_deref_io_to_indirect_per_vertex_input); + NIR_PASS(_, + nir, + nir_lower_indirect_derefs, + nir_var_shader_in, + R600_GS_VERTEX_INDIRECT_TOTAL); } NIR_PASS(_, nir, nir_lower_flrp, nir_lower_flrp_mask, false);