From f46f4e488641437556188a3182ce4ddabd6f42d0 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 14 Jan 2016 09:12:32 -0800 Subject: [PATCH] nir/spirv: Add initial support for Vertex/Instance index --- src/glsl/nir/spirv/spirv_to_nir.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/glsl/nir/spirv/spirv_to_nir.c b/src/glsl/nir/spirv/spirv_to_nir.c index 4462c9f..cdaf972 100644 --- a/src/glsl/nir/spirv/spirv_to_nir.c +++ b/src/glsl/nir/spirv/spirv_to_nir.c @@ -1074,6 +1074,10 @@ vtn_get_builtin_location(struct vtn_builder *b, case SpvBuiltInCullDistance: /* XXX figure this out */ unreachable("unhandled builtin"); + case SpvBuiltInVertexIndex: + *location = SYSTEM_VALUE_VERTEX_ID; + set_mode_system_value(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. @@ -1081,6 +1085,8 @@ vtn_get_builtin_location(struct vtn_builder *b, *location = SYSTEM_VALUE_VERTEX_ID_ZERO_BASE; set_mode_system_value(mode); break; + case SpvBuiltInInstanceIndex: + /* XXX */ case SpvBuiltInInstanceId: *location = SYSTEM_VALUE_INSTANCE_ID; set_mode_system_value(mode); -- 2.7.4