aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/glcpp/glcpp-parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/glsl/glcpp/glcpp-parse.y')
-rw-r--r--mesalib/src/glsl/glcpp/glcpp-parse.y28
1 files changed, 25 insertions, 3 deletions
diff --git a/mesalib/src/glsl/glcpp/glcpp-parse.y b/mesalib/src/glsl/glcpp/glcpp-parse.y
index eeafa4d39..f28d8531e 100644
--- a/mesalib/src/glsl/glcpp/glcpp-parse.y
+++ b/mesalib/src/glsl/glcpp/glcpp-parse.y
@@ -1770,11 +1770,27 @@ static void
_check_for_reserved_macro_name (glcpp_parser_t *parser, YYLTYPE *loc,
const char *identifier)
{
- /* According to the GLSL specification, macro names starting with "__"
- * or "GL_" are reserved for future use. So, don't allow them.
+ /* Section 3.3 (Preprocessor) of the GLSL 1.30 spec (and later) and
+ * the GLSL ES spec (all versions) say:
+ *
+ * "All macro names containing two consecutive underscores ( __ )
+ * are reserved for future use as predefined macro names. All
+ * macro names prefixed with "GL_" ("GL" followed by a single
+ * underscore) are also reserved."
+ *
+ * The intention is that names containing __ are reserved for internal
+ * use by the implementation, and names prefixed with GL_ are reserved
+ * for use by Khronos. Since every extension adds a name prefixed
+ * with GL_ (i.e., the name of the extension), that should be an
+ * error. Names simply containing __ are dangerous to use, but should
+ * be allowed.
+ *
+ * A future version of the GLSL specification will clarify this.
*/
if (strstr(identifier, "__")) {
- glcpp_error (loc, parser, "Macro names containing \"__\" are reserved.\n");
+ glcpp_warning(loc, parser,
+ "Macro names containing \"__\" are reserved "
+ "for use by the implementation.\n");
}
if (strncmp(identifier, "GL_", 3) == 0) {
glcpp_error (loc, parser, "Macro names starting with \"GL_\" are reserved.\n");
@@ -2118,6 +2134,9 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio
if (extensions->ARB_texture_gather)
add_builtin_define(parser, "GL_ARB_texture_gather", 1);
+ if (extensions->ARB_separate_shader_objects)
+ add_builtin_define(parser, "GL_ARB_separate_shader_objects", 1);
+
if (extensions->ARB_shader_atomic_counters)
add_builtin_define(parser, "GL_ARB_shader_atomic_counters", 1);
@@ -2126,6 +2145,9 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio
if (extensions->ARB_compute_shader)
add_builtin_define(parser, "GL_ARB_compute_shader", 1);
+
+ if (extensions->ARB_shader_image_load_store)
+ add_builtin_define(parser, "GL_ARB_shader_image_load_store", 1);
}
}