summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorChris Forbes <[email protected]>2014-06-27 21:09:43 +1200
committerChris Forbes <[email protected]>2014-07-05 09:42:17 +1200
commit4087d9ec0b601465261da5d3bc06412d1ac3e445 (patch)
tree5b12453adf12f475d3983a3c779c6d593d0dd439 /src/glsl
parent9a37eb8adb6558a4abf47774b583cb582a0ae116 (diff)
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 <[email protected]> Tested-by: Ilia Mirkin <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/glsl')
-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 de4c1a410f6..b596cd59ecf 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) {