summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Iglesias Gonsalvez <[email protected]>2015-09-02 15:58:01 +0200
committerSamuel Iglesias Gonsalvez <[email protected]>2015-09-25 08:39:21 +0200
commit130031168de44e38e84000f279951ef70a99cb66 (patch)
tree2afdfc0d628404e5b2199b17ff9c997594592ce1
parent5bb5eeea008a01f5bc44570915ea4b7ac432cef9 (diff)
glsl: layout qualifier can appear more than once since OpenGL 4.20
Also if GL_ARB_shading_language_420pack extension is enabled. Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
-rw-r--r--src/glsl/glsl_parser.yy10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index 59e4527b238..4dd5384dac8 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -2595,9 +2595,15 @@ interface_block:
{
$$ = $1;
}
- | layout_qualifier basic_interface_block
+ | layout_qualifier interface_block
{
- ast_interface_block *block = $2;
+ ast_interface_block *block = (ast_interface_block *) $2;
+
+ if (!state->has_420pack() && block->layout.has_layout()) {
+ _mesa_glsl_error(&@1, state, "duplicate layout(...) qualifiers");
+ YYERROR;
+ }
+
if (!block->layout.merge_qualifier(& @1, state, $1)) {
YYERROR;
}