From 58f12b3c8146618500ca2d830b5e475f0ec3997b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sun, 1 Jun 2025 17:22:38 -0400 Subject: [PATCH] radeonsi: don't count outputs with GS streams > 0 for outputs_written_before_ps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit outputs_written_before_ps is used to determine kill_outputs, which removes param exports, but non-zero GS streams are xfb-only and not exported. Acked-by: Pierre-Eric Pelloux-Prayer Acked-by: Timur Kristóf Part-of: --- src/gallium/drivers/radeonsi/si_shader_info.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_shader_info.c b/src/gallium/drivers/radeonsi/si_shader_info.c index 5ad889d2c68..069cb2ae1b9 100644 --- a/src/gallium/drivers/radeonsi/si_shader_info.c +++ b/src/gallium/drivers/radeonsi/si_shader_info.c @@ -165,15 +165,16 @@ static void scan_io_usage(const nir_shader *nir, struct si_shader_info *info, /* Output stores. */ unsigned gs_streams = (uint32_t)nir_intrinsic_io_semantics(intr).gs_streams << (nir_intrinsic_component(intr) * 2); + bool writes_stream0 = false; /* Iterate over all components. */ u_foreach_bit(i, mask) { unsigned stream = (gs_streams >> (i * 2)) & 0x3; - - if (stream == 0) - info->gs_writes_stream0 = true; + writes_stream0 |= stream == 0; } + info->gs_writes_stream0 |= writes_stream0; + if (nir_intrinsic_has_src_type(intr)) info->output_type[loc] = nir_intrinsic_src_type(intr); else if (nir_intrinsic_has_dest_type(intr)) @@ -204,7 +205,8 @@ static void scan_io_usage(const nir_shader *nir, struct si_shader_info *info, if (slot_semantic != VARYING_SLOT_POS && slot_semantic != VARYING_SLOT_PSIZ && slot_semantic != VARYING_SLOT_CLIP_VERTEX && - slot_semantic != VARYING_SLOT_LAYER) + slot_semantic != VARYING_SLOT_LAYER && + writes_stream0) info->outputs_written_before_ps |= bit; /* LAYER and VIEWPORT have no effect if they don't feed the rasterizer. */