summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2016-09-08 21:28:11 +0200
committerSamuel Pitoiset <[email protected]>2016-10-07 00:18:57 +0200
commit48de9aaa72ee0f5eb9232784f54c7feb97e3fb85 (patch)
treef8fe63b163434e194173242c3ccdf048a387acbd
parentdee627a16ee46ffd9d049217cbb394d4ad5c6043 (diff)
glsl: add gl_LocalGroupSizeARB as a system value
v2: - only add it if the ext is enabled (Ilia) Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
-rw-r--r--src/compiler/glsl/builtin_variables.cpp6
-rw-r--r--src/compiler/shader_enums.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/compiler/glsl/builtin_variables.cpp b/src/compiler/glsl/builtin_variables.cpp
index 36a8667e2af..10a87502b41 100644
--- a/src/compiler/glsl/builtin_variables.cpp
+++ b/src/compiler/glsl/builtin_variables.cpp
@@ -1249,6 +1249,12 @@ builtin_variable_generator::generate_cs_special_vars()
"gl_LocalInvocationID");
add_system_value(SYSTEM_VALUE_WORK_GROUP_ID, uvec3_t, "gl_WorkGroupID");
add_system_value(SYSTEM_VALUE_NUM_WORK_GROUPS, uvec3_t, "gl_NumWorkGroups");
+
+ if (state->ARB_compute_variable_group_size_enable) {
+ add_system_value(SYSTEM_VALUE_LOCAL_GROUP_SIZE,
+ uvec3_t, "gl_LocalGroupSizeARB");
+ }
+
if (state->ctx->Const.LowerCsDerivedVariables) {
add_variable("gl_GlobalInvocationID", uvec3_t, ir_var_auto, 0);
add_variable("gl_LocalInvocationIndex", uint_t, ir_var_auto, 0);
diff --git a/src/compiler/shader_enums.h b/src/compiler/shader_enums.h
index c3a62e09dbe..b6e048e1331 100644
--- a/src/compiler/shader_enums.h
+++ b/src/compiler/shader_enums.h
@@ -472,6 +472,7 @@ typedef enum
SYSTEM_VALUE_GLOBAL_INVOCATION_ID,
SYSTEM_VALUE_WORK_GROUP_ID,
SYSTEM_VALUE_NUM_WORK_GROUPS,
+ SYSTEM_VALUE_LOCAL_GROUP_SIZE,
/*@}*/
/**