Alternatively, to bind vertex buffers, along with their sizes and strides, to a command buffer for use in subsequent drawing commands, call:
// Provided by VK_EXT_extended_dynamic_state void vkCmdBindVertexBuffers2EXT( VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes, const VkDeviceSize* pStrides);
commandBufferis the command buffer into which the command is recorded.
firstBindingis the index of the first vertex input binding whose state is updated by the command.
bindingCountis the number of vertex input bindings whose state is updated by the command.
pBuffersis a pointer to an array of buffer handles.
pOffsetsis a pointer to an array of buffer offsets.
NULLor a pointer to an array of the size in bytes of vertex data bound from
NULLor a pointer to an array of buffer strides.
The values taken from elements i of
replace the current state for the vertex input binding
firstBinding + i, for i in [0,
The vertex input binding is updated to start at the offset indicated by
pOffsets[i] from the start of the buffer
pSizes is not
pSizes[i] specifies the bound size
of the vertex buffer starting from the corresponding elements of
All vertex input attributes that use each of these bindings will use these
updated addresses in their address calculations for subsequent drawing
If the nullDescriptor feature is enabled,
pBuffers can be VK_NULL_HANDLE, and can be used by
the vertex shader.
If a vertex input attribute is bound to a vertex input binding that is
VK_NULL_HANDLE, the values taken from memory are considered to be
zero, and missing G, B, or A components are
filled with (0,0,1).
If the bound pipeline state object was created with the
VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT dynamic state enabled
pStrides[i] specifies the byte stride between consecutive
elements within the corresponding buffer.
In this case the
from the pipeline state object is ignored.
If the bound pipeline state object was also created with the
VK_DYNAMIC_STATE_VERTEX_INPUT_EXT dynamic state enabled then
vkCmdSetVertexInputEXT can be used instead of
vkCmdBindVertexBuffers2EXT to set the stride.
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.