NativeBuffer Struct

struct QRhiBuffer ::NativeBuffer

Contains information about the underlying native resources of a buffer. 更多...

公共变量

const void *[3] 对象
int slotCount

详细描述

成员变量文档编制

const void *[ 3 ] NativeBuffer:: 对象

This variable holds an array with pointers to the native object handles.

With OpenGL, the native handle is a GLuint value, so the elements in the 对象 array are pointers to a GLuint. With Vulkan, the native handle is a VkBuffer, so the elements of the array are pointers to a VkBuffer. With Direct3D 11 and Metal the elements are pointers to a ID3D11Buffer or MTLBuffer pointer, respectively. With Direct3D 12, the elements are pointers to a ID3D12Resource.

注意: Pay attention to the fact that the elements are always pointers to the native buffer handle type, even if the native type itself is a pointer. (so the elements are VkBuffer * on Vulkan, even though VkBuffer itself is a pointer on 64-bit architectures).

int NativeBuffer:: slotCount

Specifies the number of valid elements in the objects array.

The value can be 0, 1, 2, or 3 in practice. 0 indicates that the QRhiBuffer is not backed by any native buffer objects. This can happen with QRhiBuffers with the usage UniformBuffer when the underlying API does not support (or the backend chooses not to use) native uniform buffers. 1 is commonly used for Immutable and Static types (but some backends may differ). 2 or 3 is typical when the type is Dynamic (but some backends may differ).

另请参阅 QRhi::currentFrameSlot () 和 QRhi::FramesInFlight .