QRhiDriverInfo Struct

描述初始化后的QRhi 所使用的物理设备、适配器或图形 API 实现。更多

头文件: #include <rhi/qrhi.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::GuiPrivate)
qmake: QT += gui-private
Qt 6.6

公共类型

enum DeviceType { UnknownDevice, IntegratedDevice, DiscreteDevice, ExternalDevice, VirtualDevice, CpuDevice }

公共变量

quint64 deviceId
QByteArray deviceName
QRhiDriverInfo::DeviceType deviceType
quint64 vendorId

详细说明

图形 API 提供不同级别和种类的信息。所有 API 中唯一可用的值是deviceName ,它是对物理设备、适配器的自由文本描述,或者是GL_VENDOR +GL_RENDERER +GL_VERSION 报告的字符串的组合。对于 OpenGL,deviceId 始终为 0。对于 OpenGL 和 Metal,vendorId 始终为 0。对于 OpenGL 和 Direct 3D,deviceType 始终为UnknownDevice

注: 这是一个 RHI API,兼容性保证有限,详情请参见QRhi

成员类型文档

enum QRhiDriverInfo::DeviceType

在信息可用时指定图形设备的类型。

实际上,这只适用于 Vulkan 和 Metal。在 Direct 3D 11 和 12 中,使用设置了软件标志的适配器会导致值为CpuDevice 。否则,使用 OpenGL 时,值始终为 UnknownDevice。

常量
QRhiDriverInfo::UnknownDevice0
QRhiDriverInfo::IntegratedDevice1
QRhiDriverInfo::DiscreteDevice2
QRhiDriverInfo::ExternalDevice3
QRhiDriverInfo::VirtualDevice4
QRhiDriverInfo::CpuDevice5

成员变量 文档

quint64 QRhiDriverInfo::deviceId

另见 QRhi::driverInfo().

QByteArray QRhiDriverInfo::deviceName

另请参见 QRhi::driverInfo().

QRhiDriverInfo::DeviceType QRhiDriverInfo::deviceType

另请参见 QRhi::driverInfo() 和QRhiDriverInfo::DeviceType

quint64 QRhiDriverInfo::vendorId

另见 QRhi::driverInfo().

© 2025 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.