From 0a84c0a2045ae06c1ccb5f33fc898bd07be60f65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Tue, 28 Oct 2025 13:40:15 +0100 Subject: [PATCH] vo_gpu_next: add workaround for broken linear output in libplacebo See: https://code.videolan.org/videolan/libplacebo/-/merge_requests/759 --- video/out/vo_gpu_next.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index e153e8de7a..2585485eeb 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -1131,6 +1131,14 @@ static bool draw_frame(struct vo *vo, struct vo_frame *frame) pl_color_space_merge(&hint, source); if (target_unknown && !opts->target_trc && !pl_color_transfer_is_hdr(source->transfer)) hint = *source; + // Vulkan doesn't have support for gamma 2.2 transfer function, + // so even though requested preferred color space is gamma 2.2, we + // fallback to sRGB. sRGB itself is ambiguous, but at least we have + // options to control the behavior. + // TODO: Revise this after fix for linear transfers lands in libplacebo. + // + if (hint.transfer == PL_COLOR_TRC_GAMMA22) + hint.transfer = PL_COLOR_TRC_SRGB; // Restore target luminance if it was present, note that we check // max_luma only, this make sure that max_cll/max_fall is not take // from source.