Rendu
A lightweight rendering engine for experimentations
|
Manage descriptor set allocations by creating and reusing internal descriptor pools. More...
#include <DescriptorAllocator.hpp>
Classes | |
struct | DescriptorPool |
Descriptor pool management info. More... | |
Public Member Functions | |
void | init (GPUContext *context, uint poolCount) |
DescriptorSet | allocateSet (VkDescriptorSetLayout &setLayout) |
void | freeSet (const DescriptorSet &set) |
void | clean () |
VkDescriptorPool | getImGuiPool () |
Private Member Functions | |
DescriptorPool | createPool (uint count, bool combined) |
Private Attributes | |
GPUContext * | _context = nullptr |
The GPU context. | |
std::deque< DescriptorPool > | _pools |
Available pools. | |
DescriptorPool | _imguiPool |
ImGui dedicated pool. | |
uint | _maxPoolCount = 2 |
Maximum number of pools to create. | |
uint | _currentPoolCount = 0 |
Current number of created pools. | |
Manage descriptor set allocations by creating and reusing internal descriptor pools.
By default each pool will contain up to DEFAULT_SET_COUNT of each kind defined in createPool.
DescriptorSet DescriptorAllocator::allocateSet | ( | VkDescriptorSetLayout & | setLayout | ) |
Allocate a descriptor set from an available pool, using the specified layout.
setLayout | the layout to use |
void DescriptorAllocator::clean | ( | ) |
Reset all descriptor pools
|
private |
Create a descriptor pool containing count descriptors.
count | the maximmum number of descriptors of each type to store in the poll |
combined | should images and samplers be represented by combined descriptors or separate sampled image/sampler descriptors. |
void DescriptorAllocator::freeSet | ( | const DescriptorSet & | set | ) |
Mark an allocated descriptor set as unused
set | the set to free |
|
inline |
void DescriptorAllocator::init | ( | GPUContext * | context, |
uint | poolCount | ||
) |
Setup the allocator.
context | the GPU context |
poolCount | the maximum number of pools to allocate |