glsl: add gl_LocalGroupSizeARB as a system value
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 8 Sep 2016 19:28:11 +0000 (21:28 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 6 Oct 2016 22:18:57 +0000 (00:18 +0200)
v2: - only add it if the ext is enabled (Ilia)

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/compiler/glsl/builtin_variables.cpp
src/compiler/shader_enums.h

index 36a8667e2af12f3eb01f1a1a24418424c34a1711..10a87502b41314a58c86d968b9ec7eb3eecf1f63 100644 (file)
@@ -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);
index c3a62e09dbeb7180af84b4586181d79dc88581d0..b6e048e133126e97cbecbefd40dc309a044ca696 100644 (file)
@@ -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,
    /*@}*/
 
    /**