From 84df44d344cf2a2713fcf01196da8852a72e1bc9 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Thu, 23 Apr 2026 23:25:26 +0300 Subject: [PATCH] Fixed upside-down webcam in group calls on Linux QRhi path. --- .../calls/group/calls_group_viewport_rhi.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Telegram/SourceFiles/calls/group/calls_group_viewport_rhi.cpp b/Telegram/SourceFiles/calls/group/calls_group_viewport_rhi.cpp index ecb32041f8..31696f3fad 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_viewport_rhi.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_viewport_rhi.cpp @@ -952,12 +952,24 @@ void Viewport::RendererRhi::drawYuv2RgbPass( tileData.convertedSize = frameSize; } + // Y-flip the UV for Linux: QRhi/OpenGL on Linux lands YUV frames + // upside-down in the offscreen RGB target compared with Metal/D3D11 + // backends used on macOS/Windows, which already render correctly. +#ifdef Q_OS_LINUX + const float coords[] = { + -1.f, -1.f, 0.f, 0.f, + 1.f, -1.f, 1.f, 0.f, + -1.f, 1.f, 0.f, 1.f, + 1.f, 1.f, 1.f, 1.f, + }; +#else // Q_OS_LINUX const float coords[] = { -1.f, -1.f, 0.f, 1.f, 1.f, -1.f, 1.f, 1.f, -1.f, 1.f, 0.f, 0.f, 1.f, 1.f, 1.f, 0.f, }; +#endif // Q_OS_LINUX if (!_rub) { _rub = _rhi->nextResourceUpdateBatch();