Mesa (7.9): glsl: Unconditionally define GL_FRAGMENT_PRECISION_HIGH in ES2 shaders.

Ian Romanick idr at kemper.freedesktop.org
Wed Dec 15 23:15:08 UTC 2010


Module: Mesa
Branch: 7.9
Commit: 8c8c1b2c990066ef0c9f5d1d2c2c2e856912403a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8c8c1b2c990066ef0c9f5d1d2c2c2e856912403a

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Wed Nov 17 12:50:35 2010 -0800

glsl: Unconditionally define GL_FRAGMENT_PRECISION_HIGH in ES2 shaders.

This is really supposed to be defined only if the driver supports highp
in the fragment shader - but all of our current ES2 implementations do.
So, just define it.  In the future, we'll need to add a flag to
gl_context and only define the macro if the flag is set.

"Fixes" freedesktop.org bug #31673.
(cherry picked from commit d719bf8fb4b8f511fbb00dd990fb644efc510c0e)

---

 src/glsl/glcpp/glcpp-parse.y |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
index c1c985a..3ea66d2 100644
--- a/src/glsl/glcpp/glcpp-parse.y
+++ b/src/glsl/glcpp/glcpp-parse.y
@@ -320,7 +320,12 @@ control_line:
 		if ($2 == 100)
 			add_builtin_define (parser, "GL_ES", 1);
 
-		if ($2 >= 130)
+		/* 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);




More information about the mesa-commit mailing list