glsl/shader_enums: Add an enum for Vulkan InstanceIndex
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 25 Mar 2016 17:50:11 +0000 (10:50 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 11 Apr 2016 20:52:51 +0000 (13:52 -0700)
In Vulkan, you have InstanceIndex which begins at the base instance value
rather than the zero-based InstanceID of GL.

Reviewed-by: Rob Clark <robdclark@gmail.com>
src/compiler/shader_enums.c
src/compiler/shader_enums.h

index 942d152b1296ad019f43517b1d6b32a57f03fb31..003ad3b8ab662b5b492c48086ba9fef1d2560bf0 100644 (file)
@@ -201,6 +201,7 @@ gl_system_value_name(gl_system_value sysval)
    static const char *names[] = {
      ENUM(SYSTEM_VALUE_VERTEX_ID),
      ENUM(SYSTEM_VALUE_INSTANCE_ID),
+     ENUM(SYSTEM_VALUE_INSTANCE_INDEX),
      ENUM(SYSTEM_VALUE_VERTEX_ID_ZERO_BASE),
      ENUM(SYSTEM_VALUE_BASE_VERTEX),
      ENUM(SYSTEM_VALUE_INVOCATION_ID),
index 07ae9ee2de7b10172c996acd08e26cf1c62f14f2..0c43d5a92cb9a6bbaff69db3162e4db7cd84a06a 100644 (file)
@@ -378,6 +378,13 @@ typedef enum
     */
    SYSTEM_VALUE_INSTANCE_ID,
 
+   /**
+    * Vulkan InstanceIndex.
+    *
+    * InstanceIndex = gl_InstanceID + gl_BaseInstance
+    */
+   SYSTEM_VALUE_INSTANCE_INDEX,
+
    /**
     * DirectX-style vertex ID.
     *