[565/906] effects: fix shader compilation with mesa drivers
authorMatthew Waters <ystreet00@gmail.com>
Mon, 20 Aug 2012 03:06:27 +0000 (13:06 +1000)
committerMatthew Waters <ystreet00@gmail.com>
Sat, 15 Mar 2014 17:36:47 +0000 (18:36 +0100)
gst/gl/effects/gstgleffectssources.c

index b3fb484..28e3dd2 100644 (file)
@@ -267,7 +267,6 @@ const gchar *luma_threshold_fragment_source =
   "uniform sampler2DRect tex;"
   "void main () {"
   "  vec2 texturecoord = gl_TexCoord[0].st;"
-  "  int i;"
   "  vec4 color = texture2DRect(tex, texturecoord);"
   "  float luma = dot(color.rgb, vec3(0.2125, 0.7154, 0.0721));"    /* BT.709 (from orange book) */
   "  gl_FragColor = vec4 (vec3 (smoothstep (0.30, 0.50, luma)), color.a);"
@@ -284,7 +283,7 @@ const gchar *sep_sobel_length_fragment_source =
   "  float len = length (g);"
   /* little trick to avoid IF operator */
   /* TODO: test if a standalone inverting pass is worth */
-  "  gl_FragColor = abs(int(invert) - vec4(vec3(len), 1.0));"
+  "  gl_FragColor = abs(vec4(vec3(float(invert) - len), 1.0));"
   "}";
 
 const gchar *desaturate_fragment_source =
@@ -455,7 +454,7 @@ const gchar *sin_fragment_source =
   "  vec4 color = texture2DRect (tex, vec2(gl_TexCoord[0].st));"
   "  float luma = dot(color.rgb, vec3(0.2125, 0.7154, 0.0721));"
 /* calculate hue with the Preucil formula */
-  "  float cosh = 0.5*(2*color.r - color.g - color.b);"
+  "  float cosh = color.r - 0.5*(color.g + color.b);"
 /* sqrt(3)/2 = 0.866 */
   "  float sinh = 0.866*(color.g - color.b);"
 /* hue = atan2 h */