Descriptor sets gather shader resources (descriptors) in one container object. Its contents, types, and number of resources are defined by a descriptor set layout; storage is taken from pools, from which we can allocate descriptor sets.
Allocating descriptor sets
How to do it...
- Take the logical device and store its handle in a variable of type VkDevice named logical_device.
- Prepare a descriptor pool from which descriptor sets should be allocated. Use the pool's handle to initialize a variable of type VkDescriptorPool named descriptor_pool.
- Create a variable of type std::vector<VkDescriptorSetLayout> named descriptor_set_layouts. For each descriptor set that should be allocated from the pool, add a handle of a descriptor set layout that defines the structure...