diff options
Diffstat (limited to 'src/glsl/glcpp/glcpp-parse.y')
-rw-r--r-- | src/glsl/glcpp/glcpp-parse.y | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y index 4463a97777..43513ebb66 100644 --- a/src/glsl/glcpp/glcpp-parse.y +++ b/src/glsl/glcpp/glcpp-parse.y @@ -310,15 +310,16 @@ control_line: _glcpp_parser_skip_stack_pop (parser, & @1); } | HASH_VERSION integer_constant NEWLINE { - if ($2 == 100) - add_builtin_define (parser, "GL_ES", 1); - macro_t *macro = hash_table_find (parser->defines, "__VERSION__"); if (macro) { hash_table_remove (parser->defines, "__VERSION__"); talloc_free (macro); } add_builtin_define (parser, "__VERSION__", $2); + + if ($2 == 100) + add_builtin_define (parser, "GL_ES", 1); + glcpp_printf(parser->output, "#version %" PRIiMAX, $2); } | HASH NEWLINE |