diff options
author | wm4 <wm4@nowhere> | 2015-11-19 14:41:49 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-11-19 14:41:49 +0100 |
commit | f9a2fc592f1133174e7417121c6ae8212a696fb0 (patch) | |
tree | 526e7bff79ec27738240faf7df6fa8ab69975539 | |
parent | 76e4374d0644edbde087896497aca4e1cf0906a0 (diff) | |
download | mpv-f9a2fc592f1133174e7417121c6ae8212a696fb0.tar.bz2 mpv-f9a2fc592f1133174e7417121c6ae8212a696fb0.tar.xz |
vo_opengl: don't mix floats and integers in dither shader
Some GLSL dialects (GLSL ES 3.00) do not have such implicit conversions.
They have to be made floats for the sake of the shader compiler.
-rw-r--r-- | video/out/opengl/video.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index 31596b4561..6e9b7627d5 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -1771,7 +1771,7 @@ static void pass_dither(struct gl_video *p) gl_sc_uniform_sampler(p->sc, "dither", GL_TEXTURE_2D, TEXUNIT_DITHER); - GLSLF("vec2 dither_pos = gl_FragCoord.xy / %d;\n", p->dither_size); + GLSLF("vec2 dither_pos = gl_FragCoord.xy / %d.0;\n", p->dither_size); if (p->opts.temporal_dither) { int phase = (p->frames_rendered / p->opts.temporal_dither_period) % 8u; @@ -1786,8 +1786,8 @@ static void pass_dither(struct gl_video *p) } GLSL(float dither_value = texture(dither, dither_pos).r;) - GLSLF("color = floor(color * %d + dither_value + 0.5 / (%d * %d)) / %d;\n", - dither_quantization, p->dither_size, p->dither_size, + GLSLF("color = floor(color * %d.0 + dither_value + 0.5 / %d.0) / %d.0;\n", + dither_quantization, p->dither_size * p->dither_size, dither_quantization); } |