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.y20
1 files changed, 13 insertions, 7 deletions
diff --git a/mesalib/src/glsl/glcpp/glcpp-parse.y b/mesalib/src/glsl/glcpp/glcpp-parse.y
index 81ba04bcc..ff5bdfe5d 100644
--- a/mesalib/src/glsl/glcpp/glcpp-parse.y
+++ b/mesalib/src/glsl/glcpp/glcpp-parse.y
@@ -1184,14 +1184,14 @@ glcpp_parser_create (const struct gl_extensions *extensions, int api)
parser->is_gles = false;
/* Add pre-defined macros. */
- if (extensions != NULL) {
- if (extensions->OES_EGL_image_external)
- add_builtin_define(parser, "GL_OES_EGL_image_external", 1);
- }
-
if (api == API_OPENGLES2) {
- parser->is_gles = true;
- add_builtin_define(parser, "GL_ES", 1);
+ parser->is_gles = true;
+ add_builtin_define(parser, "GL_ES", 1);
+
+ if (extensions != NULL) {
+ if (extensions->OES_EGL_image_external)
+ add_builtin_define(parser, "GL_OES_EGL_image_external", 1);
+ }
} else {
add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
add_builtin_define(parser, "GL_ARB_texture_rectangle", 1);
@@ -1242,6 +1242,9 @@ glcpp_parser_create (const struct gl_extensions *extensions, int api)
if (extensions->AMD_vertex_shader_layer)
add_builtin_define(parser, "GL_AMD_vertex_shader_layer", 1);
+
+ if (extensions->ARB_shading_language_420pack)
+ add_builtin_define(parser, "GL_ARB_shading_language_420pack", 1);
}
}
@@ -2064,6 +2067,9 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio
add_builtin_define (parser, "GL_ES", 1);
}
+ if (version >= 150)
+ add_builtin_define(parser, "GL_core_profile", 1);
+
/* Currently, all ES2/ES3 implementations support highp in the
* fragment shader, so we always define this macro in ES2/ES3.
* If we ever get a driver that doesn't support highp, we'll