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>
This commit is contained in:
Chris Forbes
2014-06-27 21:09:43 +12:00
parent 9a37eb8adb
commit 4087d9ec0b
+10
View File
@@ -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) {