QRhiBuffer::NativeBuffer Struct
struct QRhiBuffer::NativeBuffer包含有关缓冲区底层本地资源的信息。更多
公共变量
成员变量文档
const void *[3] NativeBuffer::objects
该变量保存一个数组,其中包含指向本地对象句柄的指针。
对于 OpenGL,本地句柄是一个 GLuint 值,因此objects
数组中的元素都是指向 GLuint 的指针。对于 Vulkan,本地句柄是一个 VkBuffer,因此数组中的元素是指向 VkBuffer 的指针。对于 Direct3D 11 和 Metal,元素分别是指向 ID3D11Buffer 或 MTLBuffer 指针的指针。使用 Direct3D 12 时,元素是指向 ID3D12Resource 的指针。
注意: 请注意元素始终是指向本地缓冲区句柄类型的指针,即使本地类型本身也是指针。(因此,在 Vulkan 上元素是VkBuffer *
,即使 VkBuffer 本身在 64 位架构上是指针)。
int NativeBuffer::slotCount
指定对象数组中有效元素的个数。
实际上,该值可以是 0、1、2 或 3。0 表示QRhiBuffer 没有任何本地缓冲区对象支持。当底层 API 不支持(或后端选择不使用)本地统一缓冲区时,使用UniformBuffer 的 QRhiBuffers 可能会出现这种情况。1 通常用于不可变和静态类型(但某些后端可能会有所不同)。2 或 3 通常用于动态类型(但某些后端可能有所不同)。
另请参阅 QRhi::currentFrameSlot() 和QRhi::FramesInFlight 。
© 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.