[Mesa-dev] [PATCH 7/9] glsl/cs: Add gl_NumWorkGroups as a system value

Jordan Justen jordan.l.justen at intel.com
Fri Sep 25 15:39:13 PDT 2015


Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
 src/glsl/builtin_variables.cpp | 2 +-
 src/glsl/shader_enums.h        | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp
index 0722051..a6ad105 100644
--- a/src/glsl/builtin_variables.cpp
+++ b/src/glsl/builtin_variables.cpp
@@ -1058,9 +1058,9 @@ builtin_variable_generator::generate_cs_special_vars()
    add_system_value(SYSTEM_VALUE_LOCAL_INVOCATION_ID, uvec3_t,
                     "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");
    add_variable("gl_GlobalInvocationID", uvec3_t, ir_var_auto, 0);
    add_variable("gl_LocalInvocationIndex", uint_t, ir_var_auto, 0);
-   /* TODO: finish this. */
 }
 
 
diff --git a/src/glsl/shader_enums.h b/src/glsl/shader_enums.h
index 3978007..99acc64 100644
--- a/src/glsl/shader_enums.h
+++ b/src/glsl/shader_enums.h
@@ -410,6 +410,7 @@ typedef enum
    /*@{*/
    SYSTEM_VALUE_LOCAL_INVOCATION_ID,
    SYSTEM_VALUE_WORK_GROUP_ID,
+   SYSTEM_VALUE_NUM_WORK_GROUPS,
    /*@}*/
 
    /**
-- 
2.5.1



More information about the mesa-dev mailing list