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

A helper class to store unique samplers. More...

#include <SamplerManager.h>

Collaboration diagram for Renderer::Backend::Vulkan::CSamplerManager:

Classes

struct  SamplerDescEqual
 
struct  SamplerDescHash
 

Public Member Functions

 CSamplerManager (CDevice *device)
 
 ~CSamplerManager ()
 
VkSampler GetOrCreateSampler (const Sampler::Desc &samplerDesc)
 

Private Attributes

CDevicem_Device = nullptr
 
std::unordered_map< Sampler::Desc, VkSampler, SamplerDescHash, SamplerDescEqualm_SamplerMap
 

Detailed Description

A helper class to store unique samplers.

The manager doesn't track usages of its samplers but keep them alive until its end. So before destroying the manager its owner should guarantee no usage.

Constructor & Destructor Documentation

◆ CSamplerManager()

Renderer::Backend::Vulkan::CSamplerManager::CSamplerManager ( CDevice device)

◆ ~CSamplerManager()

Renderer::Backend::Vulkan::CSamplerManager::~CSamplerManager ( )

Member Function Documentation

◆ GetOrCreateSampler()

VkSampler Renderer::Backend::Vulkan::CSamplerManager::GetOrCreateSampler ( const Sampler::Desc samplerDesc)
Returns
a sampler matches the description. The returned sampler is owned by the manager.

Member Data Documentation

◆ m_Device

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

◆ m_SamplerMap

std::unordered_map<Sampler::Desc, VkSampler, SamplerDescHash, SamplerDescEqual> Renderer::Backend::Vulkan::CSamplerManager::m_SamplerMap
private

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