vkCmdSetVertexInputEXT(3)

# vkCmdSetVertexInputEXT(3) Manual Page

## Name

vkCmdSetVertexInputEXT - Set the vertex input state dynamically for a command buffer

Loading… please wait.

## C Specification

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

    // Provided by VK_EXT_shader_object, 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 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-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

- 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

Command Properties

Command Buffer Levels | Render Pass Scope | Video Coding Scope | Supported Queue Types | Command Type
--- | --- | --- | --- | ---
Primary Secondary | Both | Outside | Graphics | State

## See Also

VK_EXT_shader_object, VK_EXT_vertex_input_dynamic_state, VkCommandBuffer, VkVertexInputAttributeDescription2EXT, VkVertexInputBindingDescription2EXT

## 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

Copyright 2014-2023 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0