diff options
author | wm4 <wm4@nowhere> | 2015-02-03 17:39:30 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-02-03 17:39:30 +0100 |
commit | fd78d775865f019b2af59812f9c3f8c95ae4ac03 (patch) | |
tree | 57f22b0ab0dda8f7946257c00077dfb2debc76d2 /video/out | |
parent | 98828886d40258a410250b09ef3059c77562651e (diff) | |
download | mpv-fd78d775865f019b2af59812f9c3f8c95ae4ac03.tar.bz2 mpv-fd78d775865f019b2af59812f9c3f8c95ae4ac03.tar.xz |
vo_opengl: avoid unnecessary shader reinit on fullscreen toggle
Makes it unnecessarily slow. It's still needed if the sigmoid crap is
actually used.
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/gl_video.c | 6 |
1 files 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); |