mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-07-12 18:03:52 +00:00
Force sRGB Vulkan swapchain on macOS to fix washed out colors
This commit is contained in:
@@ -897,7 +897,19 @@ void PlVkRenderer::renderFrame(AVFrame *frame)
|
||||
if (!pl_color_space_equal(&mappedFrame.color, &m_LastColorspace)) {
|
||||
m_LastColorspace = mappedFrame.color;
|
||||
SDL_assert(pl_color_space_equal(&mappedFrame.color, &m_LastColorspace));
|
||||
pl_swapchain_colorspace_hint(m_Swapchain, &mappedFrame.color);
|
||||
|
||||
#ifdef Q_OS_DARWIN
|
||||
// There is a gamma mismatch on macOS between what libplacebo thinks BT.709
|
||||
// should use and what the Metal layer actually displays. Use sRGB for the
|
||||
// swapchain when the incoming frames are BT.709 as a workaround.
|
||||
if (pl_color_space_equal(&mappedFrame.color, &pl_color_space_bt709)) {
|
||||
pl_swapchain_colorspace_hint(m_Swapchain, &pl_color_space_srgb);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
pl_swapchain_colorspace_hint(m_Swapchain, &mappedFrame.color);
|
||||
}
|
||||
}
|
||||
|
||||
// Reserve enough space to avoid allocating under the overlay lock
|
||||
|
||||
Reference in New Issue
Block a user