VKCREATEDESCRIPTORPO(3)

NAME
vkCreateDescriptorPool - Creates a descriptor pool object.

C SPECIFICATION

    VkResult vkCreateDescriptorPool(
        VkDevice                                    device,
        const VkDescriptorPoolCreateInfo*           pCreateInfo,
        const VkAllocationCallbacks*                pAllocator,
        VkDescriptorPool*                           pDescriptorPool);

PARAMETERS

device
    Logical device which will own the new descriptor pool object.

pCreateInfo
    A pointer to a structure containing parameters of the new pool object.

pDescriptorPool
    Pointer to a variable which will receive a handle to the new descriptor pool object.

DESCRIPTION

vkCreateDescriptorPool creates a new descriptor pool object using device. Descriptor sets may be allocated from the resulting descriptor pool object by calling vkAllocateDescriptorSets. pCreateInfo is a pointer to an insance of the VkDescriptorPoolCreateInfo structure containing parameters describing the new pool object. The definition of VkDescriptorPoolCreateInfo is:

    typedef struct VkDescriptorPoolCreateInfo {
        VkStructureType                sType;
        const void*                    pNext;
        VkDescriptorPoolCreateFlags    flags;
        uint32_t                       maxSets;
        uint32_t                       poolSizeCount;
        const VkDescriptorPoolSize*    pPoolSizes;
    } VkDescriptorPoolCreateInfo;

The sType member of the pCreateInfo structure should be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO. The pNext member is reserved for use by extensions and should be set to NULL.

The flags member of VkDescriptorPoolCreateInfo is a set of flags describing the intended usage of the pool and is formed from members of the VkDescriptorPoolCreateFlagBits enumeration, the definition of which is:

    typedef enum VkDescriptorPoolCreateFlagBits {
        VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001,
    } VkDescriptorPoolCreateFlagBits;

If VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT is set in flags then descriptor sets allocated from the pool may be returned to the pool by calling vkFreeDescriptorSets. If this flag is clear then individual sets allocated from the pool may not be returned to the pool and are considered allocated until vkResetDescriptorPool is called on the pool object.

The maxSets member specifies the maximum number of descriptor sets that will be allocated from the pool. pPoolSizes is a pointer to an array of poolSizeCount VkDescriptorPoolSize structures, each describing a type of descriptor and the number of that type of descriptor to be included in the pool. The definition of the VkDescriptorPoolSize structure is:

    typedef struct VkDescriptorPoolSize {
        VkDescriptorType    type;
        uint32_t            descriptorCount;
    } VkDescriptorPoolSize;

Each element of the pPoolSizes array specifies a type of descriptor in type and the count of that type of descriptor in descriptorCount. The type member must be a member of the VkDescriptorType enumeration, the definition of which is:

    typedef enum VkDescriptorType {
        VK_DESCRIPTOR_TYPE_SAMPLER = 0,
        VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 1,
        VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 2,
        VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 3,
        VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 4,
        VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 5,
        VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 6,
        VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 7,
        VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 8,
        VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 9,
        VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 10,
    } VkDescriptorType;

Upon success, a handle to the newly created descriptor pool is placed in the variable whose address is specified in pDescriptorPool.

VALID USAGE

    • device must be a valid VkDevice handle

    • pCreateInfo must be a pointer to a valid VkDescriptorPoolCreateInfo structure

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

    • pDescriptorPool must be a pointer to a VkDescriptorPool handle

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

vkAllocateDescriptorSets, vkFreeDescriptorSets, vkResetDescriptorPool, vkDestroyDescriptorPool

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.