# VkPipelineStageFlagBits(3) Manual Page

## Name

VkPipelineStageFlagBits - Bitmask specifying pipeline stages

## C Specification

Several of the synchronization commands include pipeline stage parameters, restricting the synchronization scopes for that command to just those stages. This allows fine grained control over the exact execution dependencies and accesses performed by action commands. Implementations should use these pipeline stages to avoid unnecessary stalls or cache flushing.

Bits which can be set, specifying pipeline stages, are:

    typedef enum VkPipelineStageFlagBits {
        VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001,
        VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002,
        VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004,
        VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008,
        VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010,
        VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020,
        VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040,
        VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080,
        VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100,
        VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200,
        VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400,
        VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800,
        VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000,
        VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000,
        VK_PIPELINE_STAGE_HOST_BIT = 0x00004000,
        VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000,
        VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000,
        VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT = 0x01000000,
        VK_PIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT = 0x00040000,
        VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR = 0x00200000,
        VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR = 0x02000000,
        VK_PIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV = 0x00400000,
        VK_PIPELINE_STAGE_TASK_SHADER_BIT_NV = 0x00080000,
        VK_PIPELINE_STAGE_MESH_SHADER_BIT_NV = 0x00100000,
        VK_PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT = 0x00800000,
        VK_PIPELINE_STAGE_COMMAND_PREPROCESS_BIT_NV = 0x00020000,
        VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_NV = VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR,
        VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_NV = VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR,
        VK_PIPELINE_STAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
    } VkPipelineStageFlagBits;

## Description

- `VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT` specifies the stage of the pipeline where any commands are initially received by the queue.

- `VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT` specifies the stage of the pipeline where Draw/DispatchIndirect data structures are consumed. This stage also includes reading commands written by vkCmdExecuteGeneratedCommandsNV.

- `VK_PIPELINE_STAGE_TASK_SHADER_BIT_NV` specifies the task shader stage.

- `VK_PIPELINE_STAGE_MESH_SHADER_BIT_NV` specifies the mesh shader stage.

- `VK_PIPELINE_STAGE_VERTEX_INPUT_BIT` specifies the stage of the pipeline where vertex and index buffers are consumed.

- `VK_PIPELINE_STAGE_VERTEX_SHADER_BIT` specifies the vertex shader stage.

- `VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT` specifies the tessellation control shader stage.

- `VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT` specifies the tessellation evaluation shader stage.

- `VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT` specifies the geometry shader stage.

- `VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT` specifies the fragment shader stage.

- `VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT` specifies the stage of the pipeline where early fragment tests (depth and stencil tests before fragment shading) are performed. This stage also includes subpass load operations for framebuffer attachments with a depth/stencil format.

- `VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT` specifies the stage of the pipeline where late fragment tests (depth and stencil tests after fragment shading) are performed. This stage also includes subpass store operations for framebuffer attachments with a depth/stencil format.

- `VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT` specifies the stage of the pipeline after blending where the final color values are output from the pipeline. This stage also includes subpass load and store operations and multisample resolve operations for framebuffer attachments with a color or depth/stencil format.

- `VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT` specifies the execution of a compute shader.

- `VK_PIPELINE_STAGE_TRANSFER_BIT` specifies the following commands:

  - All copy commands, including vkCmdCopyQueryPoolResults

  - vkCmdBlitImage

  - vkCmdResolveImage

  - All clear commands, with the exception of vkCmdClearAttachments

- `VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT` specifies the final stage in the pipeline where operations generated by all commands complete execution.

- `VK_PIPELINE_STAGE_HOST_BIT` specifies a pseudo-stage indicating execution on the host of reads/writes of device memory. This stage is not invoked by any commands recorded in a command buffer.

- `VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR` specifies the execution of the ray tracing shader stages.

- `VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR` specifies the execution of vkCmdBuildAccelerationStructureKHR, vkCmdCopyAccelerationStructureKHR, and vkCmdWriteAccelerationStructuresPropertiesKHR.

- `VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT` specifies the execution of all graphics pipeline stages, and is equivalent to the logical OR of:

  - `VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT`

  - `VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT`

  - `VK_PIPELINE_STAGE_TASK_SHADER_BIT_NV`

  - `VK_PIPELINE_STAGE_MESH_SHADER_BIT_NV`

  - `VK_PIPELINE_STAGE_VERTEX_INPUT_BIT`

  - `VK_PIPELINE_STAGE_VERTEX_SHADER_BIT`

  - `VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT`

  - `VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT`

  - `VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT`

  - `VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT`

  - `VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT`

  - `VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT`

  - `VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT`

  - `VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT`

  - `VK_PIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT`

  - `VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT`

  - `VK_PIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV`

  - `VK_PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT`

- `VK_PIPELINE_STAGE_ALL_COMMANDS_BIT` is equivalent to the logical OR of every other pipeline stage flag that is supported on the queue it is used with.

- `VK_PIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT` specifies the stage of the pipeline where the predicate of conditional rendering is consumed.

- `VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT` specifies the stage of the pipeline where vertex attribute output values are written to the transform feedback buffers.

- `VK_PIPELINE_STAGE_COMMAND_PREPROCESS_BIT_NV` specifies the stage of the pipeline where device-side preprocessing for generated commands via vkCmdPreprocessGeneratedCommandsNV is handled.

- `VK_PIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV` specifies the stage of the pipeline where the shading rate image is read to determine the shading rate for portions of a rasterized primitive.

- `VK_PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT` specifies the stage of the pipeline where the fragment density map is read to generate the fragment areas.

| Note An execution dependency with only `VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT` in the destination stage mask will only prevent that stage from executing in subsequently submitted commands. As this stage does not perform any actual execution, this is not observable - in effect, it does not delay processing of subsequent commands. Similarly an execution dependency with only `VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT` in the source stage mask will effectively not wait for any prior commands to complete. When defining a memory dependency, using only `VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT` or `VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT` would never make any accesses available and/or visible because these stages do not access memory. `VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT` and `VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT` are useful for accomplishing layout transitions and queue ownership operations when the required execution dependency is satisfied by other means - for example, semaphore operations between queues.

## See Also

VkCheckpointDataNV, VkPipelineStageFlags, vkCmdWriteBufferMarkerAMD, vkCmdWriteTimestamp

## 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 (c) 2014-2020 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.