From 21ff2907c77eb16835268ea24540d43b9ea62fc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Krist=C3=B3f?= Date: Thu, 11 Apr 2024 00:45:43 +0200 Subject: [PATCH] nir/opt_varyings: Allow optimizing primitive ID for MS -> FS. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Timur Kristóf Reviewed-by: Marek Olšák Part-of: --- src/compiler/nir/nir_opt_varyings.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/compiler/nir/nir_opt_varyings.c b/src/compiler/nir/nir_opt_varyings.c index f9cab8bf901..e1741c25b95 100644 --- a/src/compiler/nir/nir_opt_varyings.c +++ b/src/compiler/nir/nir_opt_varyings.c @@ -991,8 +991,9 @@ can_optimize_varying(struct linkage_info *linkage, gl_varying_slot location) location == VARYING_SLOT_FOGC) return options_var; - /* The primitive ID can always be optimized in GS -> FS. */ - if (linkage->producer_stage == MESA_SHADER_GEOMETRY && + /* The primitive ID can always be optimized in GS -> FS and MS -> FS. */ + if ((linkage->producer_stage == MESA_SHADER_GEOMETRY || + linkage->producer_stage == MESA_SHADER_MESH) && location == VARYING_SLOT_PRIMITIVE_ID) return options_var;