Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
Engine::Core::SamplerCache Class Reference

Cache for reusable Vulkan samplers keyed by address mode. More...

#include <ApplicationContext.h>

Collaboration diagram for Engine::Core::SamplerCache:

Public Member Functions

VkSampler getOrCreate (VkDevice device, VkSamplerAddressMode addressMode)
 Gets an existing sampler or creates one for the requested address mode.
void cleanup (VkDevice device)
 Destroys all cached samplers.

Private Attributes

std::unordered_map< VkSamplerAddressMode, VkSampler > cache_
std::mutex mutex_

Detailed Description

Cache for reusable Vulkan samplers keyed by address mode.

Definition at line 46 of file ApplicationContext.h.

Member Function Documentation

◆ cleanup()

void Engine::Core::SamplerCache::cleanup ( VkDevice device)

Destroys all cached samplers.

Parameters
deviceVulkan device that owns the cached samplers.

◆ getOrCreate()

VkSampler Engine::Core::SamplerCache::getOrCreate ( VkDevice device,
VkSamplerAddressMode addressMode )

Gets an existing sampler or creates one for the requested address mode.

Parameters
deviceVulkan device used to create the sampler when needed.
addressModeAddress mode for U, V, and W coordinates.
Returns
Cached sampler handle.

Member Data Documentation

◆ cache_

std::unordered_map<VkSamplerAddressMode, VkSampler> Engine::Core::SamplerCache::cache_
private

Definition at line 64 of file ApplicationContext.h.

◆ mutex_

std::mutex Engine::Core::SamplerCache::mutex_
private

Definition at line 65 of file ApplicationContext.h.


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