SpiecsEngine
 
Loading...
Searching...
No Matches

◆ Registry() [2/2]

std::shared_ptr< VulkanDescriptorSet > Spices::DescriptorSetManager::Registry ( const String2 & name,
uint32_t set )
static

Registry a VulkanDescriptorSet, create one if find none.

Parameters
nameThe owner's name of the descriptor set. usually used with renderer descriptor set.
setThe set number of the descriptor set.
Returns
The shared pointer of VulkanDescriptorSet.

Definition at line 17 of file DescriptorSetManager.cpp.

18 {
20
21 std::unique_lock<std::mutex> lock(m_Mutex);
22
23 if (m_DescriptorSets.find(name) != m_DescriptorSets.end())
24 {
25 if (m_DescriptorSets[name].find(set) != m_DescriptorSets[name].end())
26 {
27 return m_DescriptorSets[name][set];
28 }
29 }
30
31 m_DescriptorSets[name][set] = std::make_shared<VulkanDescriptorSet>(VulkanRenderBackend::GetState(), VulkanRenderBackend::GetDescriptorPool());
32
33 return m_DescriptorSets[name][set];
34 }
#define SPICES_PROFILE_ZONE
static std::mutex m_Mutex
Mutex of this DescriptorSetManager.
static DescriptorManagerContainer m_DescriptorSets
The container of all descriptor sets, identified with owner's name and set number.
static std::shared_ptr< VulkanDescriptorPool > GetDescriptorPool()
Get DescriptorPool in use.
static VulkanState & GetState()
Get VulkanState in use.