nir/spirv: Add initial support for Vertex/Instance index
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 14 Jan 2016 17:12:32 +0000 (09:12 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 14 Jan 2016 17:12:32 +0000 (09:12 -0800)
src/glsl/nir/spirv/spirv_to_nir.c

index 4462c9f5a80db5294f71d028b663a7efd8eb977f..cdaf97294e0e846d688701d7cb018efbc8fa4b4d 100644 (file)
@@ -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);