From 98abed2441440b6d86f245f6cf59c98e7ddb0f59 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 28 Aug 2015 16:08:29 -0700 Subject: [PATCH] spirv: Use VERTEX_ID_ZERO_BASE for vertex id --- src/glsl/nir/spirv_to_nir.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/glsl/nir/spirv_to_nir.c b/src/glsl/nir/spirv_to_nir.c index b09196ccd98..3cbaf3c8616 100644 --- a/src/glsl/nir/spirv_to_nir.c +++ b/src/glsl/nir/spirv_to_nir.c @@ -644,7 +644,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: -- 2.30.2