Loading... please wait.

C Specification

Alternatively, to bind vertex buffers, along with their sizes and strides, to a command buffer for use in subsequent draw 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);

Parameters

  • commandBuffer is the command buffer into which the command is recorded.

  • firstBinding is the index of the first vertex input binding whose state is updated by the command.

  • bindingCount is the number of vertex input bindings whose state is updated by the command.

  • pBuffers is a pointer to an array of buffer handles.

  • pOffsets is a pointer to an array of buffer offsets.

  • pSizes is optional, and when not NULL is a pointer to an array of buffer sizes.

  • pStrides is optional, and when not NULL is a pointer to an array of buffer strides.

Description

The values taken from elements i of pBuffers and pOffsets replace the current state for the vertex input binding firstBinding + i, for i in [0, bindingCount). The vertex input binding is updated to start at the offset indicated by pOffsets[i] from the start of the buffer pBuffers[i] If pSizes is not NULL then pSizes[i] specifies the bound size of the corresponding vertex buffer. All vertex input attributes that use each of these bindings will use these updated addresses in their address calculations for subsequent draw commands.

If the bound pipeline state object was created with the VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT dynamic state enabled then pStrides[i] specifies the distance in bytes between two consecutive elements within the corresponding buffer. In this case the VkVertexInputBindingDescription::stride state from the pipeline state object is ignored.

Valid Usage
  • firstBinding must be less than VkPhysicalDeviceLimits::maxVertexInputBindings

  • The sum of firstBinding and bindingCount must be less than or equal to VkPhysicalDeviceLimits::maxVertexInputBindings

  • All elements of pOffsets must be less than the size of the corresponding element in pBuffers

  • If pSizes is not NULL, all elements of pOffsets plus pSizes must be less than or equal to the size of the corresponding element in pBuffers

  • All elements of pBuffers must have been created with the VK_BUFFER_USAGE_VERTEX_BUFFER_BIT flag

  • Each element of pBuffers that is non-sparse must be bound completely and contiguously to a single VkDeviceMemory object

  • If the nullDescriptor feature is not enabled, all elements of pBuffers must not be VK_NULL_HANDLE

  • If an element of pBuffers is VK_NULL_HANDLE, then the corresponding element of pOffsets must be zero

  • If the bound pipeline state object was created with the VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT dynamic state enabled then pStrides must not be NULL, otherwise pStrides must be NULL

  • If pStrides is not NULL each element of pStrides must be less than or equal to VkPhysicalDeviceLimits::maxVertexInputBindingStride

  • If pStrides is not NULL each element of pStrides must be greater than or equal to the maximum extent of of all vertex input attributes fetched from the corresponding binding, where the extent is calculated as the VkVertexInputAttributeDescription::offset plus VkVertexInputAttributeDescription::format size

Valid Usage (Implicit)
  • commandBuffer must be a valid VkCommandBuffer handle

  • pBuffers must be a valid pointer to an array of bindingCount valid VkBuffer handles

  • pOffsets must be a valid pointer to an array of bindingCount VkDeviceSize values

  • If pSizes is not NULL, pSizes must be a valid pointer to an array of bindingCount VkDeviceSize values

  • If pStrides is not NULL, pStrides must be a valid pointer to an array of bindingCount VkDeviceSize values

  • commandBuffer must be in the recording state

  • The VkCommandPool that commandBuffer was allocated from must support graphics operations

  • If any of pSizes, or pStrides are not NULL, bindingCount must be greater than 0

  • Both of commandBuffer, and the elements of pBuffers must have been created, allocated, or retrieved from the same VkDevice

Host Synchronization
  • Host access to commandBuffer must be externally synchronized

  • Host access to the VkCommandPool that commandBuffer was allocated from must be externally synchronized

Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type

Primary
Secondary

Both

Graphics

See Also

VkBuffer, VkCommandBuffer, VkDeviceSize

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.

Copyright (c) 2014-2020 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0