QRhiD3D12InitParams Struct
Direct3D 12 specific initialization parameters. More...
Header: | #include <rhi/qrhi.h> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui) target_link_libraries(mytarget PRIVATE Qt6::GuiPrivate) |
qmake: | QT += gui-private |
Inherits: | QRhiInitParams |
Public Variables
bool | enableDebugLayer |
Detailed Description
Note: This is a RHI API with limited compatibility guarantees, see QRhi for details.
A D3D12-based QRhi needs no special parameters for initialization. If desired, enableDebugLayer can be set to true
to enable the Direct3D debug layer. This can be useful during development, but should be avoided in production builds.
QRhiD3D12InitParams params; params.enableDebugLayer = true; rhi = QRhi::create(QRhi::D3D12, ¶ms);
Note: QRhiSwapChain should only be used in combination with QWindow instances that have their surface type set to QSurface::Direct3DSurface.
Working with existing Direct3D 12 devices
When interoperating with another graphics engine, it may be necessary to get a QRhi instance that uses the same Direct3D device. This can be achieved by passing a pointer to a QRhiD3D12NativeHandles to QRhi::create(). QRhi does not take ownership of any of the external objects.
Sometimes, for example when using QRhi in combination with OpenXR, one will want to specify which adapter to use, and optionally, which feature level to request on the device, while leaving the device creation to QRhi. This is achieved by leaving the device pointer set to null, while specifying the adapter LUID and feature level.
Optionally the ID3D12CommandQueue can be specified as well, by setting commandQueue
to a non-null value.
© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.