summaryrefslogtreecommitdiffstats
path: root/src/glsl/ast_type.cpp
diff options
context:
space:
mode:
authorChris Forbes <chrisf@ijw.co.nz>2014-06-27 21:09:43 +1200
committerChris Forbes <chrisf@ijw.co.nz>2014-07-05 09:42:17 +1200
commit4087d9ec0b601465261da5d3bc06412d1ac3e445 (patch)
tree5b12453adf12f475d3983a3c779c6d593d0dd439 /src/glsl/ast_type.cpp
parent9a37eb8adb6558a4abf47774b583cb582a0ae116 (diff)
downloadexternal_mesa3d-4087d9ec0b601465261da5d3bc06412d1ac3e445.zip
external_mesa3d-4087d9ec0b601465261da5d3bc06412d1ac3e445.tar.gz
external_mesa3d-4087d9ec0b601465261da5d3bc06412d1ac3e445.tar.bz2
glsl: Fix merging of layout(invocations) with other qualifiers
If another layout qualifier appeared to the left of `invocations` in the GS input layout declaration, the invocation count would be dropped on the floor. Fixes the piglit tests: spec/ARB_transform_feedback3/arb_transform_feedback3-ext_interleaved_two_bufs_gs_max spec/ARB_gpu_shader5/arb_gpu_shader5-invocation-id spec/ARB_gpu_shader5/compiler/correct-multiple-layout-qualifier-invocations.geom spec/ARB_gpu_shader5/execution/invocations-conflicting Signed-off-by: Chris Forbes <chrisf@ijw.co.nz> Tested-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Diffstat (limited to 'src/glsl/ast_type.cpp')
-rw-r--r--src/glsl/ast_type.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/glsl/ast_type.cpp b/src/glsl/ast_type.cpp
index de4c1a4..b596cd5 100644
--- a/src/glsl/ast_type.cpp
+++ b/src/glsl/ast_type.cpp
@@ -168,6 +168,16 @@ ast_type_qualifier::merge_qualifier(YYLTYPE *loc,
this->max_vertices = q.max_vertices;
}
+ if (q.flags.q.invocations) {
+ if (this->flags.q.invocations && this->invocations != q.invocations) {
+ _mesa_glsl_error(loc, state,
+ "geometry shader set conflicting invocations "
+ "(%d and %d)", this->invocations, q.invocations);
+ return false;
+ }
+ this->invocations = q.invocations;
+ }
+
if (state->stage == MESA_SHADER_GEOMETRY &&
state->has_explicit_attrib_stream()) {
if (q.flags.q.stream && q.stream >= state->ctx->Const.MaxVertexStreams) {