From 49888328a6e277e8e714f6ed07ccabed11ef42fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 20 Mar 2026 00:03:34 -0400 Subject: [PATCH] radeonsi: compute si_shader_info::color_attr_index without input_semantic[] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Acked-by: Pierre-Eric Acked-by: Timur Kristóf Part-of: --- src/gallium/drivers/radeonsi/si_shader_info.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_shader_info.c b/src/gallium/drivers/radeonsi/si_shader_info.c index c2b4cf4dbce..765fb222629 100644 --- a/src/gallium/drivers/radeonsi/si_shader_info.c +++ b/src/gallium/drivers/radeonsi/si_shader_info.c @@ -757,14 +757,14 @@ void si_nir_gather_info(struct si_screen *sscreen, struct nir_shader *nir, if (info->colors_written & (1 << i)) info->colors_written_4bit |= 0xf << (4 * i); + if (nir->info.inputs_read & VARYING_BIT_COL0) + info->color_attr_index[0] = ac_nir_get_io_driver_location(nir, VARYING_SLOT_COL0, true); + if (nir->info.inputs_read & VARYING_BIT_COL1) + info->color_attr_index[1] = ac_nir_get_io_driver_location(nir, VARYING_SLOT_COL1, true); + for (unsigned i = 0; i < info->num_inputs; i++) { /* If any FS input is POS (0), the input slot is unused, which should never happen. */ assert(info->input_semantic[i] != VARYING_SLOT_POS); - - if (info->input_semantic[i] == VARYING_SLOT_COL0) - info->color_attr_index[0] = i; - else if (info->input_semantic[i] == VARYING_SLOT_COL1) - info->color_attr_index[1] = i; } }