summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/ast_type.cpp
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2016-05-23 14:29:09 +1000
committerDave Airlie <airlied@redhat.com>2016-05-23 16:19:57 +1000
commitaaa69c79cd584db4d9c6ea7794e93d29f3d54572 (patch)
tree3987e6e40c0b2351b7fe2defcd8305cb723051e6 /src/compiler/glsl/ast_type.cpp
parent6f2dc0d04498a1d03f02a4b72480e8b409981432 (diff)
downloadexternal_mesa3d-aaa69c79cd584db4d9c6ea7794e93d29f3d54572.zip
external_mesa3d-aaa69c79cd584db4d9c6ea7794e93d29f3d54572.tar.gz
external_mesa3d-aaa69c79cd584db4d9c6ea7794e93d29f3d54572.tar.bz2
glsl: allow layout qualifier overrides with ARB_shading_language_420pack
GLSL 4.20 allows overriding the layout qualifiers. This helps fix: GL45-CTS.shading_language_420pack.qualifier_override_layout Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/compiler/glsl/ast_type.cpp')
-rw-r--r--src/compiler/glsl/ast_type.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/compiler/glsl/ast_type.cpp b/src/compiler/glsl/ast_type.cpp
index c44dcc6..54e9dad 100644
--- a/src/compiler/glsl/ast_type.cpp
+++ b/src/compiler/glsl/ast_type.cpp
@@ -711,7 +711,12 @@ ast_layout_expression::process_qualifier_constant(struct _mesa_glsl_parse_state
return false;
}
- if (!first_pass && *value != const_int->value.u[0]) {
+ /* From section 4.4 "Layout Qualifiers" of the GLSL 4.50 spec:
+ * "When the same layout-qualifier-name occurs multiple times,
+ * in a single declaration, the last occurrence overrides the
+ * former occurrence(s)."
+ */
+ if (!state->has_420pack() && !first_pass && *value != const_int->value.u[0]) {
YYLTYPE loc = const_expression->get_location();
_mesa_glsl_error(&loc, state, "%s layout qualifier does not "
"match previous declaration (%d vs %d)",