diff options
Diffstat (limited to 'tests/manual/rhi/hellominimalcrossgfxtriangle/window.cpp')
-rw-r--r-- | tests/manual/rhi/hellominimalcrossgfxtriangle/window.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/manual/rhi/hellominimalcrossgfxtriangle/window.cpp b/tests/manual/rhi/hellominimalcrossgfxtriangle/window.cpp index c75dd73908..edbd048c63 100644 --- a/tests/manual/rhi/hellominimalcrossgfxtriangle/window.cpp +++ b/tests/manual/rhi/hellominimalcrossgfxtriangle/window.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "window.h" #include <QPlatformSurfaceEvent> @@ -16,6 +16,7 @@ Window::Window(QRhi::Implementation graphicsApi) setSurfaceType(VulkanSurface); break; case QRhi::D3D11: + case QRhi::D3D12: setSurfaceType(Direct3DSurface); break; case QRhi::Metal: @@ -81,7 +82,7 @@ bool Window::event(QEvent *e) void Window::init() { - QRhi::Flags rhiFlags = QRhi::EnableDebugMarkers | QRhi::EnableProfiling; + QRhi::Flags rhiFlags = QRhi::EnableDebugMarkers; if (m_graphicsApi == QRhi::Null) { QRhiNullInitParams params; @@ -112,10 +113,14 @@ void Window::init() QRhiD3D11InitParams params; params.enableDebugLayer = true; m_rhi.reset(QRhi::create(QRhi::D3D11, ¶ms, rhiFlags)); + } else if (m_graphicsApi == QRhi::D3D12) { + QRhiD3D12InitParams params; + params.enableDebugLayer = true; + m_rhi.reset(QRhi::create(QRhi::D3D12, ¶ms, rhiFlags)); } #endif -#if defined(Q_OS_MACOS) || defined(Q_OS_IOS) +#if QT_CONFIG(metal) if (m_graphicsApi == QRhi::Metal) { QRhiMetalInitParams params; m_rhi.reset(QRhi::create(QRhi::Metal, ¶ms, rhiFlags)); |