From 9b23aaf3cf89cec0b9fae283adca7812e40ac257 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marcin=20=C5=9Alusarz?= Date: Fri, 11 Mar 2022 11:01:38 +0100 Subject: [PATCH] nir: remove gl_PrimitiveID output from MS when it's not used in FS MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Timur Kristóf Part-of: --- src/compiler/nir/nir_linking_helpers.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_linking_helpers.c b/src/compiler/nir/nir_linking_helpers.c index 8f31dd4..6a574ec 100644 --- a/src/compiler/nir/nir_linking_helpers.c +++ b/src/compiler/nir/nir_linking_helpers.c @@ -148,7 +148,8 @@ nir_remove_unused_io_vars(nir_shader *shader, used = used_by_other_stage; if (var->data.location < VARYING_SLOT_VAR0 && var->data.location >= 0) - continue; + if (shader->info.stage != MESA_SHADER_MESH || var->data.location != VARYING_SLOT_PRIMITIVE_ID) + continue; if (var->data.always_active_io) continue; -- 2.7.4