Function Prototype

vkCmdSetVertexInputEXT

Set the vertex input state dynamically for a command buffer
primary / secondary
both
graphics
state

To dynamically set the vertex input attribute and vertex input binding descriptions, call:

void vkCmdSetVertexInputEXT(
    VkCommandBuffer commandBuffer,
    uint32_t vertexBindingDescriptionCount,
    const VkVertexInputBindingDescription2EXT* pVertexBindingDescriptions,
    uint32_t vertexAttributeDescriptionCount,
    const VkVertexInputAttributeDescription2EXT* pVertexAttributeDescriptions);
  • commandBuffer is the command buffer into which the command will be recorded.
  • vertexBindingDescriptionCount is the number of vertex binding descriptions provided in pVertexBindingDescriptions.
  • pVertexBindingDescriptions is a pointer to an array of VkVertexInputBindingDescription2EXT structures.
  • vertexAttributeDescriptionCount is the number of vertex attribute descriptions provided in pVertexAttributeDescriptions.
  • pVertexAttributeDescriptions is a pointer to an array of VkVertexInputAttributeDescription2EXT structures.

This command sets the vertex input attribute and vertex input binding descriptions state for subsequent drawing commands when drawing using shader objects, or when the graphics pipeline is created with VK_DYNAMIC_STATE_VERTEX_INPUT_EXT set in VkPipelineDynamicStateCreateInfo::pDynamicStates. Otherwise, this state is specified by the VkGraphicsPipelineCreateInfo::pVertexInputState values used to create the currently active pipeline.

If drawing using shader objects, or if the bound pipeline state object was also created with the VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE dynamic state enabled, then vkCmdBindVertexBuffers2 can be used instead of vkCmdSetVertexInputEXT to dynamically set the stride.

Valid Usage

VUID-vkCmdSetVertexInputEXT-None-08546

Either the vertexInputDynamicState feature or the shaderObject feature or both must be enabled

VUID-vkCmdSetVertexInputEXT-vertexBindingDescriptionCount-04791

vertexBindingDescriptionCount must be less than or equal to VkPhysicalDeviceLimits::maxVertexInputBindings

VUID-vkCmdSetVertexInputEXT-vertexAttributeDescriptionCount-04792

vertexAttributeDescriptionCount must be less than or equal to VkPhysicalDeviceLimits::maxVertexInputAttributes

VUID-vkCmdSetVertexInputEXT-binding-04793

For every binding specified by each element of pVertexAttributeDescriptions, a VkVertexInputBindingDescription2EXT must exist in pVertexBindingDescriptions with the same value of binding

VUID-vkCmdSetVertexInputEXT-pVertexBindingDescriptions-04794

All elements of pVertexBindingDescriptions must describe distinct binding numbers

VUID-vkCmdSetVertexInputEXT-pVertexAttributeDescriptions-04795

All elements of pVertexAttributeDescriptions must describe distinct attribute locations

Valid Usage (Implicit)

VUID-vkCmdSetVertexInputEXT-pVertexBindingDescriptions-parameter

If vertexBindingDescriptionCount is not 0, pVertexBindingDescriptions must be a valid pointer to an array of vertexBindingDescriptionCount valid VkVertexInputBindingDescription2EXT structures

VUID-vkCmdSetVertexInputEXT-pVertexAttributeDescriptions-parameter

If vertexAttributeDescriptionCount is not 0, pVertexAttributeDescriptions must be a valid pointer to an array of vertexAttributeDescriptionCount valid VkVertexInputAttributeDescription2EXT structures

VUID-vkCmdSetVertexInputEXT-commandBuffer-cmdpool

The VkCommandPool that commandBuffer was allocated from must support graphics operations

VUID-vkCmdSetVertexInputEXT-videocoding

This command must only be called outside of a video coding scope

Host Synchronization

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