Merge branch 'nir-spirv' into vulkan
[mesa.git] / src / glsl / nir / spirv_to_nir.c
index 8c2b31cf3ece80887cddbf52a4eb1005045e2d58..dde0a986ac2e4434dd618d158ba5588617b0689f 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: