From 44dc79dcb0161dee3586f596f5c7669aeafb5cad Mon Sep 17 00:00:00 2001 From: James Ross-Gowan Date: Mon, 12 Feb 2018 23:01:52 +1100 Subject: vo_gpu: check for HDR peak detection in dumb mode too Similar spirit to edb4970ca8b9. check_gl_features() has a confusing early-return. This also adds compute_hdr_peak to the list of options that is copied to the dumb-mode options struct, since it seems to make a difference. Otherwise it would be impossible to disable HDR peak detection in dumb mode. --- video/out/gpu/video.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c index 6edf4b0ccf..b48172433e 100644 --- a/video/out/gpu/video.c +++ b/video/out/gpu/video.c @@ -3524,6 +3524,13 @@ static void check_gl_features(struct gl_video *p) MP_VERBOSE(p, "Disabling alpha checkerboard (no gl_FragCoord).\n"); } + bool have_compute_peak = have_compute && have_ssbo && have_numgroups; + if (!have_compute_peak && p->opts.compute_hdr_peak >= 0) { + int msgl = p->opts.compute_hdr_peak == 1 ? MSGL_WARN : MSGL_V; + MP_MSG(p, msgl, "Disabling HDR peak computation (no compute shaders).\n"); + p->opts.compute_hdr_peak = -1; + } + p->forced_dumb_mode = p->opts.dumb_mode > 0 || !have_fbo || !have_texrg; bool voluntarily_dumb = check_dumb_mode(p); if (p->forced_dumb_mode || voluntarily_dumb) { @@ -3543,6 +3550,7 @@ static void check_gl_features(struct gl_video *p) .alpha_mode = p->opts.alpha_mode, .use_rectangle = p->opts.use_rectangle, .background = p->opts.background, + .compute_hdr_peak = p->opts.compute_hdr_peak, .dither_algo = p->opts.dither_algo, .dither_depth = p->opts.dither_depth, .dither_size = p->opts.dither_size, @@ -3608,13 +3616,6 @@ static void check_gl_features(struct gl_video *p) p->opts.deband = 0; MP_WARN(p, "Disabling debanding (GLSL version too old).\n"); } - - bool have_compute_peak = have_compute && have_ssbo && have_numgroups; - if (!have_compute_peak && p->opts.compute_hdr_peak >= 0) { - int msgl = p->opts.compute_hdr_peak == 1 ? MSGL_WARN : MSGL_V; - MP_MSG(p, msgl, "Disabling HDR peak computation (no compute shaders).\n"); - p->opts.compute_hdr_peak = -1; - } } static void init_gl(struct gl_video *p) -- cgit v1.2.3