C Specification

An alternative to specifying the vertex input attribute and vertex input binding descriptions as part of graphics pipeline creation, the pipeline can be created with the VK_DYNAMIC_STATE_VERTEX_INPUT_EXT dynamic state enabled, and for that state to be set dynamically with:

// Provided by VK_EXT_vertex_input_dynamic_state
void vkCmdSetVertexInputEXT(
    VkCommandBuffer                             commandBuffer,
    uint32_t                                    vertexBindingDescriptionCount,
    const VkVertexInputBindingDescription2EXT*  pVertexBindingDescriptions,
    uint32_t                                    vertexAttributeDescriptionCount,
    const VkVertexInputAttributeDescription2EXT* pVertexAttributeDescriptions);

Parameters

  • 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.

Description

This command sets the vertex input attribute and vertex input binding descriptions state for subsequent drawing commands.

Valid Usage
  • VUID-vkCmdSetVertexInputEXT-None-04790
    The vertexInputDynamicState feature 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-commandBuffer-parameter
    commandBuffer must be a valid VkCommandBuffer handle

  • 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-recording
    commandBuffer must be in the recording state

  • VUID-vkCmdSetVertexInputEXT-commandBuffer-cmdpool
    The VkCommandPool that commandBuffer was allocated from must support graphics operations

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

Primary
Secondary

Both

Graphics

See Also

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 2014-2021 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0