VKCREATECOMPUTEPIPEL(3)

NAME
vkCreateComputePipelines - Creates a new compute pipeline object.

C SPECIFICATION

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

PARAMETERS

device
    A handle to the device to use to create the new compute pipelines.

pipelineCache
    A handle to a pipeline cache from which the result of previous compiles may be retrieved, and to which the result of this compile may be stored.

createInfoCount
    The number of pipelines to create.

pCreateInfos
    Pointer to an array of createInfoCount VkComputePipelineCreateInfo structures defining the contents of the new pipelines.

pPipelines
    A pointer to an array to receive the handles to the new compute pipeline objects.

DESCRIPTION

vkCreateComputePipelines creates new compute pipeline objects using the device specified in device and the creation information specified in the structures pointed to by pCreateInfos and deposits the resulting handles in the array pointed to by pPipelines. The definition of VkComputePipelineCreateInfo is:

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

Create Info Details

    • sType indicates the type of this structure and must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO.

    • pNext is a pointer to an extension-specific structure (can be NULL).

    • stage is a VkPipelineShaderStageCreateInfo describing the compute shader.

    • flags controls how the driver will create the pipeline.

    • layout the description of binding locations used by both the pipeline and the descritor sets.

    • basePipelineHandle the pipeline to derive from (can be VK_NULL_HANDLE, if pipeline is not derived).

    • basePipelineIndex the index into the pCreateInfos parameter to vkCreateComputePipelines.

The parameters basePipelineHandle and basePipelineIndex are ignored unless flags has the VK_PIPELINE_CREATE_DERIVATIVE_BIT bit set. If using the basePipelineIndex parameter, the index must refer to a pCreateInfos parameter passed to vkCreateComputePipelines that appeared earlier than the current VkComputePipelineCreateInfo in the list. The parameters basePipelineHandle and basePipelineIndex are mutually exclusive. If you specify a valid basePipelineHandle, basePipelineIndex must be set to -1. If you specify a valid basePipelineIndex, basePipelineHandle must be VK_NULL_HANDLE.

VALID USAGE

    • device must be a valid VkDevice handle

    • If pipelineCache is not VK_NULL_HANDLE, pipelineCache must be a valid VkPipelineCache handle

    • pCreateInfos must be a pointer to an array of createInfoCount valid VkComputePipelineCreateInfo structures

    • If pAllocator is not NULL, pAllocator must be a pointer to a valid VkAllocationCallbacks structure

    • pPipelines must be a pointer to an array of createInfoCount VkPipeline handles

    • createInfoCount must be greater than 0

    • If pipelineCache is a valid handle, it must have been created, allocated or retrieved from device

    • Each of device and pipelineCache that are valid handles must have been created, allocated or retrieved from the same VkPhysicalDevice

    • If the flags member of any given 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

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

SEE ALSO

vkCreateGraphicsPipelines, vkCmdBindPipeline

COPYRIGHT

Copyright © 2014-2016 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.

AUTHOR

Khronos Group
    Author.