diff options
author | Nicolai Hähnle <[email protected]> | 2017-03-30 12:10:00 +0200 |
---|---|---|
committer | Nicolai Hähnle <[email protected]> | 2017-04-05 15:25:56 +0200 |
commit | b5711d5e1a7c281a5f4fb3101333e3cc64bd418b (patch) | |
tree | 8cf191346507337161b76d274398b5dc96f77c99 /src/compiler/shader_enums.h | |
parent | 961b8e9afe79251babb18f8885ee4646f2296a9a (diff) |
glsl: add gl_SubGroup*ARB builtins
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/compiler/shader_enums.h')
-rw-r--r-- | src/compiler/shader_enums.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/src/compiler/shader_enums.h b/src/compiler/shader_enums.h index 98565c80cb8..930d99748e7 100644 --- a/src/compiler/shader_enums.h +++ b/src/compiler/shader_enums.h @@ -318,6 +318,65 @@ const char *gl_varying_slot_name(gl_varying_slot slot); typedef enum { /** + * \name System values applicable to all shaders + */ + /*@{*/ + + /** + * Builtin variables added by GL_ARB_shader_ballot. + */ + /*@{*/ + + /** + * From the GL_ARB_shader-ballot spec: + * + * "A sub-group is a collection of invocations which execute in lockstep. + * The variable <gl_SubGroupSizeARB> is the maximum number of + * invocations in a sub-group. The maximum <gl_SubGroupSizeARB> + * supported in this extension is 64." + * + * The spec defines this as a uniform. However, it's highly unlikely that + * implementations actually treat it as a uniform (which is loaded from a + * constant buffer). Most likely, this is an implementation-wide constant, + * or perhaps something that depends on the shader stage. + */ + SYSTEM_VALUE_SUBGROUP_SIZE, + + /** + * From the GL_ARB_shader_ballot spec: + * + * "The variable <gl_SubGroupInvocationARB> holds the index of the + * invocation within sub-group. This variable is in the range 0 to + * <gl_SubGroupSizeARB>-1, where <gl_SubGroupSizeARB> is the total + * number of invocations in a sub-group." + */ + SYSTEM_VALUE_SUBGROUP_INVOCATION, + + /** + * From the GL_ARB_shader_ballot spec: + * + * "The <gl_SubGroup??MaskARB> variables provide a bitmask for all + * invocations, with one bit per invocation starting with the least + * significant bit, according to the following table, + * + * variable equation for bit values + * -------------------- ------------------------------------ + * gl_SubGroupEqMaskARB bit index == gl_SubGroupInvocationARB + * gl_SubGroupGeMaskARB bit index >= gl_SubGroupInvocationARB + * gl_SubGroupGtMaskARB bit index > gl_SubGroupInvocationARB + * gl_SubGroupLeMaskARB bit index <= gl_SubGroupInvocationARB + * gl_SubGroupLtMaskARB bit index < gl_SubGroupInvocationARB + */ + SYSTEM_VALUE_SUBGROUP_EQ_MASK, + SYSTEM_VALUE_SUBGROUP_GE_MASK, + SYSTEM_VALUE_SUBGROUP_GT_MASK, + SYSTEM_VALUE_SUBGROUP_LE_MASK, + SYSTEM_VALUE_SUBGROUP_LT_MASK, + /*@}*/ + + /*@}*/ + + /** * \name Vertex shader system values */ /*@{*/ |