summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/glsl/builtin_variables.cpp2
-rw-r--r--src/mesa/main/mtypes.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp
index 2fa509f2765..4176ae6e640 100644
--- a/src/glsl/builtin_variables.cpp
+++ b/src/glsl/builtin_variables.cpp
@@ -854,6 +854,8 @@ builtin_variable_generator::generate_gs_special_vars()
add_output(VARYING_SLOT_LAYER, int_t, "gl_Layer");
if (state->ARB_viewport_array_enable)
add_output(VARYING_SLOT_VIEWPORT, int_t, "gl_ViewportIndex");
+ if (state->ARB_gpu_shader5_enable)
+ add_system_value(SYSTEM_VALUE_INVOCATION_ID, int_t, "gl_InvocationID");
/* Although gl_PrimitiveID appears in tessellation control and tessellation
* evaluation shaders, it has a different function there than it has in
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index bc029698da1..4c5f02811ef 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2013,6 +2013,7 @@ typedef enum
SYSTEM_VALUE_SAMPLE_ID, /**< Fragment shader only */
SYSTEM_VALUE_SAMPLE_POS, /**< Fragment shader only */
SYSTEM_VALUE_SAMPLE_MASK_IN, /**< Fragment shader only */
+ SYSTEM_VALUE_INVOCATION_ID, /**< Geometry shader only */
SYSTEM_VALUE_MAX /**< Number of values */
} gl_system_value;