summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/glsl/glcpp/glcpp-parse.y10
-rw-r--r--src/compiler/glsl/glcpp/glcpp.h2
2 files changed, 6 insertions, 6 deletions
diff --git a/src/compiler/glsl/glcpp/glcpp-parse.y b/src/compiler/glsl/glcpp/glcpp-parse.y
index ca376d983ff..05a76c7b082 100644
--- a/src/compiler/glsl/glcpp/glcpp-parse.y
+++ b/src/compiler/glsl/glcpp/glcpp-parse.y
@@ -396,13 +396,13 @@ control_line_success:
_glcpp_parser_skip_stack_pop (parser, & @1);
} NEWLINE
| HASH_TOKEN VERSION_TOKEN integer_constant NEWLINE {
- if (parser->version_resolved) {
+ if (parser->version != 0) {
glcpp_error(& @1, parser, "#version must appear on the first line");
}
_glcpp_parser_handle_version_declaration(parser, $3, NULL, true);
}
| HASH_TOKEN VERSION_TOKEN integer_constant IDENTIFIER NEWLINE {
- if (parser->version_resolved) {
+ if (parser->version != 0) {
glcpp_error(& @1, parser, "#version must appear on the first line");
}
_glcpp_parser_handle_version_declaration(parser, $3, $4, true);
@@ -1346,7 +1346,7 @@ glcpp_parser_create(glcpp_extension_iterator extensions, void *state, gl_api api
parser->extensions = extensions;
parser->state = state;
parser->api = api;
- parser->version_resolved = false;
+ parser->version = 0;
parser->has_new_line_number = 0;
parser->new_line_number = 1;
@@ -2280,10 +2280,10 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio
const char *es_identifier,
bool explicitly_set)
{
- if (parser->version_resolved)
+ if (parser->version != 0)
return;
- parser->version_resolved = true;
+ parser->version = version;
add_builtin_define (parser, "__VERSION__", version);
diff --git a/src/compiler/glsl/glcpp/glcpp.h b/src/compiler/glsl/glcpp/glcpp.h
index 07eaf684bee..9f35b0556c3 100644
--- a/src/compiler/glsl/glcpp/glcpp.h
+++ b/src/compiler/glsl/glcpp/glcpp.h
@@ -206,7 +206,7 @@ struct glcpp_parser {
glcpp_extension_iterator extensions;
void *state;
gl_api api;
- bool version_resolved;
+ unsigned version;
bool has_new_line_number;
int new_line_number;
bool has_new_source_number;