C Specification

With VK_EXT_device_generated_commands, the actual generation of commands as well as their execution on the device is handled as single action with:

// Provided by VK_EXT_device_generated_commands
void vkCmdExecuteGeneratedCommandsEXT(
    VkCommandBuffer                             commandBuffer,
    VkBool32                                    isPreprocessed,
    const VkGeneratedCommandsInfoEXT*           pGeneratedCommandsInfo);

Parameters

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

  • isPreprocessed represents whether the input data has already been preprocessed on the device. If it is VK_FALSE this command will implicitly trigger the preprocessing step, otherwise not.

  • pGeneratedCommandsInfo is a pointer to a VkGeneratedCommandsInfoEXT structure containing parameters affecting the generation of commands.

Description

If the VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_EXT flag was used to create the VkGeneratedCommandsInfoEXT::indirectCommandsLayout then the execution of sequences through this command may use implementation-defined ordering which is not guaranteed to be coherent using the same input data. It does not affect the order of token processing within a sequence. This is the implied ordering with VK_INDIRECT_COMMANDS_TOKEN_TYPE_DISPATCH_EXT.

After a call to vkCmdExecuteGeneratedCommandsEXT, command buffer state will become undefined according to the tokens executed. This table specifies the relationship between tokens used and state invalidation.

Table 1. Indirect Execution State Invalidation
Common Tokens States Invalidated

VK_INDIRECT_COMMANDS_TOKEN_TYPE_EXECUTION_SET_EXT

Bound shaders and pipelines

VK_INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_EXT

Push constant data

VK_INDIRECT_COMMANDS_TOKEN_TYPE_SEQUENCE_INDEX_EXT

Push constant data

VK_INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_DATA_EXT

Push data

VK_INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_DATA_SEQUENCE_INDEX_EXT

Push data

VK_INDIRECT_COMMANDS_TOKEN_TYPE_INDEX_BUFFER_EXT

Index buffer

VK_INDIRECT_COMMANDS_TOKEN_TYPE_VERTEX_BUFFER_EXT

Vertex buffer

