vkCmdPreprocessGeneratedCommandsEXT(3)

# vkCmdPreprocessGeneratedCommandsEXT(3) Manual Page

## Name

vkCmdPreprocessGeneratedCommandsEXT - Performs preprocessing for generated commands

## C Specification

Commands can be preprocessed prior execution using the following command:

    // Provided by VK_EXT_device_generated_commands
    void vkCmdPreprocessGeneratedCommandsEXT(
        VkCommandBuffer                             commandBuffer,
        const VkGeneratedCommandsInfoEXT*           pGeneratedCommandsInfo,
        VkCommandBuffer                             stateCommandBuffer);

## Parameters

- `commandBuffer` is the command buffer which does the preprocessing.

- `pGeneratedCommandsInfo` is a pointer to a VkGeneratedCommandsInfoEXT structure containing parameters affecting the preprocessing step.

- `stateCommandBuffer` is a command buffer from which to snapshot current states affecting the preprocessing step. When a graphics command action token is used, graphics state is snapshotted. When a compute action command token is used, compute state is snapshotted. When a ray tracing action command token is used, ray tracing state is snapshotted. It can be deleted at any time after this command has been recorded.

## Description

Note | `stateCommandBuffer` access is not synchronized by the driver, meaning that this command buffer must not be modified between threads in an unsafe manner.

Valid Usage

- VUID-vkCmdPreprocessGeneratedCommandsEXT-commandBuffer-11081
  `commandBuffer` must not be a protected command buffer

- VUID-vkCmdPreprocessGeneratedCommandsEXT-pGeneratedCommandsInfo-11082
  `pGeneratedCommandsInfo`’s `indirectCommandsLayout` must have been created with the VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EXPLICIT_PREPROCESS_BIT_EXT bit set

- VUID-vkCmdPreprocessGeneratedCommandsEXT-indirectCommandsLayout-11084
  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 `stateCommandBuffer`

- VUID-vkCmdPreprocessGeneratedCommandsEXT-stateCommandBuffer-11138
  `stateCommandBuffer` must be in the recording state

- VUID-vkCmdPreprocessGeneratedCommandsEXT-deviceGeneratedCommands-11087
  The `VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT`::`deviceGeneratedCommands` feature must be enabled

- VUID-vkCmdPreprocessGeneratedCommandsEXT-supportedIndirectCommandsShaderStages-11088
  Only stages specified in VkPhysicalDeviceDeviceGeneratedCommandsPropertiesEXT::`supportedIndirectCommandsShaderStages` can be set in `pGeneratedCommandsInfo->shaderStages`

Valid Usage (Implicit)

- VUID-vkCmdPreprocessGeneratedCommandsEXT-commandBuffer-parameter
  `commandBuffer` must be a valid VkCommandBuffer handle

- VUID-vkCmdPreprocessGeneratedCommandsEXT-pGeneratedCommandsInfo-parameter
  `pGeneratedCommandsInfo` must be a valid pointer to a valid VkGeneratedCommandsInfoEXT structure

- VUID-vkCmdPreprocessGeneratedCommandsEXT-stateCommandBuffer-parameter
  `stateCommandBuffer` must be a valid VkCommandBuffer handle

- VUID-vkCmdPreprocessGeneratedCommandsEXT-commandBuffer-recording
  `commandBuffer` must be in the recording state

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

- VUID-vkCmdPreprocessGeneratedCommandsEXT-renderpass
  This command must only be called outside of a render pass instance

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

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

- VUID-vkCmdPreprocessGeneratedCommandsEXT-bufferlevel
  `commandBuffer` must be a primary `VkCommandBuffer`

- VUID-vkCmdPreprocessGeneratedCommandsEXT-commonparent
  Both of `commandBuffer`, and `stateCommandBuffer` must have been created, allocated, or retrieved from the same VkDevice

Host Synchronization

- Host access to `commandBuffer` must be externally synchronized

- Host access to `stateCommandBuffer` 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 | Outside | Outside | VK_QUEUE_COMPUTE_BIT VK_QUEUE_GRAPHICS_BIT | Action

Conditional Rendering

vkCmdPreprocessGeneratedCommandsEXT is not affected by conditional rendering

## See Also

VK_EXT_device_generated_commands, VkCommandBuffer, VkGeneratedCommandsInfoEXT

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

SPDX-License-Identifier: CC-BY-4.0