From f6beb5efd6aba2b4b48f16a2bf674ada6b60444c Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Thu, 19 Mar 2026 11:29:47 -0400 Subject: [PATCH] vtn: Use a system value for primitive ID in fragment shaders Reviewed-by: Mary Guillemard Reviewed-by: Samuel Pitoiset Part-of: --- src/compiler/spirv/vtn_variables.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c index e1669bd2a2f..ac0cb527b6d 100644 --- a/src/compiler/spirv/vtn_variables.c +++ b/src/compiler/spirv/vtn_variables.c @@ -907,10 +907,7 @@ vtn_get_builtin_location(struct vtn_builder *b, set_mode_system_value(b, mode); break; case SpvBuiltInPrimitiveId: - if (b->shader->info.stage == MESA_SHADER_FRAGMENT) { - vtn_assert(*mode == nir_var_shader_in); - *location = VARYING_SLOT_PRIMITIVE_ID; - } else if (*mode == nir_var_shader_out) { + if (*mode == nir_var_shader_out) { *location = VARYING_SLOT_PRIMITIVE_ID; } else { *location = SYSTEM_VALUE_PRIMITIVE_ID;