Use highp float precision only in YUY2 color convert shaders.
- Port of e15c8166d4fcfd65c7030d53da57bd30feae7606 from
imx-gst-plugins-bad to imx-gst-plugins-base
Change-Id: I065afc9a93bbe646626566bae8f55d3191c3dfa3
diff --git a/gst-libs/gst/gl/gstglcolorconvert.c b/gst-libs/gst/gl/gstglcolorconvert.c
index 2f0136b..232670a 100644
--- a/gst-libs/gst/gl/gstglcolorconvert.c
+++ b/gst-libs/gst/gl/gstglcolorconvert.c
@@ -137,6 +137,18 @@
"uniform float poffset_x;\n" \
"uniform float poffset_y;\n"
+#define DEFAULT_UNIFORMS_HIGH \
+ "#ifdef GL_ES\n" \
+ "precision highp float;\n" \
+ "#endif\n" \
+ "uniform vec2 tex_scale0;\n" \
+ "uniform vec2 tex_scale1;\n" \
+ "uniform vec2 tex_scale2;\n" \
+ "uniform float width;\n" \
+ "uniform float height;\n" \
+ "uniform float poffset_x;\n" \
+ "uniform float poffset_y;\n"
+
#define MAX_FUNCTIONS 4
#define glsl_OES_extension_string "#extension GL_OES_EGL_image_external : require \n"
@@ -356,7 +368,7 @@
static const struct shader_templ templ_YUY2_UYVY_to_RGB =
{ NULL,
- DEFAULT_UNIFORMS YUV_TO_RGB_COEFFICIENTS "uniform sampler2D Ytex;\n",
+ DEFAULT_UNIFORMS_HIGH YUV_TO_RGB_COEFFICIENTS "uniform sampler2D Ytex;\n",
{ glsl_func_yuv_to_rgb, NULL, },
GST_GL_TEXTURE_TARGET_2D
};
@@ -387,7 +399,7 @@
static const struct shader_templ templ_RGB_to_YUY2_UYVY =
{ NULL,
- DEFAULT_UNIFORMS RGB_TO_YUV_COEFFICIENTS "uniform sampler2D tex;\n",
+ DEFAULT_UNIFORMS_HIGH RGB_TO_YUV_COEFFICIENTS "uniform sampler2D tex;\n",
{ glsl_func_rgb_to_yuv, NULL, },
GST_GL_TEXTURE_TARGET_2D
};