C Specification
To bind an index buffer, along with its size, to a command buffer, call:
// Provided by VK_VERSION_1_4
void vkCmdBindIndexBuffer2(
VkCommandBuffer commandBuffer,
VkBuffer buffer,
VkDeviceSize offset,
VkDeviceSize size,
VkIndexType indexType);
// Provided by VK_KHR_maintenance5
// Equivalent to vkCmdBindIndexBuffer2
void vkCmdBindIndexBuffer2KHR(
VkCommandBuffer commandBuffer,
VkBuffer buffer,
VkDeviceSize offset,
VkDeviceSize size,
VkIndexType indexType);
Parameters
-
commandBufferis the command buffer into which the command is recorded. -
bufferis the buffer being bound. -
offsetis the starting offset in bytes withinbufferused in index buffer address calculations. -
sizeis the size in bytes of index data bound frombuffer. -
indexTypeis a VkIndexType value specifying the size of the indices.
Description
buffer, offset, and size specify the bound index buffer range, with a range of memory bound from
[base + offset, base + offset +
size), where base is the start of buffer.
If size is VK_WHOLE_SIZE then the range is from offset to
the end of the buffer.
If the maintenance6 feature is enabled,
buffer can be VK_NULL_HANDLE.
If buffer is VK_NULL_HANDLE and the nullDescriptor feature is enabled, every index fetched results in a
value of zero.
Document Notes
For more information, see the Vulkan Specification.
This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.