[Mesa-dev] [PATCH 3/3] glcpp: Automatically #define GL_core_profile 1 on GLSL 1.50+.

Kenneth Graunke kenneth at whitecape.org
Fri Jun 7 22:42:58 PDT 2013


Page 17 of the GLSL 1.50.11 specification states:
"There is a built-in macro definition for each profile the
 implementation supports.  All implementations provide the following
 macro:

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/glsl/glcpp/glcpp-parse.y | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
index 81ba04b..fe36c12 100644
--- a/src/glsl/glcpp/glcpp-parse.y
+++ b/src/glsl/glcpp/glcpp-parse.y
@@ -2064,6 +2064,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
-- 
1.8.3



More information about the mesa-dev mailing list