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>
This commit is contained in:
Laszlo Agocs 2023-09-14 16:03:39 +02:00
parent 08d642ed4e
commit 54816a8f9a

View File

@ -85,7 +85,7 @@ bool QBackingStoreRhiSupport::create()
params.enableDebugLayer = m_config.isDebugLayerEnabled();
rhi = QRhi::create(QRhi::D3D11, &params, 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, &params, flags);
@ -94,6 +94,12 @@ bool QBackingStoreRhiSupport::create()
QRhiD3D12InitParams params;
params.enableDebugLayer = m_config.isDebugLayerEnabled();
rhi = QRhi::create(QRhi::D3D12, &params, 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, &params, flags);
}
}
}
#endif