vkCreateGraphicsPipelines(3)

# vkCreateGraphicsPipelines(3) Manual Page

## Name

vkCreateGraphicsPipelines - Create graphics pipelines

Loading… please wait.

## C Specification

To create graphics pipelines, call:

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

## Parameters

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

- `pipelineCache` is either VK_NULL_HANDLE, indicating that pipeline caching is disabled, or to enable caching, the handle of a valid VkPipelineCache object. The implementation must not access this object outside of the duration of this command.

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

- `pCreateInfos` is a pointer to an array of VkGraphicsPipelineCreateInfo 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 graphics pipeline objects are returned.

## Description

The VkGraphicsPipelineCreateInfo structure includes an array of VkPipelineShaderStageCreateInfo structures for each of the desired active shader stages, as well as creation information for all relevant fixed-function stages, and a pipeline layout.

Pipelines are created and returned as described for Multiple Pipeline Creation.

Valid Usage

- VUID-vkCreateGraphicsPipelines-device-09662
  `device` must support at least one queue family with the VK_QUEUE_GRAPHICS_BIT capability

- VUID-vkCreateGraphicsPipelines-flags-00720
  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-vkCreateGraphicsPipelines-flags-00721
  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-vkCreateGraphicsPipelines-pipelineCache-02876
  If `pipelineCache` was created with VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT, host access to `pipelineCache` must be externally synchronized

- VUID-vkCreateGraphicsPipelines-pNext-09616
  If VkPipelineBinaryInfoKHR::`binaryCount` is not `0` for any element of `pCreateInfos`, `pipelineCache` must be VK_NULL_HANDLE

- VUID-vkCreateGraphicsPipelines-pNext-09617
  If a VkPipelineCreateFlags2CreateInfoKHR structure with the VK_PIPELINE_CREATE_2_CAPTURE_DATA_BIT_KHR flag set is included in the `pNext` chain of any element of `pCreateInfos`, `pipelineCache` must be VK_NULL_HANDLE

- VUID-vkCreateGraphicsPipelines-binaryCount-09620
  If VkPipelineBinaryInfoKHR::`binaryCount` is not `0` for any element of `pCreateInfos`, VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT must not be set in the `flags` of that element

- VUID-vkCreateGraphicsPipelines-binaryCount-09621
  If VkPipelineBinaryInfoKHR::`binaryCount` is not `0` for any element of `pCreateInfos`, VK_PIPELINE_CREATION_FEEDBACK_BASE_PIPELINE_ACCELERATION_BIT must not be set in the `flags` of that element

- VUID-vkCreateGraphicsPipelines-binaryCount-09622
  If VkPipelineBinaryInfoKHR::`binaryCount` is not `0` for any element of `pCreateInfos`, VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_EXT must not be set in the `flags` of that element

- VUID-vkCreateGraphicsPipelines-pCreateInfos-11414
  If any element of `pCreateInfos` sets VK_PIPELINE_CREATE_2_DESCRIPTOR_HEAP_BIT_EXT and includes embedded sampler mappings, there must be less than (`maxSamplerAllocationCount` - (`minSamplerHeapReservedRangeWithEmbedded` / `samplerDescriptorSize`)) VkSampler objects currently created on the device

- VUID-vkCreateGraphicsPipelines-pCreateInfos-11429
  If any element of `pCreateInfos` sets VK_PIPELINE_CREATE_2_DESCRIPTOR_HEAP_BIT_EXT and includes embedded sampler mappings, this command must not cause the total number of unique embedded samplers in pipelines and shaders on this device to exceed `maxDescriptorHeapEmbeddedSamplers`

Note | An implicit cache may be provided by the implementation or a layer. For this reason, it is still valid to set VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT on `flags` for any element of `pCreateInfos` while passing VK_NULL_HANDLE for `pipelineCache`.

Valid Usage (Implicit)

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

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

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

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

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

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

- VUID-vkCreateGraphicsPipelines-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_PIPELINE_COMPILE_REQUIRED_EXT

  - VK_SUCCESS

On failure, this command returns

  - VK_ERROR_INVALID_SHADER_NV

  - VK_ERROR_OUT_OF_DEVICE_MEMORY

  - VK_ERROR_OUT_OF_HOST_MEMORY

  - VK_ERROR_UNKNOWN

  - VK_ERROR_VALIDATION_FAILED

## See Also

VK_VERSION_1_0, VkAllocationCallbacks, VkDevice, VkGraphicsPipelineCreateInfo, 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 2014-2026 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0