Fix QQuickWidget rendering API mapping for D3D12

Right now requesting d3d12 via QSG_RHI_BACKEND or the C++
API maps to the Null backend of QRhi. That is not ideal.

QRhiWidget has this logic, but the already existing
QQuickWidget was not yet adjusted in 6.6 it seems.

Change-Id: I12301e815d525c14584b01dcd0caa787d1c79ad0
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 76ae3dd783)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Laszlo Agocs 2023-08-28 17:42:34 +02:00 committed by Qt Cherry-pick Bot
parent 3e4fb204b0
commit 9c71699666
2 changed files with 4 additions and 0 deletions

View File

@ -31,6 +31,8 @@ Rectangle {
text.api = "OpenGL on QRhi";
else if (api === GraphicsInfo.Direct3D11)
text.api = "D3D11 on QRhi";
else if (api === GraphicsInfo.Direct3D12)
text.api = "D3D12 on QRhi";
else if (api === GraphicsInfo.Vulkan)
text.api = "Vulkan on QRhi";
else if (api === GraphicsInfo.Metal)

View File

@ -989,6 +989,8 @@ static inline QPlatformBackingStoreRhiConfig::Api graphicsApiToBackingStoreRhiAp
return QPlatformBackingStoreRhiConfig::Vulkan;
case QSGRendererInterface::Direct3D11:
return QPlatformBackingStoreRhiConfig::D3D11;
case QSGRendererInterface::Direct3D12:
return QPlatformBackingStoreRhiConfig::D3D12;
case QSGRendererInterface::Metal:
return QPlatformBackingStoreRhiConfig::Metal;
default: