From 8a1915e04e2969a358aa5004bbd511cd92ce7372 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 7 Jun 2023 14:21:26 +0200 Subject: [PATCH] rhi: d3d11: Fix swapchain format check ...to only return true for HDR formats that are sensible for Direct 3D. There are currently no other formats, but new ones may get added in the future. Pick-to: 6.6 6.5 Change-Id: I4fc6d605da8f6bf2644a4e5c355ab8f1c62ad68d Reviewed-by: Andy Nichols --- src/gui/rhi/qrhid3d11.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/rhi/qrhid3d11.cpp b/src/gui/rhi/qrhid3d11.cpp index 76e0d9d420..f20c1f4072 100644 --- a/src/gui/rhi/qrhid3d11.cpp +++ b/src/gui/rhi/qrhid3d11.cpp @@ -4904,8 +4904,10 @@ bool QD3D11SwapChain::isFormatSupported(Format f) QRHI_RES_RHI(QRhiD3D11); DXGI_OUTPUT_DESC1 desc1; - if (outputDesc1ForWindow(m_window, rhiD->activeAdapter, &desc1)) - return desc1.ColorSpace == DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020; + if (outputDesc1ForWindow(m_window, rhiD->activeAdapter, &desc1)) { + if (desc1.ColorSpace == DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020) + return f == QRhiSwapChain::HDRExtendedSrgbLinear || f == QRhiSwapChain::HDR10; + } return false; }