From 92d06f43fa1ee1a39d4b97849d11ca8e68d01813 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 19 Nov 2015 21:19:04 +0100 Subject: vo_opengl: fix some more GLES shader issues Just like commit f9a2fc59. There are probably some more such cases. The vec2 constructor calls are probably fine, but don't bother with confusing inconsistencies. --- video/out/opengl/video_shaders.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/video/out/opengl/video_shaders.c b/video/out/opengl/video_shaders.c index 917d1939c5..162a66efe2 100644 --- a/video/out/opengl/video_shaders.c +++ b/video/out/opengl/video_shaders.c @@ -57,7 +57,7 @@ static void pass_sample_separated_get_weights(struct gl_shader_cache *sc, } else { GLSLF("float weights[%d];\n", N); for (int n = 0; n < N / 4; n++) { - GLSLF("c = texture(lut, vec2(1.0 / %d + %d / float(%d), fcoord));\n", + GLSLF("c = texture(lut, vec2(1.0 / %d.0 + %d.0 / %d.0, fcoord));\n", N / 2, n, N / 4); GLSLF("weights[%d] = c.r;\n", n * 4 + 0); GLSLF("weights[%d] = c.g;\n", n * 4 + 1); @@ -79,10 +79,10 @@ void pass_sample_separated_gen(struct gl_shader_cache *sc, struct scaler *scaler GLSL(vec4 color = vec4(0.0);) GLSLF("{\n"); if (!planar) { - GLSLF("vec2 dir = vec2(%d, %d);\n", d_x, d_y); + GLSLF("vec2 dir = vec2(%d.0, %d.0);\n", d_x, d_y); GLSL(pt *= dir;) GLSL(float fcoord = dot(fract(pos * size - vec2(0.5)), dir);) - GLSLF("vec2 base = pos - fcoord * pt - pt * vec2(%d);\n", N / 2 - 1); + GLSLF("vec2 base = pos - fcoord * pt - pt * vec2(%d.0);\n", N / 2 - 1); } GLSL(vec4 c;) if (use_ar) { @@ -95,7 +95,7 @@ void pass_sample_separated_gen(struct gl_shader_cache *sc, struct scaler *scaler if (planar) { GLSLF("c = texture(texture%d, texcoord%d);\n", n, n); } else { - GLSLF("c = texture(tex, base + pt * vec2(%d));\n", n); + GLSLF("c = texture(tex, base + pt * vec2(%d.0));\n", n); } GLSLF("color += vec4(weights[%d]) * c;\n", n); if (use_ar && (n == N/2-1 || n == N/2)) { @@ -137,13 +137,13 @@ void pass_sample_polar(struct gl_shader_cache *sc, struct scaler *scaler) // Skip samples definitely outside the radius if (dmax >= radius) continue; - GLSLF("d = length(vec2(%d, %d) - fcoord)/%f;\n", x, y, radius); + GLSLF("d = length(vec2(%d.0, %d.0) - fcoord)/%f;\n", x, y, radius); // Check for samples that might be skippable if (dmax >= radius - 1) GLSLF("if (d < 1.0) {\n"); GLSL(w = texture1D(lut, d).r;) GLSL(wsum += w;) - GLSLF("c = texture(tex, base + pt * vec2(%d, %d));\n", x, y); + GLSLF("c = texture(tex, base + pt * vec2(%d.0, %d.0));\n", x, y); GLSL(color += vec4(w) * c;) if (use_ar && x >= 0 && y >= 0 && x <= 1 && y <= 1) { GLSL(lo = min(lo, c);) -- cgit v1.2.3