Skip to content

Commit 0a84c0a

Browse files
committed
vo_gpu_next: add workaround for broken linear output in libplacebo
See: https://code.videolan.org/videolan/libplacebo/-/merge_requests/759
1 parent 9b43416 commit 0a84c0a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

video/out/vo_gpu_next.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,6 +1131,14 @@ static bool draw_frame(struct vo *vo, struct vo_frame *frame)
11311131
pl_color_space_merge(&hint, source);
11321132
if (target_unknown && !opts->target_trc && !pl_color_transfer_is_hdr(source->transfer))
11331133
hint = *source;
1134+
// Vulkan doesn't have support for gamma 2.2 transfer function,
1135+
// so even though requested preferred color space is gamma 2.2, we
1136+
// fallback to sRGB. sRGB itself is ambiguous, but at least we have
1137+
// options to control the behavior.
1138+
// TODO: Revise this after fix for linear transfers lands in libplacebo.
1139+
// <https://code.videolan.org/videolan/libplacebo/-/merge_requests/759>
1140+
if (hint.transfer == PL_COLOR_TRC_GAMMA22)
1141+
hint.transfer = PL_COLOR_TRC_SRGB;
11341142
// Restore target luminance if it was present, note that we check
11351143
// max_luma only, this make sure that max_cll/max_fall is not take
11361144
// from source.

0 commit comments

Comments
 (0)