VKALLOCATEDESCRIPTOR(3)

NAME
vkAllocateDescriptorSets - Allocate one or more descriptor sets.

C SPECIFICATION

    VkResult vkAllocateDescriptorSets(
        VkDevice                                    device,
        const VkDescriptorSetAllocateInfo*          pAllocateInfo,
        VkDescriptorSet*                            pDescriptorSets);

PARAMETERS

device
    The device that will create the descriptor sets.

pAllocateInfo
    A pointer to a structure containing information about the sets to allocate.

pDescriptorSets
    An array of variables that will receive the handles to the newly created descriptor sets.

DESCRIPTION

vkAllocateDescriptorSets allocates one or more descriptor sets using information contained in the structure pointed to by pAllocateInfo. pAllocateInfo is an instance of the VkDescriptorSetAllocateInfo structure, the definition of which is:

    typedef struct VkDescriptorSetAllocateInfo {
        VkStructureType                 sType;
        const void*                     pNext;
        VkDescriptorPool                descriptorPool;
        uint32_t                        descriptorSetCount;
        const VkDescriptorSetLayout*    pSetLayouts;
    } VkDescriptorSetAllocateInfo;

The sType member of VkDescriptorSetAllocateInfo must be set to VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO. The pNext member is reserved for use by extensions and should be set to NULL.

The requested sets are allocated from the descriptor pool specified by descriptorPool. descriptorPool and the resulting descriptor sets must be owned by the device specified in device.

setLayoutCount specifies the number of sets to allocate. pSetLayouts is an array of setLayoutCount VkDescriptorSetLayout object handles which describe the layouts of each of the sets. On success, setLayoutCount descriptor set handles will be allocated and placed in the pDescriptorSets array.

VALID USAGE

    • device must be a valid VkDevice handle

    • pAllocateInfo must be a pointer to a valid VkDescriptorSetAllocateInfo structure

    • pDescriptorSets must be a pointer to an array of pAllocateInfo→descriptorSetCount VkDescriptorSet handles

HOST SYNCHRONIZATION

    • Host access to pAllocateInfo→descriptorPool must be externally synchronized

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

vkFreeDescriptorSets, vkUpdateDescriptorSets, vkCreateDescriptorPool, vkCreateDescriptorSetLayout

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.