Merge branch 'nir-spirv' into vulkan
[mesa.git] / src / glsl / nir / spirv_to_nir.c
index 30104f0d09a90bc94330107ded6ca9c4aaec0e91..ef2a273da7ef5a8f46e9102538e69c9d6b8631a2 100644 (file)
@@ -649,7 +649,10 @@ vtn_get_builtin_location(SpvBuiltIn builtin, int *location,
       /* XXX figure this out */
       unreachable("unhandled builtin");
    case SpvBuiltInVertexId:
-      *location = SYSTEM_VALUE_VERTEX_ID;
+      /* Vulkan defines VertexID to be zero-based and reserves the new
+       * builtin keyword VertexIndex to indicate the non-zero-based value.
+       */
+      *location = SYSTEM_VALUE_VERTEX_ID_ZERO_BASE;
       *mode = nir_var_system_value;
       break;
    case SpvBuiltInInstanceId: