glsl/cs: Add gl_NumWorkGroups as a system value
authorJordan Justen <jordan.l.justen@intel.com>
Thu, 20 Aug 2015 22:56:53 +0000 (15:56 -0700)
committerJordan Justen <jordan.l.justen@intel.com>
Tue, 29 Sep 2015 15:23:47 +0000 (08:23 -0700)
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
src/glsl/builtin_variables.cpp
src/glsl/shader_enums.h

index 0722051c08e335eaeb8690c452fde79383b5a367..a6ad10505525e7c7563df2681296f6f520c45344 100644 (file)
@@ -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. */
 }
 
 
index 39780076e74536ef2455b35dda639619069788c5..99acc640496010e9c6dd1c6b2a4dbb0a1c20aace 100644 (file)
@@ -410,6 +410,7 @@ typedef enum
    /*@{*/
    SYSTEM_VALUE_LOCAL_INVOCATION_ID,
    SYSTEM_VALUE_WORK_GROUP_ID,
+   SYSTEM_VALUE_NUM_WORK_GROUPS,
    /*@}*/
 
    /**