# VkComputePipelineCreateInfo(3) Manual Page

## Name

VkComputePipelineCreateInfo - Structure specifying parameters of a newly created compute pipeline

Loading… please wait.

## C Specification

The `VkComputePipelineCreateInfo` structure is defined as:

    // Provided by VK_VERSION_1_0
    typedef struct VkComputePipelineCreateInfo {
        VkStructureType                    sType;
        const void*                        pNext;
        VkPipelineCreateFlags              flags;
        VkPipelineShaderStageCreateInfo    stage;
        VkPipelineLayout                   layout;
        VkPipeline                         basePipelineHandle;
        int32_t                            basePipelineIndex;
    } VkComputePipelineCreateInfo;

## Members

- `sType` is a VkStructureType value identifying this structure.

- `pNext` is `NULL` or a pointer to a structure extending this structure.

- `flags` is a bitmask of VkPipelineCreateFlagBits specifying how the pipeline will be generated.

- `stage` is a VkPipelineShaderStageCreateInfo structure describing the compute shader.

- `layout` is the description of binding locations used by both the pipeline and descriptor sets used with the pipeline.

- `basePipelineHandle` is a pipeline to derive from.

- `basePipelineIndex` is an index into the `pCreateInfos` parameter to use as a pipeline to derive from.

## Description

The parameters `basePipelineHandle` and `basePipelineIndex` are described in more detail in Pipeline Derivatives.

If the `pNext` chain includes a VkPipelineCreateFlags2CreateInfo structure, VkPipelineCreateFlags2CreateInfo::`flags` from that structure is used instead of `flags` from this structure.

Valid Usage

- VUID-VkComputePipelineCreateInfo-None-09497
  If the `pNext` chain does not include a VkPipelineCreateFlags2CreateInfo structure, `flags` must be a valid combination of VkPipelineCreateFlagBits values

- VUID-VkComputePipelineCreateInfo-flags-07984
  If `flags` contains the `VK_PIPELINE_CREATE_DERIVATIVE_BIT` flag, and `basePipelineIndex` is -1, `basePipelineHandle` must be a valid compute `VkPipeline` handle

- VUID-VkComputePipelineCreateInfo-flags-07985
  If `flags` contains the `VK_PIPELINE_CREATE_DERIVATIVE_BIT` flag, and `basePipelineHandle` is VK_NULL_HANDLE, `basePipelineIndex` must be a valid index into the calling command’s `pCreateInfos` parameter

- VUID-VkComputePipelineCreateInfo-flags-07986
  If `flags` contains the `VK_PIPELINE_CREATE_DERIVATIVE_BIT` flag, `basePipelineIndex` must be -1 or `basePipelineHandle` must be VK_NULL_HANDLE

- VUID-VkComputePipelineCreateInfo-layout-07987
  If a push constant block is declared in a shader, a push constant range in `layout` must match the shader stage

- VUID-VkComputePipelineCreateInfo-layout-10069
  If a push constant block is declared in a shader, the block must be contained inside the push constant range in `layout` that matches the stage

- VUID-VkComputePipelineCreateInfo-layout-07988
  If a resource variables is declared in a shader, a descriptor slot in `layout` must match the shader stage

- VUID-VkComputePipelineCreateInfo-layout-07990
  If a resource variables is declared in a shader, and the descriptor type is not `VK_DESCRIPTOR_TYPE_MUTABLE_EXT`, a descriptor slot in `layout` must match the descriptor type

- VUID-VkComputePipelineCreateInfo-layout-07991
  If a resource variables is declared in a shader as an array, a descriptor slot in `layout` must match the descriptor count

- VUID-VkComputePipelineCreateInfo-flags-03365
  `flags` must not include `VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR`

- VUID-VkComputePipelineCreateInfo-flags-03366
  `flags` must not include `VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR`

- VUID-VkComputePipelineCreateInfo-flags-03367
  `flags` must not include `VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR`

- VUID-VkComputePipelineCreateInfo-flags-03368
  `flags` must not include `VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR`

- VUID-VkComputePipelineCreateInfo-flags-03369
  `flags` must not include `VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR`

- VUID-VkComputePipelineCreateInfo-flags-03370
  `flags` must not include `VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR`

- VUID-VkComputePipelineCreateInfo-flags-03576
  `flags` must not include `VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR`

- VUID-VkComputePipelineCreateInfo-flags-04945
  `flags` must not include `VK_PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV`

