vkCreateComputePipelines(3)

# vkCreateComputePipelines(3) Manual Page

## Name

vkCreateComputePipelines - Creates a new compute pipeline object

Loading… please wait.

## C Specification

To create compute pipelines, call:

    // Provided by VK_VERSION_1_0
    VkResult vkCreateComputePipelines(
        VkDevice                                    device,
        VkPipelineCache                             pipelineCache,
        uint32_t                                    createInfoCount,
        const VkComputePipelineCreateInfo*          pCreateInfos,
        const VkAllocationCallbacks*                pAllocator,
        VkPipeline*                                 pPipelines);

## Parameters

- `device` is the logical device that creates the compute pipelines.

- `pipelineCache` is either VK_NULL_HANDLE, indicating that pipeline caching is disabled; or the handle of a valid pipeline cache object, in which case use of that cache is enabled for the duration of the command.

- `createInfoCount` is the length of the `pCreateInfos` and `pPipelines` arrays.

- `pCreateInfos` is a pointer to an array of VkComputePipelineCreateInfo structures.

- `pAllocator` controls host memory allocation as described in the Memory Allocation chapter.

- `pPipelines` is a pointer to an array of VkPipeline handles in which the resulting compute pipeline objects are returned.

  | editing-note TODO (Jon) - Should we say something like “the i’th element of the `pPipelines` array is created based on the corresponding element of the `pCreateInfos` array”? Also for vkCreateGraphicsPipelines below.

## Description

Valid Usage

- VUID-vkCreateComputePipelines-flags-00695
  If the `flags` member of any element of `pCreateInfos` contains the `VK_PIPELINE_CREATE_DERIVATIVE_BIT` flag, and the `basePipelineIndex` member of that same element is not `-1`, `basePipelineIndex` must be less than the index into `pCreateInfos` that corresponds to that element

- VUID-vkCreateComputePipelines-flags-00696
  If the `flags` member of any element of `pCreateInfos` contains the `VK_PIPELINE_CREATE_DERIVATIVE_BIT` flag, the base pipeline must have been created with the `VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT` flag set

- VUID-vkCreateComputePipelines-pipelineCache-02873
  If `pipelineCache` was created with `VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT_EXT`, host access to `pipelineCache` must be externally synchronized

Valid Usage (Implicit)

- VUID-vkCreateComputePipelines-device-parameter
  `device` must be a valid VkDevice handle

- VUID-vkCreateComputePipelines-pipelineCache-parameter
  If `pipelineCache` is not VK_NULL_HANDLE, `pipelineCache` must be a valid VkPipelineCache handle

- VUID-vkCreateComputePipelines-pCreateInfos-parameter
  `pCreateInfos` must be a valid pointer to an array of `createInfoCount` valid VkComputePipelineCreateInfo structures

- VUID-vkCreateComputePipelines-pAllocator-parameter
  If `pAllocator` is not `NULL`, `pAllocator` must be a valid pointer to a valid VkAllocationCallbacks structure

- VUID-vkCreateComputePipelines-pPipelines-parameter
  `pPipelines` must be a valid pointer to an array of `createInfoCount` VkPipeline handles

- VUID-vkCreateComputePipelines-createInfoCount-arraylength
  `createInfoCount` must be greater than `0`

- VUID-vkCreateComputePipelines-pipelineCache-parent
  If `pipelineCache` is a valid handle, it must have been created, allocated, or retrieved from `device`

Return Codes

On success, this command returns

  - `VK_SUCCESS`

  - `VK_PIPELINE_COMPILE_REQUIRED_EXT`

On failure, this command returns

  - `VK_ERROR_OUT_OF_HOST_MEMORY`

  - `VK_ERROR_OUT_OF_DEVICE_MEMORY`

  - `VK_ERROR_INVALID_SHADER_NV`

## See Also

VkAllocationCallbacks, VkComputePipelineCreateInfo, VkDevice, VkPipeline, VkPipelineCache

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

SPDX-License-Identifier: CC-BY-4.0