Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
Renderer::Backend::Vulkan::CDescriptorManager Class Reference

#include <DescriptorManager.h>

Collaboration diagram for Renderer::Backend::Vulkan::CDescriptorManager:

Classes

struct  DescriptorIndexingBindingMap
 
struct  SingleTypeCacheKeyHash
 
struct  SingleTypePool
 
struct  SingleTypePoolReference
 

Public Member Functions

 CDescriptorManager (CDevice *device, const bool useDescriptorIndexing)
 
 ~CDescriptorManager ()
 
bool UseDescriptorIndexing () const
 
VkDescriptorSetLayout GetSingleTypeDescritorSetLayout (VkDescriptorType type, const uint32_t size)
 
VkDescriptorSet GetSingleTypeDescritorSet (VkDescriptorType type, VkDescriptorSetLayout layout, const std::vector< DeviceObjectUID > &texturesUID, const std::vector< CTexture * > &textures)
 
uint32_t GetUniformSet () const
 
uint32_t GetTextureDescriptor (CTexture *texture)
 
void OnTextureDestroy (const DeviceObjectUID uid)
 
const VkDescriptorSetLayout & GetDescriptorIndexingSetLayout () const
 
const VkDescriptorSetLayout & GetUniformDescriptorSetLayout () const
 
const VkDescriptorSet & GetDescriptorIndexingSet ()
 
const std::vector< VkDescriptorSetLayout > & GetDescriptorSetLayouts () const
 

Private Types

using SingleTypeCacheKey = std::pair< VkDescriptorSetLayout, std::vector< DeviceObjectUID > >
 

Private Member Functions

SingleTypePoolGetSingleTypePool (const VkDescriptorType type, const uint32_t size)
 
std::pair< VkDescriptorSet, bool > GetSingleTypeDescritorSetImpl (VkDescriptorType type, VkDescriptorSetLayout layout, const std::vector< DeviceObjectUID > &uids)
 

Private Attributes

CDevicem_Device = nullptr
 
bool m_UseDescriptorIndexing = false
 
VkDescriptorPool m_DescriptorIndexingPool = VK_NULL_HANDLE
 
VkDescriptorSet m_DescriptorIndexingSet = VK_NULL_HANDLE
 
VkDescriptorSetLayout m_DescriptorIndexingSetLayout = VK_NULL_HANDLE
 
VkDescriptorSetLayout m_UniformDescriptorSetLayout = VK_NULL_HANDLE
 
std::vector< VkDescriptorSetLayout > m_DescriptorSetLayouts
 
std::array< DescriptorIndexingBindingMap, NUMBER_OF_BINDINGS_PER_DESCRIPTOR_INDEXING_SETm_DescriptorIndexingBindings
 
std::unordered_map< DeviceObjectUID, uint32_tm_TextureToBindingMap
 
std::unordered_map< VkDescriptorType, std::vector< SingleTypePool > > m_SingleTypePools
 
std::unordered_map< DeviceObjectUID, std::vector< SingleTypePoolReference > > m_UIDToSingleTypePoolMap
 
std::unordered_map< SingleTypeCacheKey, VkDescriptorSet, SingleTypeCacheKeyHashm_SingleTypeSets
 
std::unique_ptr< ITexturem_ErrorTexture
 

Static Private Attributes

static constexpr uint32_t DESCRIPTOR_INDEXING_BINDING_SIZE = 16384
 
static constexpr uint32_t NUMBER_OF_BINDINGS_PER_DESCRIPTOR_INDEXING_SET = 3
 

Member Typedef Documentation

◆ SingleTypeCacheKey

using Renderer::Backend::Vulkan::CDescriptorManager::SingleTypeCacheKey = std::pair<VkDescriptorSetLayout, std::vector<DeviceObjectUID> >
private

Constructor & Destructor Documentation

◆ CDescriptorManager()

Renderer::Backend::Vulkan::CDescriptorManager::CDescriptorManager ( CDevice device,
const bool  useDescriptorIndexing 
)

◆ ~CDescriptorManager()

Renderer::Backend::Vulkan::CDescriptorManager::~CDescriptorManager ( )

Member Function Documentation

◆ GetDescriptorIndexingSet()

const VkDescriptorSet & Renderer::Backend::Vulkan::CDescriptorManager::GetDescriptorIndexingSet ( )
inline

◆ GetDescriptorIndexingSetLayout()

const VkDescriptorSetLayout & Renderer::Backend::Vulkan::CDescriptorManager::GetDescriptorIndexingSetLayout ( ) const
inline

◆ GetDescriptorSetLayouts()

const std::vector< VkDescriptorSetLayout > & Renderer::Backend::Vulkan::CDescriptorManager::GetDescriptorSetLayouts ( ) const
inline

◆ GetSingleTypeDescritorSet()

VkDescriptorSet Renderer::Backend::Vulkan::CDescriptorManager::GetSingleTypeDescritorSet ( VkDescriptorType  type,
VkDescriptorSetLayout  layout,
const std::vector< DeviceObjectUID > &  texturesUID,
const std::vector< CTexture * > &  textures 
)

