[Mesa-dev] [PATCH 11/26] glsl/shader_enums: Add an enum for Vulkan InstanceIndex

Jason Ekstrand jason at jlekstrand.net
Fri Mar 25 23:12:25 UTC 2016


In Vulkan, you have InstanceIndex which begins at the base instance value
rather than the zero-based InstanceID of GL.
---
 src/compiler/shader_enums.c | 1 +
 src/compiler/shader_enums.h | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/src/compiler/shader_enums.c b/src/compiler/shader_enums.c
index 942d152..003ad3b 100644
--- a/src/compiler/shader_enums.c
+++ b/src/compiler/shader_enums.c
@@ -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),
diff --git a/src/compiler/shader_enums.h b/src/compiler/shader_enums.h
index d4326c5..2ae129b 100644
--- a/src/compiler/shader_enums.h
+++ b/src/compiler/shader_enums.h
@@ -379,6 +379,13 @@ typedef enum
    SYSTEM_VALUE_INSTANCE_ID,
 
    /**
+    * Vulkan InstanceIndex.
+    *
+    * InstanceIndex = gl_InstanceID + gl_BaseInstance
+    */
+   SYSTEM_VALUE_INSTANCE_INDEX,
+
+   /**
     * DirectX-style vertex ID.
     *
     * Unlike \c SYSTEM_VALUE_VERTEX_ID, this system value does \b not include
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list