[cogl] gles2: Use GL_ES instead of __VERSION__ for setting precision



commit 37f5205739cfb0745ea74dedaec117081ba0088b
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>

 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 860854b..99c1dbc 100644
--- a/cogl/cogl-glsl-shader-boilerplate.h
+++ b/cogl/cogl-glsl-shader-boilerplate.h
@@ -52,7 +52,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]