summaryrefslogtreecommitdiffstats
path: root/src/compiler/spirv/vtn_variables.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/spirv/vtn_variables.c')
-rw-r--r--src/compiler/spirv/vtn_variables.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
index 8dab86abd74..571a14cf4cf 100644
--- a/src/compiler/spirv/vtn_variables.c
+++ b/src/compiler/spirv/vtn_variables.c
@@ -1011,15 +1011,15 @@ vtn_get_builtin_location(struct vtn_builder *b,
case SpvBuiltInCullDistance:
*location = VARYING_SLOT_CULL_DIST0;
break;
- case SpvBuiltInVertexIndex:
- *location = SYSTEM_VALUE_VERTEX_ID;
- set_mode_system_value(b, mode);
- break;
case SpvBuiltInVertexId:
- /* Vulkan defines VertexID to be zero-based and reserves the new
- * builtin keyword VertexIndex to indicate the non-zero-based value.
+ case SpvBuiltInVertexIndex:
+ /* The Vulkan spec defines VertexIndex to be non-zero-based and doesn't
+ * allow VertexId. The ARB_gl_spirv spec defines VertexId to be the
+ * same as gl_VertexID, which is non-zero-based, and removes
+ * VertexIndex. Since they're both defined to be non-zero-based, we use
+ * SYSTEM_VALUE_VERTEX_ID for both.
*/
- *location = SYSTEM_VALUE_VERTEX_ID_ZERO_BASE;
+ *location = SYSTEM_VALUE_VERTEX_ID;
set_mode_system_value(b, mode);
break;
case SpvBuiltInInstanceIndex: