diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2023-08-28 17:42:34 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-09-04 19:25:29 +0000 |
commit | 9c716996668c4fa634c93bdedbe2c36ce98881fe (patch) | |
tree | 1ab8710a3948b05b70b3c9d98ffa28b17cde8025 | |
parent | 3e4fb204b0cc14248090860cafe9b0755eed4a4b (diff) |
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 76ae3dd78335b39d89b78480b6e9bf7364b3bd2c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | examples/quick/quickwidgets/quickwidget/rotatingsquare.qml | 2 | ||||
-rw-r--r-- | src/quickwidgets/qquickwidget.cpp | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/examples/quick/quickwidgets/quickwidget/rotatingsquare.qml b/examples/quick/quickwidgets/quickwidget/rotatingsquare.qml index 355c02f0cd..7fdc1978ce 100644 --- a/examples/quick/quickwidgets/quickwidget/rotatingsquare.qml +++ b/examples/quick/quickwidgets/quickwidget/rotatingsquare.qml @@ -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) diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp index cdf5f97fc3..fb3c8554be 100644 --- a/src/quickwidgets/qquickwidget.cpp +++ b/src/quickwidgets/qquickwidget.cpp @@ -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: |