QRhiD3D11InitParams Struct

Direct3D 11 specific initialization parameters. 更多...

头: #include <QRhiD3D11InitParams>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
Since: Qt 6.6
继承: QRhiInitParams

公共变量

bool enableDebugLayer

详细描述

注意: This is a RHI API with limited compatibility guarantees, see QRhi 了解细节。

A D3D11-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.

QRhiD3D11InitParams params;
params.enableDebugLayer = true;
rhi = QRhi::create(QRhi::D3D11, ¶ms);
					

注意: QRhiSwapChain should only be used in combination with QWindow instances that have their surface type set to QSurface::Direct3DSurface .

Working with existing Direct3D 11 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 QRhiD3D11NativeHandles to QRhi::create (). When the device is set to a non-null value, the device context must be specified as well. 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 and context pointers set to null, while specifying the adapter LUID and feature level.

注意: QRhi works with immediate contexts only. Deferred contexts are not used in any way.

注意: Regardless of using an imported or a QRhi -created device context, the ID3D11DeviceContext1 interface (Direct3D 11.1) must be supported. Initialization will fail otherwise.

成员变量文档编制

bool QRhiD3D11InitParams:: enableDebugLayer

When set to true, a debug device is created, assuming the debug layer is available. The default value is false.