summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2016-09-07 21:37:53 +0200
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>2016-10-07 00:18:57 +0200
commit008e785f742078e17221ebea727a5a5ea7ee95ff (patch)
tree539b46df3e70ec514dd62cd4752935bf99755af1 /src/compiler
parentdd2bda70022d6d80aee47cea718bab43e5586fe8 (diff)
downloadexternal_mesa3d-008e785f742078e17221ebea727a5a5ea7ee95ff.zip
external_mesa3d-008e785f742078e17221ebea727a5a5ea7ee95ff.tar.gz
external_mesa3d-008e785f742078e17221ebea727a5a5ea7ee95ff.tar.bz2
glsl: reject compute shaders with fixed and variable local size
The ARB_compute_variable_group_size specification explains that when a compute shader includes both a fixed and a variable local size, a compile-time error occurs. v2: - update formatting spec quotations (Ian) Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/glsl/ast_to_hir.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index 2ad97d9..8cdb917 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -8039,6 +8039,20 @@ ast_cs_input_layout::hir(exec_list *instructions,
}
}
+ /* The ARB_compute_variable_group_size spec says:
+ *
+ * If a compute shader including a *local_size_variable* qualifier also
+ * declares a fixed local group size using the *local_size_x*,
+ * *local_size_y*, or *local_size_z* qualifiers, a compile-time error
+ * results
+ */
+ if (state->cs_input_local_size_variable_specified) {
+ _mesa_glsl_error(&loc, state,
+ "compute shader can't include both a variable and a "
+ "fixed local group size");
+ return NULL;
+ }
+
state->cs_input_local_size_specified = true;
for (int i = 0; i < 3; i++)
state->cs_input_local_size[i] = qual_local_size[i];