summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTapani Pälli <[email protected]>2015-10-05 12:50:10 +0300
committerTapani Pälli <[email protected]>2015-10-05 14:44:24 +0300
commita90feb581a1c0e63bf13aace5d11b6532e881313 (patch)
tree97ba514f2d2e2fd548ac52751e29a017ba04a522 /src
parent102f6c446b6585b00e1c1cd3c838f7b0899e49a9 (diff)
glsl: set glsl error if binding qualifier used on global scope
Fixes following Piglit test: global-scope-binding-qualifier.frag Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/glsl/glsl_parser.yy11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index f0abeb03215..c1bcccc34f4 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -2786,6 +2786,17 @@ layout_defaults:
if (!state->default_shader_storage_qualifier->merge_qualifier(& @1, state, $1)) {
YYERROR;
}
+
+ /* From the GLSL 4.50 spec, section 4.4.5:
+ *
+ * "It is a compile-time error to specify the binding identifier for
+ * the global scope or for block member declarations."
+ */
+ if (state->default_shader_storage_qualifier->flags.q.explicit_binding) {
+ _mesa_glsl_error(& @1, state,
+ "binding qualifier cannot be set for default layout");
+ }
+
$$ = NULL;
}