1
mirror of https://github.com/mpv-player/mpv synced 2024-11-18 21:16:10 +01:00

vo_gpu: correctly infer HDR peak detection support

The re-ordering of commits e3d93fd and 0870859 ended up swallowing the
change which made the HDR tone mapping algorithm actually check for
RA_CAP_NUM_GROUPS support.
This commit is contained in:
Niklas Haas 2018-02-10 22:49:19 +01:00 committed by Kevin Mitchell
parent 4c2edecd7d
commit 4e7f4f10ce

View File

@ -3393,6 +3393,7 @@ static void check_gl_features(struct gl_video *p)
bool have_texrg = rg_tex && !rg_tex->luminance_alpha;
bool have_compute = ra->caps & RA_CAP_COMPUTE;
bool have_ssbo = ra->caps & RA_CAP_BUF_RW;
bool have_numgroups = ra->caps & RA_CAP_NUM_GROUPS;
const char *auto_fbo_fmts[] = {"rgba16", "rgba16f", "rgba16hf",
"rgb10_a2", "rgba8", 0};
@ -3512,7 +3513,9 @@ static void check_gl_features(struct gl_video *p)
p->opts.deband = 0;
MP_WARN(p, "Disabling debanding (GLSL version too old).\n");
}
if ((!have_compute || !have_ssbo) && p->opts.compute_hdr_peak >= 0) {
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;