opengl: protect precision settings, since current OS X OpenGL implementations don...
authorFelix Paul Kühne <fkuehne@videolan.org>
Fri, 8 Feb 2013 21:45:16 +0000 (22:45 +0100)
committerFelix Paul Kühne <fkuehne@videolan.org>
Fri, 8 Feb 2013 21:45:16 +0000 (22:45 +0100)
modules/video_output/opengl.c

index 9079e5b..5533fea 100644 (file)
@@ -194,7 +194,9 @@ static void BuildVertexShader(vout_display_opengl_t *vgl,
     /* Basic vertex shader */
     const char *vertexShader =
         "#version " GLSL_VERSION "\n"
+#if USE_OPENGL_ES
         "precision highp float;"
+#endif
         "varying vec4 TexCoord0,TexCoord1, TexCoord2;"
         "attribute vec4 MultiTexCoord0,MultiTexCoord1,MultiTexCoord2;"
         "attribute vec4 VertexPosition;"
@@ -238,7 +240,9 @@ static void BuildYUVFragmentShader(vout_display_opengl_t *vgl,
     /* Basic linear YUV -> RGB conversion using bilinear interpolation */
     const char *template_glsl_yuv =
         "#version " GLSL_VERSION "\n"
+#if USE_OPENGL_ES
         "precision highp float;"
+#endif
         "uniform sampler2D Texture0;"
         "uniform sampler2D Texture1;"
         "uniform sampler2D Texture2;"
@@ -289,7 +293,9 @@ static void BuildRGBFragmentShader(vout_display_opengl_t *vgl,
     // Simple shader for RGB
     const char *code =
         "#version " GLSL_VERSION "\n"
+#if USE_OPENGL_ES
         "precision highp float;"
+#endif
         "uniform sampler2D Texture[3];"
         "varying vec4 TexCoord0,TexCoord1,TexCoord2;"
         "void main()"
@@ -307,7 +313,9 @@ static void BuildRGBAFragmentShader(vout_display_opengl_t *vgl,
     // Simple shader for RGBA
     const char *code =
         "#version " GLSL_VERSION "\n"
+#if USE_OPENGL_ES
         "precision highp float;"
+#endif
         "uniform sampler2D Texture;"
         "uniform vec4 FillColor;"
         "varying vec4 TexCoord0;"