vtn: Use a system value for primitive ID in fragment shaders

Reviewed-by: Mary Guillemard <mary@mary.zone>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40512>
This commit is contained in:
Faith Ekstrand 2026-03-19 11:29:47 -04:00 committed by Marge Bot
parent c7472de858
commit f6beb5efd6

View file

@ -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;