April 2017
Intermediate to advanced
700 pages
21h 36m
English
Freeing a descriptor set releases memory used by it and gives it back to the pool. It should be possible to allocate another set of the same type from the pool but it may not be possible due to the pool's memory fragmentation (in such a situation, we may need to create another pool or reset the one from which the set was allocated).
We can free multiple descriptor sets at once, but all of them must come from the same pool. It is done like this:
VkResult result = vkFreeDescriptorSets( logical_device, descriptor_pool, static_cast<uint32_t>(descriptor_sets.size()), descriptor_sets.data() ); if( VK_SUCCESS != result ) { std::cout << "Error occurred during freeing descriptor sets." << std::endl; return false; } descriptor_sets.clear(); ...Read now
Unlock full access