From 4087d9ec0b601465261da5d3bc06412d1ac3e445 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Fri, 27 Jun 2014 21:09:43 +1200 Subject: [PATCH] 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 Tested-by: Ilia Mirkin Reviewed-by: Jordan Justen --- src/glsl/ast_type.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) { -- 2.30.2