MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ destroy_sampler()

void MayaFlux::Portal::Graphics::SamplerForge::destroy_sampler ( vk::Sampler  sampler)

Destroy a specific sampler.

Parameters
samplerSampler to destroy

Removes from cache and destroys. Useful for hot-reloading.

Definition at line 133 of file SamplerForge.cpp.

134{
135 if (!is_initialized() || !sampler) {
136 return;
137 }
138
139 for (auto it = m_sampler_cache.begin(); it != m_sampler_cache.end(); ++it) {
140 if (it->second == sampler) {
141 auto device = m_backend->get_context().get_device();
142 device.destroySampler(sampler);
143 m_sampler_cache.erase(it);
145 "Destroyed sampler (remaining: {})", m_sampler_cache.size());
146 return;
147 }
148 }
149}
#define MF_DEBUG(comp, ctx,...)
bool is_initialized() const
Check if factory is initialized.
std::unordered_map< size_t, vk::Sampler > m_sampler_cache
std::shared_ptr< Core::VulkanBackend > m_backend
@ ImageProcessing
Image processing tasks (filters, transformations)
@ Portal
High-level user-facing API layer.

References MayaFlux::Journal::ImageProcessing, is_initialized(), m_backend, m_sampler_cache, MF_DEBUG, and MayaFlux::Journal::Portal.

+ Here is the call graph for this function: