Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
DescriptorAllocator Class Reference

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.
 

Detailed Description

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.

Member Function Documentation

◆ allocateSet()

DescriptorSet DescriptorAllocator::allocateSet ( VkDescriptorSetLayout &  setLayout)

Allocate a descriptor set from an available pool, using the specified layout.

Parameters
setLayoutthe layout to use
Returns
the allocated descriptor set info

◆ clean()

void DescriptorAllocator::clean ( )

Reset all descriptor pools

◆ createPool()

DescriptorAllocator::DescriptorPool DescriptorAllocator::createPool ( uint  count,
bool  combined 
)
private

Create a descriptor pool containing count descriptors.

Parameters
countthe maximmum number of descriptors of each type to store in the poll
combinedshould images and samplers be represented by combined descriptors or separate sampled image/sampler descriptors.
Returns
descriptor pool info

◆ freeSet()

void DescriptorAllocator::freeSet ( const DescriptorSet set)

Mark an allocated descriptor set as unused

Parameters
setthe set to free

◆ getImGuiPool()

VkDescriptorPool DescriptorAllocator::getImGuiPool ( )
inline
Returns
the ImGui dedicated descriptor pool

◆ init()

void DescriptorAllocator::init ( GPUContext context,
uint  poolCount 
)

Setup the allocator.

Parameters
contextthe GPU context
poolCountthe maximum number of pools to allocate

The documentation for this class was generated from the following files: