summaryrefslogtreecommitdiffstats
path: root/video/out/gpu/video_shaders.c
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2022-01-03 03:56:36 +0100
committerNiklas Haas <github-daiK1o@haasn.dev>2022-01-07 06:28:14 +0100
commita9cb2e2821adb40e7548e8233390e79706104041 (patch)
tree382cee5ce44b9c6cf3ae196e23e908c4718ebbea /video/out/gpu/video_shaders.c
parent57bc5ba6d6579d5f1e6897f6915a3a940b84bb73 (diff)
downloadmpv-a9cb2e2821adb40e7548e8233390e79706104041.tar.bz2
mpv-a9cb2e2821adb40e7548e8233390e79706104041.tar.xz
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
Diffstat (limited to 'video/out/gpu/video_shaders.c')
-rw-r--r--video/out/gpu/video_shaders.c5
1 files changed, 3 insertions, 2 deletions
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;