_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);
+
+ /* Currently, all ES2 implementations support highp in the
+ * fragment shader, so we always define this macro in ES2.
+ * If we ever get a driver that doesn't support highp, we'll
+ * need to add a flag to the gl_context and check that here.
+ */
+ if ($2 >= 130 || $2 == 100)
+ add_builtin_define (parser, "GL_FRAGMENT_PRECISION_HIGH", 1);
+
glcpp_printf(parser->output, "#version %" PRIiMAX, $2);
}
| HASH NEWLINE
if (extensions->ARB_fragment_coord_conventions)
add_builtin_define(parser, "GL_ARB_fragment_coord_conventions",
1);
+
+ if (extensions->ARB_explicit_attrib_location)
+ add_builtin_define(parser, "GL_ARB_explicit_attrib_location", 1);
}
language_version = 110;