From f9a2fc592f1133174e7417121c6ae8212a696fb0 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 19 Nov 2015 14:41:49 +0100 Subject: 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. --- video/out/opengl/video.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'video/out/opengl/video.c') 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); } -- cgit v1.2.3