diff options
author | wm4 <wm4@nowhere> | 2015-11-21 20:42:46 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-11-21 20:45:08 +0100 |
commit | 981747316337a058f93f9ff57b4e1f42afaa01dc (patch) | |
tree | 6cf26b43181a1a47b59cf3ac05503ddfa8a407a7 /video/out | |
parent | c5a4fd9beef06186ba70473d1d87cf1bcfc21c70 (diff) | |
download | mpv-981747316337a058f93f9ff57b4e1f42afaa01dc.tar.bz2 mpv-981747316337a058f93f9ff57b4e1f42afaa01dc.tar.xz |
vo_opengl: fix superxbr on GLES
Well, not that anyone does or should care.
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/opengl/superxbr.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/video/out/opengl/superxbr.c b/video/out/opengl/superxbr.c index c5b40fe36f..73fd662308 100644 --- a/video/out/opengl/superxbr.c +++ b/video/out/opengl/superxbr.c @@ -148,14 +148,14 @@ void pass_superxbr(struct gl_shader_cache *sc, int planes, int tex_num, // Optimization: Discard (skip drawing) unused pixels, except those // at the edge. GLSLH(vec2 dist = tex_size * min(pos, vec2(1.0) - pos);) - GLSLH(if (dir.x * dir.y < 0 && dist.x > 1 && dist.y > 1) + GLSLH(if (dir.x * dir.y < 0.0 && dist.x > 1.0 && dist.y > 1.0) return 0.0;) - GLSLH(if (dir.x < 0 || dir.y < 0 || dist.x < 1 || dist.y < 1) + GLSLH(if (dir.x < 0.0 || dir.y < 0.0 || dist.x < 1.0 || dist.y < 1.0) return texture(tex, pos - dir / tex_size)[plane] * tex_mul;) } else { - GLSLH(vec2 dir = fract(pos * tex_size / 2) - 0.5;) - GLSLH(if (dir.x * dir.y > 0) + GLSLH(vec2 dir = fract(pos * tex_size / 2.0) - 0.5;) + GLSLH(if (dir.x * dir.y > 0.0) return texture(tex, pos)[plane] * tex_mul;) } @@ -212,14 +212,14 @@ void pass_superxbr(struct gl_shader_cache *sc, int planes, int tex_num, /* Smoothly blends the two strongest directions(one in diagonal and the * other in vert/horiz direction). */ GLSLHF("float color = mix(mix(c1, c2, step(0.0, d_edge))," - "mix(c3, c4, step(0.0, hv_edge)), 1 - %f);\n", + "mix(c3, c4, step(0.0, hv_edge)), 1.0 - %f);\n", conf->edge_strength); /* Anti-ringing code. */ GLSLH(float min_sample = min(min(E, F), min(H, I)); float max_sample = max(max(E, F), max(H, I)); float aux = color; color = clamp(color, min_sample, max_sample);) - GLSLHF("color = mix(aux, color, 1-2.0*abs(%f-0.5));\n", conf->edge_strength); + GLSLHF("color = mix(aux, color, 1.0-2.0*abs(%f-0.5));\n", conf->edge_strength); GLSLH(return color;) |