◆ GetSingleTypeDescritorSetImpl()

std::pair< VkDescriptorSet, bool > Renderer::Backend::Vulkan::CDescriptorManager::GetSingleTypeDescritorSetImpl ( VkDescriptorType  type,
VkDescriptorSetLayout  layout,
const std::vector< DeviceObjectUID > &  uids 
)
private

◆ GetSingleTypeDescritorSetLayout()

VkDescriptorSetLayout Renderer::Backend::Vulkan::CDescriptorManager::GetSingleTypeDescritorSetLayout ( VkDescriptorType  type,
const uint32_t  size 
)
Returns
a single type descriptor set layout with the number of bindings equals to the size. The returned layout is owned by the manager.

◆ GetSingleTypePool()

CDescriptorManager::SingleTypePool & Renderer::Backend::Vulkan::CDescriptorManager::GetSingleTypePool ( const VkDescriptorType  type,
const uint32_t  size 
)
private

◆ GetTextureDescriptor()

uint32_t Renderer::Backend::Vulkan::CDescriptorManager::GetTextureDescriptor ( CTexture texture)

◆ GetUniformDescriptorSetLayout()

const VkDescriptorSetLayout & Renderer::Backend::Vulkan::CDescriptorManager::GetUniformDescriptorSetLayout ( ) const
inline

◆ GetUniformSet()

uint32_t Renderer::Backend::Vulkan::CDescriptorManager::GetUniformSet ( ) const

◆ OnTextureDestroy()

void Renderer::Backend::Vulkan::CDescriptorManager::OnTextureDestroy ( const DeviceObjectUID  uid)

◆ UseDescriptorIndexing()

bool Renderer::Backend::Vulkan::CDescriptorManager::UseDescriptorIndexing ( ) const
inline

Member Data Documentation

◆ DESCRIPTOR_INDEXING_BINDING_SIZE

constexpr uint32_t Renderer::Backend::Vulkan::CDescriptorManager::DESCRIPTOR_INDEXING_BINDING_SIZE = 16384
staticconstexprprivate

◆ m_DescriptorIndexingBindings

std::array<DescriptorIndexingBindingMap, NUMBER_OF_BINDINGS_PER_DESCRIPTOR_INDEXING_SET> Renderer::Backend::Vulkan::CDescriptorManager::m_DescriptorIndexingBindings
private

◆ m_DescriptorIndexingPool

VkDescriptorPool Renderer::Backend::Vulkan::CDescriptorManager::m_DescriptorIndexingPool = VK_NULL_HANDLE
private

◆ m_DescriptorIndexingSet

VkDescriptorSet Renderer::Backend::Vulkan::CDescriptorManager::m_DescriptorIndexingSet = VK_NULL_HANDLE
private

◆ m_DescriptorIndexingSetLayout

VkDescriptorSetLayout Renderer::Backend::Vulkan::CDescriptorManager::m_DescriptorIndexingSetLayout = VK_NULL_HANDLE
private

◆ m_DescriptorSetLayouts

std::vector<VkDescriptorSetLayout> Renderer::Backend::Vulkan::CDescriptorManager::m_DescriptorSetLayouts
private

◆ m_Device

CDevice* Renderer::Backend::Vulkan::CDescriptorManager::m_Device = nullptr
private

◆ m_ErrorTexture

std::unique_ptr<ITexture> Renderer::Backend::Vulkan::CDescriptorManager::m_ErrorTexture
private

◆ m_SingleTypePools

std::unordered_map<VkDescriptorType, std::vector<SingleTypePool> > Renderer::Backend::Vulkan::CDescriptorManager::m_SingleTypePools
private

◆ m_SingleTypeSets

std::unordered_map<SingleTypeCacheKey, VkDescriptorSet, SingleTypeCacheKeyHash> Renderer::Backend::Vulkan::CDescriptorManager::m_SingleTypeSets
private

◆ m_TextureToBindingMap

std::unordered_map<DeviceObjectUID, uint32_t> Renderer::Backend::Vulkan::CDescriptorManager::m_TextureToBindingMap
private

◆ m_UIDToSingleTypePoolMap

std::unordered_map<DeviceObjectUID, std::vector<SingleTypePoolReference> > Renderer::Backend::Vulkan::CDescriptorManager::m_UIDToSingleTypePoolMap
private

◆ m_UniformDescriptorSetLayout

VkDescriptorSetLayout Renderer::Backend::Vulkan::CDescriptorManager::m_UniformDescriptorSetLayout = VK_NULL_HANDLE
private

◆ m_UseDescriptorIndexing

bool Renderer::Backend::Vulkan::CDescriptorManager::m_UseDescriptorIndexing = false
private

◆ NUMBER_OF_BINDINGS_PER_DESCRIPTOR_INDEXING_SET

constexpr uint32_t Renderer::Backend::Vulkan::CDescriptorManager::NUMBER_OF_BINDINGS_PER_DESCRIPTOR_INDEXING_SET = 3
staticconstexprprivate

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