diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2023-09-14 16:03:39 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2023-09-19 17:16:25 +0200 |
commit | 54816a8f9af706d9a14cd2501fcaf74962bbdbd8 (patch) | |
tree | d556943f59aeb86c9b7c2ecfa4e1192501e913af /src/gui/painting | |
parent | 08d642ed4e9a3a04bca748c593165f9c3cc13aa0 (diff) |
Sync rhi backingstore d3d12 behavior with Quick
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.
Pick-to: 6.6
Change-Id: I08d5728acfb9a68db7e0a4b0477050f08546ffac
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qbackingstorerhisupport.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gui/painting/qbackingstorerhisupport.cpp b/src/gui/painting/qbackingstorerhisupport.cpp index 3927367af6..77240f0f92 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 |