aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/shader_enums.h
diff options
context:
space:
mode:
authorCaio Marcelo de Oliveira Filho <[email protected]>2019-03-26 00:04:57 -0700
committerCaio Marcelo de Oliveira Filho <[email protected]>2019-04-08 19:29:32 -0700
commit3c5ddaeacd2c52bc11f9cda451fe640cff629bdd (patch)
tree47586c1451345101c711cae5d72e270b025727a6 /src/compiler/shader_enums.h
parentca60f0b7baeb95caf5d6e0ab4d83c6bb1d3e0eaa (diff)
glsl: Parse and propagate derivative_group to shader_info
NV_compute_shader_derivatives allow selecting between two possible arrangements (quads and linear) when calculating derivatives and certain subgroup operations in case of Vulkan. So parse and propagate those up to shader_info.h. v2: Do not fail when ARB_compute_variable_group_size is being used, since we are still clarifying what is the right thing to do here. Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/compiler/shader_enums.h')
-rw-r--r--src/compiler/shader_enums.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/compiler/shader_enums.h b/src/compiler/shader_enums.h
index 883b2825146..f9a4006f072 100644
--- a/src/compiler/shader_enums.h
+++ b/src/compiler/shader_enums.h
@@ -772,6 +772,47 @@ enum compare_func
COMPARE_FUNC_ALWAYS,
};
+/**
+ * Arrangements for grouping invocations from NV_compute_shader_derivatives.
+ *
+ * The extension provides new layout qualifiers that support two different
+ * arrangements of compute shader invocations for the purpose of derivative
+ * computation. When specifying
+ *
+ * layout(derivative_group_quadsNV) in;
+ *
+ * compute shader invocations are grouped into 2x2x1 arrays whose four local
+ * invocation ID values follow the pattern:
+ *
+ * +-----------------+------------------+
+ * | (2x+0, 2y+0, z) | (2x+1, 2y+0, z) |
+ * +-----------------+------------------+
+ * | (2x+0, 2y+1, z) | (2x+1, 2y+1, z) |
+ * +-----------------+------------------+
+ *
+ * where Y increases from bottom to top. When specifying
+ *
+ * layout(derivative_group_linearNV) in;
+ *
+ * compute shader invocations are grouped into 2x2x1 arrays whose four local
+ * invocation index values follow the pattern:
+ *
+ * +------+------+
+ * | 4n+0 | 4n+1 |
+ * +------+------+
+ * | 4n+2 | 4n+3 |
+ * +------+------+
+ *
+ * If neither layout qualifier is specified, derivatives in compute shaders
+ * return zero, which is consistent with the handling of built-in texture
+ * functions like texture() in GLSL 4.50 compute shaders.
+ */
+enum gl_derivative_group {
+ DERIVATIVE_GROUP_NONE = 0,
+ DERIVATIVE_GROUP_QUADS,
+ DERIVATIVE_GROUP_LINEAR,
+};
+
#ifdef __cplusplus
} /* extern "C" */
#endif