Rehti MMORPG  1.0.0
Rehti MMORPG is a free and open source MMORPG game.
PoolManager Class Reference

This class manages descriptor pools, and allows for the allocation of descriptor sets. More...

#include <DescriptorBuilder.hpp>

Collaboration diagram for PoolManager:
Collaboration graph

Public Member Functions

 PoolManager (VkDevice device)
 
 ~PoolManager ()
 
void resetPools ()
 Resets pools More...
 
bool allocateDescriptorSet (VkDescriptorSetLayout layout, VkDescriptorSet &descSet)
 Allocates a descriptor set from the pool More...
 
VkDescriptorPool createPool (VkDevice device, VkDescriptorPoolCreateFlags flags, uint32_t maxSets, const std::vector< VkDescriptorPoolSize > &poolSizes)
 Allocates a descriptor pool and adds it to the free pools. More...
 
VkDevice getDevice () const
 Returns the logical device used by this manager. More...
 

Private Member Functions

VkDescriptorPool grabPool ()
 Returns a pool from free pools or creates a new one. Does not push the returned pool to used pools. More...
 

Private Attributes

VkDevice logDeviceM
 
VkDescriptorPool currentPoolM
 
std::vector< VkDescriptorPool > freePoolsM
 
std::vector< VkDescriptorPool > usedPoolsM
 

Detailed Description

This class manages descriptor pools, and allows for the allocation of descriptor sets.

Constructor & Destructor Documentation

◆ PoolManager()

PoolManager::PoolManager ( VkDevice  device)

◆ ~PoolManager()

PoolManager::~PoolManager ( )

Member Function Documentation

◆ allocateDescriptorSet()

bool PoolManager::allocateDescriptorSet ( VkDescriptorSetLayout  layout,
VkDescriptorSet &  descSet 
)

Allocates a descriptor set from the pool

Parameters
layoutLayout to be used
descSetDescriptor set to be allocated
Returns
Here is the call graph for this function:

◆ createPool()

VkDescriptorPool PoolManager::createPool ( VkDevice  device,
VkDescriptorPoolCreateFlags  flags,
uint32_t  maxSets,
const std::vector< VkDescriptorPoolSize > &  poolSizes 
)

Allocates a descriptor pool and adds it to the free pools.

Parameters
devicelogical device
flagsflags
maxSetsmaximum number of sets to be allocated from this pool
poolSizesList of limits on individual descriptors that can be allocated from this pool. For example 2 uniform buffers or 3 images.
Returns
Here is the caller graph for this function:

◆ getDevice()

VkDevice PoolManager::getDevice ( ) const
inline

Returns the logical device used by this manager.

Returns

◆ grabPool()

VkDescriptorPool PoolManager::grabPool ( )
private

Returns a pool from free pools or creates a new one. Does not push the returned pool to used pools.

Returns
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resetPools()

void PoolManager::resetPools ( )

Resets pools

Member Data Documentation

◆ currentPoolM

VkDescriptorPool PoolManager::currentPoolM
private

◆ freePoolsM

std::vector<VkDescriptorPool> PoolManager::freePoolsM
private

◆ logDeviceM

VkDevice PoolManager::logDeviceM
private

◆ usedPoolsM

std::vector<VkDescriptorPool> PoolManager::usedPoolsM
private

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