aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/glcpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/glcpp')
-rw-r--r--src/glsl/glcpp/glcpp-parse.y6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
index 17bc649ca5a..0393ac7c416 100644
--- a/src/glsl/glcpp/glcpp-parse.y
+++ b/src/glsl/glcpp/glcpp-parse.y
@@ -375,9 +375,15 @@ control_line:
_glcpp_parser_skip_stack_pop (parser, & @1);
} NEWLINE
| HASH_VERSION integer_constant NEWLINE {
+ if (parser->version_resolved) {
+ glcpp_error(& @1, parser, "#version must appear on the first line");
+ }
_glcpp_parser_handle_version_declaration(parser, $2, NULL, true);
}
| HASH_VERSION integer_constant IDENTIFIER NEWLINE {
+ if (parser->version_resolved) {
+ glcpp_error(& @1, parser, "#version must appear on the first line");
+ }
_glcpp_parser_handle_version_declaration(parser, $2, $3, true);
}
| HASH NEWLINE {