From: Jason Ekstrand Date: Thu, 14 Jan 2016 17:12:32 +0000 (-0800) Subject: nir/spirv: Add initial support for Vertex/Instance index X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f46f4e488641437556188a3182ce4ddabd6f42d0;p=mesa.git nir/spirv: Add initial support for Vertex/Instance index --- diff --git a/src/glsl/nir/spirv/spirv_to_nir.c b/src/glsl/nir/spirv/spirv_to_nir.c index 4462c9f5a80..cdaf97294e0 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);