Allocate multiple descriptor sets at once.
542{
543 if (layouts.empty()) {
545 "Allocating zero descriptor sets");
546 return {};
547 }
548
551 "No descriptor pools available - call initialize() first");
552 return {};
553 }
554
555 vk::DescriptorSetAllocateInfo alloc_info;
557 alloc_info.descriptorSetCount = static_cast<uint32_t>(layouts.size());
558 alloc_info.pSetLayouts = layouts.data();
559
560 std::vector<vk::DescriptorSet> sets;
561 try {
562 sets = device.allocateDescriptorSets(alloc_info);
564 } catch (const vk::OutOfPoolMemoryError&) {
567
569 return {};
570 }
571
573 try {
574 sets = device.allocateDescriptorSets(alloc_info);
576 } catch (const vk::SystemError& e) {
578 "Failed to allocate descriptor sets after pool growth: {}", e.what());
579 return {};
580 }
581 } catch (const vk::SystemError& e) {
583 "Failed to allocate descriptor sets: {}", e.what());
584 return {};
585 }
586
588 "Allocated {} descriptor sets (total: {}/{})",
590
591 return sets;
592}
#define MF_ERROR(comp, ctx,...)
#define MF_WARN(comp, ctx,...)
#define MF_DEBUG(comp, ctx,...)
uint32_t m_allocated_count
Total allocated sets.
uint32_t m_pool_capacity
Total capacity across all pools.
bool grow_pools(vk::Device device)
Grow pool capacity by allocating new pool.
size_t m_current_pool_index
std::vector< vk::DescriptorPool > m_pools
@ GraphicsBackend
Graphics/visual rendering backend (Vulkan, OpenGL)
@ Core
Core engine, backend, subsystems.