From fd78d775865f019b2af59812f9c3f8c95ae4ac03 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 3 Feb 2015 17:39:30 +0100 Subject: vo_opengl: avoid unnecessary shader reinit on fullscreen toggle Makes it unnecessarily slow. It's still needed if the sigmoid crap is actually used. --- video/out/gl_video.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/video/out/gl_video.c b/video/out/gl_video.c index 54dc5a9ebe..64cd4bc707 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -163,6 +163,7 @@ struct gl_video { float input_gamma, conv_gamma; float user_gamma; bool user_gamma_enabled; // shader handles user_gamma + bool sigmoid_enabled; struct video_image image; @@ -946,7 +947,8 @@ static void compile_shaders(struct gl_video *p) // Optionally transform to sigmoidal color space if requested, but only // when upscaling in linear light - bool use_sigmoid = p->opts.sigmoid_upscaling && use_linear_light && p->upscaling; + p->sigmoid_enabled = p->opts.sigmoid_upscaling && use_linear_light; + bool use_sigmoid = p->sigmoid_enabled && p->upscaling; // Figure out the right color spaces we need to convert, if any enum mp_csp_prim prim_src = p->image_params.primaries, prim_dest; @@ -1912,7 +1914,7 @@ static void check_resize(struct gl_video *p) p->upscaling = !p->upscaling; // Switching between upscaling and downscaling also requires sigmoid // to be toggled - need_scaler_reinit |= p->opts.sigmoid_upscaling; + need_scaler_reinit |= p->sigmoid_enabled; } if (need_scaler_reinit) { reinit_rendering(p); -- cgit v1.2.3