Creating a descriptor pool
Descriptors, gathered into sets, are allocated from descriptor pools. When we create a pool, we must define which descriptors, and how many of them, can be allocated from the created pool.
How to do it...
- Take the handle of a logical device on which the descriptor pool should be created. Store it in a variable of type
VkDevice
namedlogical_device
. - Create a vector variable named
descriptor_types
with elements of typeVkDescriptorPoolSize
. For each type of descriptor that will be allocated from the pool, add a new element to thedescriptor_types
variable defining the specified type of descriptor and the number of descriptors of a given type that will be allocated from the pool. - Create a variable of type
VkDescriptorPoolCreateInfo
nameddescriptor_pool_create_info
. Use the following values for members of this variable:VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
value forsType
nullptr
value forpNext
VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT
value if it should...