[cogl/cogl-1.16] gles2: Use GL_ES instead of __VERSION__ for setting precision
- From: Neil Roberts <nroberts src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl/cogl-1.16] gles2: Use GL_ES instead of __VERSION__ for setting precision
- Date: Sun, 25 Aug 2013 01:34:47 +0000 (UTC)
commit cf44ad2493f075a599e380211c87bbb6d44c79b8
Author: Neil Roberts <neil linux intel com>
Date: Fri Aug 23 12:20:27 2013 +0100
gles2: Use GL_ES instead of __VERSION__ for setting precision
Mesa has started getting picky about specifying the precision for
floating types in the fragment shader. We already have a default
precision specifier in all the fragment shaders but apparently this
wasn't working because it is only used when the __VERSION__ define is
100 and Mesa is reporting 110. Regardless of whether Mesa is doing the
right thing or not I think it makes sense to use GL_ES instead of
__VERSION__ because we will also need the precision specifier if we
start requesting GLSL 3.0. The GLES specification explictly states
that GL_ES will only be defined for GLES and this is similar to what
the internal meta shaders do in Mesa.
http://cgit.freedesktop.org/mesa/mesa/commit/?id=cabd45773b58d6aa482
Reviewed-by: Robert Bragg <robert linux intel com>
(cherry picked from commit 37f5205739cfb0745ea74dedaec117081ba0088b)
cogl/cogl-glsl-shader-boilerplate.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/cogl/cogl-glsl-shader-boilerplate.h b/cogl/cogl-glsl-shader-boilerplate.h
index 78762d4..9df0279 100644
--- a/cogl/cogl-glsl-shader-boilerplate.h
+++ b/cogl/cogl-glsl-shader-boilerplate.h
@@ -53,7 +53,7 @@
"attribute vec3 cogl_normal_in;\n"
#define _COGL_FRAGMENT_SHADER_BOILERPLATE \
- "#if __VERSION__ == 100\n" \
+ "#ifdef GL_ES\n" \
"precision highp float;\n" \
"#endif\n" \
_COGL_COMMON_SHADER_BOILERPLATE \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]