From 6f6f9d1d0e3a2eb9fa78133cb5e2faf80cb6a814 Mon Sep 17 00:00:00 2001 From: Samuel Iglesias Gonsalvez Date: Wed, 2 Jul 2014 08:32:54 +0200 Subject: [PATCH] glsl: fix duplicated layout qualifier detection for GS This patch fixes the duplicated layout qualifier detection for geometry shader's layout qualifiers. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80778 Signed-off-by: Samuel Iglesias Gonsalvez --- src/glsl/ast_type.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/glsl/ast_type.cpp b/src/glsl/ast_type.cpp index 017f23d..c5a0b91 100644 --- a/src/glsl/ast_type.cpp +++ b/src/glsl/ast_type.cpp @@ -122,6 +122,10 @@ ast_type_qualifier::merge_qualifier(YYLTYPE *loc, ubo_binding_mask.flags.q.explicit_binding = 1; ubo_binding_mask.flags.q.explicit_offset = 1; + ast_type_qualifier stream_layout_mask; + stream_layout_mask.flags.i = 0; + stream_layout_mask.flags.q.stream = 1; + /* Uniform block layout qualifiers get to overwrite each * other (rightmost having priority), while all other * qualifiers currently don't allow duplicates. @@ -130,10 +134,10 @@ ast_type_qualifier::merge_qualifier(YYLTYPE *loc, * assigning different stream values. */ - if ((state->stage != MESA_SHADER_GEOMETRY) && - (this->flags.i & q.flags.i & ~(ubo_mat_mask.flags.i | + if ((this->flags.i & q.flags.i & ~(ubo_mat_mask.flags.i | ubo_layout_mask.flags.i | - ubo_binding_mask.flags.i)) != 0) { + ubo_binding_mask.flags.i | + stream_layout_mask.flags.i)) != 0) { _mesa_glsl_error(loc, state, "duplicate layout qualifiers used"); return false; -- 2.0.0