From a9cb2e2821adb40e7548e8233390e79706104041 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Mon, 3 Jan 2022 03:56:36 +0100 Subject: vo_gpu_next: update for new tone mapping options This was significantly refactored upstream. Switch to new APIs and add new tone mapping curves and options. cf. https://code.videolan.org/videolan/libplacebo/-/merge_requests/212 --- video/out/gpu/video_shaders.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'video/out/gpu/video_shaders.c') diff --git a/video/out/gpu/video_shaders.c b/video/out/gpu/video_shaders.c index df379778fc..d7774a61e5 100644 --- a/video/out/gpu/video_shaders.c +++ b/video/out/gpu/video_shaders.c @@ -692,7 +692,8 @@ static void pass_tone_map(struct gl_shader_cache *sc, // This function always operates on an absolute scale, so ignore the // dst_peak normalization for it float dst_scale = dst_peak; - if (opts->curve == TONE_MAPPING_BT_2390) + enum tone_mapping curve = opts->curve ? opts->curve : TONE_MAPPING_BT_2390; + if (curve == TONE_MAPPING_BT_2390) dst_scale = 1.0; // Rescale the variables in order to bring it into a representation where @@ -709,7 +710,7 @@ static void pass_tone_map(struct gl_shader_cache *sc, GLSL(sig_peak *= slope;) float param = opts->curve_param; - switch (opts->curve) { + switch (curve) { case TONE_MAPPING_CLIP: GLSLF("sig = min(%f * sig, 1.0);\n", isnan(param) ? 1.0 : param); break; -- cgit v1.2.3