From 81b6eb264dccf5573f59c3738d2665119f413512 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 14 Sep 2023 16:03:39 +0200 Subject: [PATCH] Sync rhi backingstore d3d12 behavior with Quick MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When adding the D3D12 code path in widgets it seems it was ignored that the retry-with-WARP logic was present both for D3D11 and 12 in Qt Quick. For consistency, the same logic must be used. Right now widgets only has the retry logic for D3D11. Change-Id: I08d5728acfb9a68db7e0a4b0477050f08546ffac Reviewed-by: Christian Strømme (cherry picked from commit 54816a8f9af706d9a14cd2501fcaf74962bbdbd8) Reviewed-by: Qt Cherry-pick Bot --- src/gui/painting/qbackingstorerhisupport.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/painting/qbackingstorerhisupport.cpp b/src/gui/painting/qbackingstorerhisupport.cpp index 3927367af69..77240f0f92e 100644 --- a/src/gui/painting/qbackingstorerhisupport.cpp +++ b/src/gui/painting/qbackingstorerhisupport.cpp @@ -85,7 +85,7 @@ bool QBackingStoreRhiSupport::create() params.enableDebugLayer = m_config.isDebugLayerEnabled(); rhi = QRhi::create(QRhi::D3D11, ¶ms, flags); if (!rhi && !flags.testFlag(QRhi::PreferSoftwareRenderer)) { - qCDebug(lcQpaBackingStore, "Failed to create a D3D device with default settings; " + qCDebug(lcQpaBackingStore, "Failed to create a D3D11 device with default settings; " "attempting to get a software rasterizer backed device instead"); flags |= QRhi::PreferSoftwareRenderer; rhi = QRhi::create(QRhi::D3D11, ¶ms, flags); @@ -94,6 +94,12 @@ bool QBackingStoreRhiSupport::create() QRhiD3D12InitParams params; params.enableDebugLayer = m_config.isDebugLayerEnabled(); rhi = QRhi::create(QRhi::D3D12, ¶ms, flags); + if (!rhi && !flags.testFlag(QRhi::PreferSoftwareRenderer)) { + qCDebug(lcQpaBackingStore, "Failed to create a D3D12 device with default settings; " + "attempting to get a software rasterizer backed device instead"); + flags |= QRhi::PreferSoftwareRenderer; + rhi = QRhi::create(QRhi::D3D12, ¶ms, flags); + } } } #endif