From: Marcin Ślusarz Date: Fri, 11 Mar 2022 10:01:38 +0000 (+0100) Subject: nir: remove gl_PrimitiveID output from MS when it's not used in FS X-Git-Tag: upstream/22.3.5~10544 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9b23aaf3cf89cec0b9fae283adca7812e40ac257;p=platform%2Fupstream%2Fmesa.git nir: remove gl_PrimitiveID output from MS when it's not used in FS Reviewed-by: Timur Kristóf Part-of: --- 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;