Valid Usage
  • VUID-vkCmdExecuteGeneratedCommandsEXT-commandBuffer-11045
    commandBuffer must not be a protected command buffer

  • VUID-vkCmdExecuteGeneratedCommandsEXT-isPreprocessed-11046
    If isPreprocessed is VK_TRUE and vkGetGeneratedCommandsMemoryRequirementsEXT did not return a required size of zero then vkCmdPreprocessGeneratedCommandsEXT must have already been executed on the device before this command executes, and the preprocessing command must have used the same pGeneratedCommandsInfo content as well as the content of the input buffers it references (all except VkGeneratedCommandsInfoEXT::preprocessAddress)

  • VUID-vkCmdExecuteGeneratedCommandsEXT-isPreprocessed-11047
    If isPreprocessed is VK_TRUE then the indirectCommandsLayout member of pGeneratedCommandsInfo must have been created with the VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EXPLICIT_PREPROCESS_BIT_EXT bit set

  • VUID-vkCmdExecuteGeneratedCommandsEXT-indirectCommandsLayout-11141
    If the indirectCommandsLayout member of pGeneratedCommandsInfo was created with the VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EXPLICIT_PREPROCESS_BIT_EXT bit set, then isPreprocessed must be VK_TRUE

  • VUID-vkCmdExecuteGeneratedCommandsEXT-preprocessAddress-11142
    The contents of the preprocessAddress member of pGeneratedCommandsInfo must not have been previously used to record another vkCmdExecuteGeneratedCommandsEXT

  • VUID-vkCmdExecuteGeneratedCommandsEXT-isPreprocessed-11048
    If isPreprocessed is VK_TRUE then the bound descriptor sets and push constants must match identically with those bound during recording of the corresponding call to vkCmdPreprocessGeneratedCommandsEXT

  • VUID-vkCmdExecuteGeneratedCommandsEXT-isPreprocessed-10198
    If isPreprocessed is VK_TRUE then the conditional render state and its predicate value must match identically with the state and value set during execution of the corresponding call to vkCmdPreprocessGeneratedCommandsEXT

  • VUID-vkCmdExecuteGeneratedCommandsEXT-isPreprocessed-11049
    If isPreprocessed is VK_TRUE and the indirectCommandsLayout member of pGeneratedCommandsInfo contains a draw token, then the graphics state bound on commandBuffer must match identically with the graphics state bound on the stateCommandBuffer passed to vkCmdPreprocessGeneratedCommandsEXT

  • VUID-vkCmdExecuteGeneratedCommandsEXT-isPreprocessed-11149
    If isPreprocessed is VK_TRUE, then the queue family index of commandBuffer must be the same as the queue family index used to allocate the stateCommandBuffer passed to vkCmdPreprocessGeneratedCommandsEXT

  • VUID-vkCmdExecuteGeneratedCommandsEXT-isPreprocessed-11051
    If isPreprocessed is VK_TRUE and the indirectCommandsLayout member of pGeneratedCommandsInfo contains a dispatch token, then the compute state bound on commandBuffer must match identically with the compute state bound on the stateCommandBuffer passed to vkCmdPreprocessGeneratedCommandsEXT

  • VUID-vkCmdExecuteGeneratedCommandsEXT-isPreprocessed-11052
    If isPreprocessed is VK_TRUE and the indirectCommandsLayout member of pGeneratedCommandsInfo contains a ray tracing token, then the ray tracing state bound on commandBuffer must match identically with the ray tracing state bound on the stateCommandBuffer passed to vkCmdPreprocessGeneratedCommandsEXT

  • VUID-vkCmdExecuteGeneratedCommandsEXT-isPreprocessed-11150
    If isPreprocessed is VK_TRUE and the indirectCommandsLayout member of pGeneratedCommandsInfo contains a ray tracing token, the queue family index commandBuffer was allocated from must be the same queue family index used to allocate the stateCommandBuffer passed to vkCmdPreprocessGeneratedCommandsEXT

  • VUID-vkCmdExecuteGeneratedCommandsEXT-indirectCommandsLayout-11053
    If the token sequence of the passed VkGeneratedCommandsInfoEXT::indirectCommandsLayout contains a VK_INDIRECT_COMMANDS_TOKEN_TYPE_EXECUTION_SET_EXT token, the initial shader state of VkGeneratedCommandsInfoEXT::indirectExecutionSet must be bound on commandBuffer

  • VUID-vkCmdExecuteGeneratedCommandsEXT-indirectCommandsLayout-11004
    If indirectCommandsLayout was created with a token sequence that contained the VK_INDIRECT_COMMANDS_TOKEN_TYPE_EXECUTION_SET_EXT token and indirectExecutionSet was created using VK_INDIRECT_EXECUTION_SET_INFO_TYPE_SHADER_OBJECTS_EXT, every executed VK_INDIRECT_COMMANDS_TOKEN_TYPE_EXECUTION_SET_EXT token must bind all the shader stages set in the VkIndirectCommandsExecutionSetTokenEXT::shaderStages used to create indirectCommandsLayout

  • VUID-vkCmdExecuteGeneratedCommandsEXT-isPreprocessed-11055
    If isPreprocessed is VK_TRUE and the token sequence of the passed VkGeneratedCommandsInfoEXT::indirectCommandsLayout contains a VK_INDIRECT_COMMANDS_TOKEN_TYPE_EXECUTION_SET_EXT token, the members of VkGeneratedCommandsInfoEXT::indirectExecutionSet accessed by this command must not have been modified since the preprocess buffer was generated

  • VUID-vkCmdExecuteGeneratedCommandsEXT-indirectCommandsLayout-11056
    If the indirectCommandsLayout member of pGeneratedCommandsInfo contains a draw token, then the active render pass must not have a specified fragment density map

  • VUID-vkCmdExecuteGeneratedCommandsEXT-deviceGeneratedCommandsTransformFeedback-11057
    If deviceGeneratedCommandsTransformFeedback is not supported on device, transform feedback must not be active

  • VUID-vkCmdExecuteGeneratedCommandsEXT-indirectExecutionSet-11058
    If transform feedback is active, VkGeneratedCommandsInfoEXT::indirectExecutionSet must be VK_NULL_HANDLE

  • VUID-vkCmdExecuteGeneratedCommandsEXT-deviceGeneratedCommands-11059
    The VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT::deviceGeneratedCommands feature must be enabled

  • VUID-vkCmdExecuteGeneratedCommandsEXT-supportedIndirectCommandsShaderStages-11060
    The bound shader stages must be supported by VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT::supportedIndirectCommandsShaderStages

  • VUID-vkCmdExecuteGeneratedCommandsEXT-supportedIndirectCommandsShaderStages-11061
    Only stages specified in VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT::supportedIndirectCommandsShaderStages can be set in pGeneratedCommandsInfo->shaderStages

  • VUID-vkCmdExecuteGeneratedCommandsEXT-None-11062
    If a rendering pass is currently active, the view mask must be 0

  • VUID-vkCmdExecuteGeneratedCommandsEXT-commandBuffer-11143
    commandBuffer must not have been recorded with VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT

  • VUID-vkCmdExecuteGeneratedCommandsEXT-indirectCommandsLayout-10769
    If the indirectCommandsLayout member of pGeneratedCommandsInfo contains a draw token, this command must not be called outside a render pass instance

  • VUID-vkCmdExecuteGeneratedCommandsEXT-indirectCommandsLayout-12202
    If the indirectCommandsLayout member of pGeneratedCommandsInfo does not contain a draw token, this command must not be called inside a render pass instance

Valid Usage (Implicit)
  • VUID-vkCmdExecuteGeneratedCommandsEXT-commandBuffer-parameter
    commandBuffer must be a valid VkCommandBuffer handle

  • VUID-vkCmdExecuteGeneratedCommandsEXT-pGeneratedCommandsInfo-parameter
    pGeneratedCommandsInfo must be a valid pointer to a valid VkGeneratedCommandsInfoEXT structure

  • VUID-vkCmdExecuteGeneratedCommandsEXT-commandBuffer-recording
    commandBuffer must be in the recording state

  • VUID-vkCmdExecuteGeneratedCommandsEXT-commandBuffer-cmdpool
    The VkCommandPool that commandBuffer was allocated from must support VK_QUEUE_COMPUTE_BIT, or VK_QUEUE_GRAPHICS_BIT operations

  • VUID-vkCmdExecuteGeneratedCommandsEXT-suspended
    This command must not be called between suspended render pass instances

  • VUID-vkCmdExecuteGeneratedCommandsEXT-videocoding
    This command must only be called outside of a video coding scope

  • VUID-vkCmdExecuteGeneratedCommandsEXT-bufferlevel
    commandBuffer must be a primary VkCommandBuffer

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

Both

Outside

VK_QUEUE_COMPUTE_BIT
VK_QUEUE_GRAPHICS_BIT

Action
Indirection

Conditional Rendering

vkCmdExecuteGeneratedCommandsEXT is affected by conditional rendering

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

SPDX-License-Identifier: CC-BY-4.0