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 the handle of a valid pipeline cache object.

  • 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.

If a pipeline creation fails due to:

the operation will continue as specified in Multiple Pipeline Creation and the command will return VK_ERROR_NO_PIPELINE_MATCH.

If VkPhysicalDeviceVulkanSC10Properties::deviceNoDynamicHostAllocations is VK_TRUE, vkCreateGraphicsPipelines must not return VK_ERROR_OUT_OF_HOST_MEMORY.

Valid Usage
  • VUID-vkCreateGraphicsPipelines-device-05068
    The number of graphics pipelines currently allocated from device plus createInfoCount must be less than or equal to the total number of graphics pipelines requested via VkDeviceObjectReservationCreateInfo::graphicsPipelineRequestCount specified when device was created

Valid Usage (Implicit)
  • VUID-vkCreateGraphicsPipelines-device-parameter
    device must be a valid VkDevice handle

  • VUID-vkCreateGraphicsPipelines-pipelineCache-parameter
    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-null
    pAllocator must be NULL

  • 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
    pipelineCache must have been created, allocated, or retrieved from device

Return Codes
On success, this command returns
  • VK_SUCCESS

On failure, this command returns
  • VK_ERROR_OUT_OF_HOST_MEMORY

  • VK_ERROR_OUT_OF_DEVICE_MEMORY

  • VK_ERROR_NO_PIPELINE_MATCH

  • VK_ERROR_OUT_OF_POOL_MEMORY

See Also

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

SPDX-License-Identifier: CC-BY-4.0