To allocate descriptor sets from a descriptor pool, call:
// Provided by VK_VERSION_1_0
const VkDescriptorSetAllocateInfo* pAllocateInfo,
The allocated descriptor sets are returned in
When a descriptor set is allocated, the initial state is largely
uninitialized and all descriptors are undefined, with the exception that
samplers with a non-null
pImmutableSamplers are initialized on
Descriptors also become undefined if the underlying resource or view object
Descriptor sets containing undefined descriptors can still be bound and
used, subject to the following conditions:
For descriptor set bindings created with the
VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BITbit set, all descriptors in that binding that are dynamically used must have been populated before the descriptor set is consumed.
For descriptor set bindings created without the
VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BITbit set, all descriptors in that binding that are statically used must have been populated before the descriptor set is consumed.
Entries that are not used by a pipeline can have undefined descriptors.
If a call to
vkAllocateDescriptorSets would cause the total number of
descriptor sets allocated from the pool to exceed the value of
maxSets used to create
pAllocateInfo->descriptorPool, then the allocation may fail due to
lack of space in the descriptor pool.
Similarly, the allocation may fail due to lack of space if the call to
vkAllocateDescriptorSets would cause the number of any given
descriptor type to exceed the sum of all the
of each element of VkDescriptorPoolCreateInfo::
pPoolSizes with a
type equal to that type.
If the allocation fails due to no more space in the descriptor pool, and not
because of system or device memory exhaustion, then
VK_ERROR_OUT_OF_POOL_MEMORY must be returned.
vkAllocateDescriptorSets can be used to create multiple descriptor
If the creation of any of those descriptor sets fails, then the
implementation must destroy all successfully created descriptor set objects
from this command, set all entries of the
pDescriptorSets array to
VK_NULL_HANDLE and return the error.
vkAllocateDescriptorSets must not return
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.