To allocate descriptor sets from a descriptor pool, call:
VkResult vkAllocateDescriptorSets( VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets);
deviceis the logical device that owns the descriptor pool.
pAllocateInfois a pointer to an instance of the VkDescriptorSetAllocateInfo structure describing parameters of the allocation.
pDescriptorSetsis a pointer to an array of
VkDescriptorSethandles in which the resulting descriptor set objects are returned. The array must be at least the length specified by the
The allocated descriptor sets are returned in
When a descriptor set is allocated, the initial state is largely uninitialized and all descriptors are undefined. However, the descriptor set can be bound in a command buffer without causing errors or exceptions. All entries that are statically used by a pipeline in a drawing or dispatching command must have been populated before the descriptor set is bound for use by that command. Entries that are not statically used by a pipeline can have uninitialized descriptors or descriptors of resources that have been destroyed, and executing a draw or dispatch with such a descriptor set bound does not cause undefined behavior. This means applications need not populate unused entries with dummy descriptors.
If an allocation fails due to fragmentation, an indeterminate error is
returned with an unspecified error code.
Any returned error other than
VK_ERROR_FRAGMENTED_POOL does not imply its usual meaning:
applications should assume that the allocation failed due to fragmentation,
and create a new descriptor pool.
Applications should check for a negative return value when allocating new
descriptor sets, assume that any error
The reason for this is that
For more information, see the Vulkan Specification at URL
This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification,not directly.
Copyright (c) 2014-2017 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.