From 8e93907b7c8d12d093f0059660adab756874ab45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 2 Oct 2024 18:29:55 -0400 Subject: [PATCH] nir/opt_varyings: assign locations of no_varying IO for TCS outputs only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Skip the code for other shader stages because it doesn't do anything there. Acked-by: Alyssa Rosenzweig Reviewed-by: Timur Kristóf Part-of: --- src/compiler/nir/nir_opt_varyings.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/compiler/nir/nir_opt_varyings.c b/src/compiler/nir/nir_opt_varyings.c index e674d59aafd..de62b663d3b 100644 --- a/src/compiler/nir/nir_opt_varyings.c +++ b/src/compiler/nir/nir_opt_varyings.c @@ -4190,13 +4190,15 @@ compact_varyings(struct linkage_info *linkage, vs_tcs_tes_gs_assign_slots(linkage, linkage->flat16_mask, &slot_index, &patch_slot_index, 1, progress); - /* Put no-varying slots last. These are TCS outputs read by TCS but not - * TES. - */ - vs_tcs_tes_gs_assign_slots(linkage, linkage->no_varying32_mask, &slot_index, - &patch_slot_index, 2, progress); - vs_tcs_tes_gs_assign_slots(linkage, linkage->no_varying16_mask, &slot_index, - &patch_slot_index, 1, progress); + if (linkage->producer_stage == MESA_SHADER_TESS_CTRL) { + /* Put no-varying slots last. These are TCS outputs read by TCS but + * not TES. + */ + vs_tcs_tes_gs_assign_slots(linkage, linkage->no_varying32_mask, + &slot_index, &patch_slot_index, 2, progress); + vs_tcs_tes_gs_assign_slots(linkage, linkage->no_varying16_mask, + &slot_index, &patch_slot_index, 1, progress); + } assert(slot_index <= VARYING_SLOT_MAX * 8); assert(patch_slot_index <= VARYING_SLOT_TESS_MAX * 8);