From 2abf20b2b2287150751c4e60f0eec818ade5fe73 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 3 Nov 2017 11:49:17 +0100 Subject: [PATCH] vo_gpu: fix mobius tone mapping compatibility to GLSL 120 Normally such code is didsabled by have_mglsl==false in check_gl_features(), but apparently not this one. Just fix it. Seems also more readable. Fixes #5069. --- video/out/gpu/video_shaders.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/video/out/gpu/video_shaders.c b/video/out/gpu/video_shaders.c index 7081a10fef..02f27b1bdb 100644 --- a/video/out/gpu/video_shaders.c +++ b/video/out/gpu/video_shaders.c @@ -627,7 +627,7 @@ static void pass_tone_map(struct gl_shader_cache *sc, float ref_peak, GLSLF("float b = (j*j - 2.0*j*sig_peak + sig_peak) / " "max(1e-6, sig_peak - 1.0);\n"); GLSLF("float scale = (b*b + 2.0*b*j + j*j) / (b-a);\n"); - GLSL(sig = mix(sig, scale * (sig + a) / (sig + b), sig > j);) + GLSL(sig = sig > j ? scale * (sig + a) / (sig + b) : sig;) break; case TONE_MAPPING_REINHARD: {