- VUID-VkComputePipelineCreateInfo-flags-09007
  If the `VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV`::`deviceGeneratedComputePipelines` feature is not enabled, `flags` must not include `VK_PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV`

- VUID-VkComputePipelineCreateInfo-flags-09008
  If `flags` includes `VK_PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV`, then the `pNext` chain must include a pointer to a valid instance of VkComputePipelineIndirectBufferInfoNV specifying the address where the pipeline’s metadata will be saved

- VUID-VkComputePipelineCreateInfo-flags-11007
  If `flags` includes `VK_PIPELINE_CREATE_2_INDIRECT_BINDABLE_BIT_EXT`, then the `VkPhysicalDeviceDeviceGeneratedCommandsFeaturesEXT`::`deviceGeneratedCommands` feature must be enabled

- VUID-VkComputePipelineCreateInfo-pipelineCreationCacheControl-02875
  If the `pipelineCreationCacheControl` feature is not enabled, `flags` must not include `VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT` or `VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT`

- VUID-VkComputePipelineCreateInfo-stage-00701
  The `stage` member of `stage` must be `VK_SHADER_STAGE_COMPUTE_BIT`

- VUID-VkComputePipelineCreateInfo-stage-00702
  The shader code for the entry point identified by `stage` and the rest of the state identified by this structure must adhere to the pipeline linking rules described in the Shader Interfaces chapter

- VUID-VkComputePipelineCreateInfo-layout-01687
  The number of resources in `layout` accessible to the compute shader stage must be less than or equal to `VkPhysicalDeviceLimits`::`maxPerStageResources`

- VUID-VkComputePipelineCreateInfo-shaderEnqueue-09177
  If the `shaderEnqueue` feature is not enabled, `flags` must not include `VK_PIPELINE_CREATE_LIBRARY_BIT_KHR`

- VUID-VkComputePipelineCreateInfo-flags-09178
  If `flags` does not include `VK_PIPELINE_CREATE_LIBRARY_BIT_KHR`, the shader specified by `stage` must not declare the `ShaderEnqueueAMDX` capability

- VUID-VkComputePipelineCreateInfo-pipelineStageCreationFeedbackCount-06566
  If VkPipelineCreationFeedbackCreateInfo::`pipelineStageCreationFeedbackCount` is not `0`, it must be `1`

- VUID-VkComputePipelineCreateInfo-flags-07367
  `flags` must not include `VK_PIPELINE_CREATE_RAY_TRACING_OPACITY_MICROMAP_BIT_EXT`

- VUID-VkComputePipelineCreateInfo-flags-07996
  `flags` must not include `VK_PIPELINE_CREATE_RAY_TRACING_DISPLACEMENT_MICROMAP_BIT_NV`

Valid Usage (Implicit)

- VUID-VkComputePipelineCreateInfo-sType-sType
  `sType` must be `VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO`

- VUID-VkComputePipelineCreateInfo-pNext-pNext
  Each `pNext` member of any structure (including this one) in the `pNext` chain must be either `NULL` or a pointer to a valid instance of VkComputePipelineIndirectBufferInfoNV, VkPipelineBinaryInfoKHR, VkPipelineCompilerControlCreateInfoAMD, VkPipelineCreateFlags2CreateInfo, VkPipelineCreationFeedbackCreateInfo, VkPipelineRobustnessCreateInfo, or VkSubpassShadingPipelineCreateInfoHUAWEI

- VUID-VkComputePipelineCreateInfo-sType-unique
  The `sType` value of each struct in the `pNext` chain must be unique

- VUID-VkComputePipelineCreateInfo-stage-parameter
  `stage` must be a valid VkPipelineShaderStageCreateInfo structure

- VUID-VkComputePipelineCreateInfo-layout-parameter
  `layout` must be a valid VkPipelineLayout handle

- VUID-VkComputePipelineCreateInfo-commonparent
  Both of `basePipelineHandle`, and `layout` that are valid handles of non-ignored parameters must have been created, allocated, or retrieved from the same VkDevice

## See Also

VK_VERSION_1_0, VkPipeline, VkPipelineCreateFlags, VkPipelineLayout, VkPipelineShaderStageCreateInfo, VkStructureType, vkCreateComputePipelines, vkGetPipelineIndirectMemoryRequirementsNV

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

SPDX-License-Identifier: CC-BY-4.0