Pyrogenesis  trunk
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Renderer::Backend::Vulkan::CDescriptorManager Class Reference

#include <DescriptorManager.h>

Collaboration diagram for Renderer::Backend::Vulkan::CDescriptorManager:
Collaboration graph
[legend]

Classes

struct  DescriptorIndexingBindingMap
 
struct  SingleTypeCacheKeyHash
 
struct  SingleTypePool
 

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< CTexture::UID > &texturesUID, const std::vector< CTexture *> &textures)
 
uint32_t GetUniformSet () const
 
uint32_t GetTextureDescriptor (CTexture *texture)
 
void OnTextureDestroy (const CTexture::UID 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< CTexture::UID > >
 

Private Member Functions

SingleTypePoolGetSingleTypePool (const VkDescriptorType type, const uint32_t size)
 

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< CTexture::UID, uint32_tm_TextureToBindingMap
 
std::unordered_map< VkDescriptorType, std::vector< SingleTypePool > > m_SingleTypePools
 
std::unordered_map< CTexture::UID, std::vector< std::tuple< VkDescriptorType, uint8_t, int16_t > > > m_TextureSingleTypePoolMap
 
std::unordered_map< SingleTypeCacheKey, VkDescriptorSet, SingleTypeCacheKeyHashm_SingleTypeSets
 

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<CTexture::UID> >
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< CTexture::UID > &  texturesUID,
const std::vector< CTexture *> &  textures 
)

◆ 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 CTexture::UID  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
staticprivate

◆ 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_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_TextureSingleTypePoolMap

std::unordered_map<CTexture::UID, std::vector<std::tuple<VkDescriptorType, uint8_t, int16_t> > > Renderer::Backend::Vulkan::CDescriptorManager::m_TextureSingleTypePoolMap
private

◆ m_TextureToBindingMap

std::unordered_map<CTexture::UID, uint32_t> Renderer::Backend::Vulkan::CDescriptorManager::m_TextureToBindingMap
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
staticprivate

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