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

◆ shutdown()

void MayaFlux::Portal::Graphics::ShaderFoundry::shutdown ( )

Shutdown and cleanup.

Destroys all cached shader modules. Safe to call multiple times.

Definition at line 54 of file ShaderFoundry.cpp.

55{
56 if (!s_initialized) {
57 return;
58 }
59
60 if (!m_backend) {
61 return;
62 }
63
65 "Shutting down ShaderFoundry...");
66
67 auto& cmd_manager = m_backend->get_command_manager();
68 auto device = get_device();
69
70 for (auto& [id, state] : m_command_buffers) {
71 if (state.is_active) {
72 cmd_manager.free_command_buffer(state.cmd);
73 }
74 if (state.timestamp_pool) {
75 device.destroyQueryPool(state.timestamp_pool);
76 }
77 }
78 m_command_buffers.clear();
79
80 for (auto& [id, state] : m_fences) {
81 device.destroyFence(state.fence);
82 }
83 m_fences.clear();
84
85 for (auto& [id, state] : m_semaphores) {
86 device.destroySemaphore(state.semaphore);
87 }
88 m_semaphores.clear();
89
90 m_descriptor_sets.clear();
91
92 m_global_descriptor_manager->cleanup(device);
93 m_shader_cache.clear();
94 m_shaders.clear();
96 m_descriptor_sets.clear();
97
98 m_backend = nullptr;
99
100 s_initialized = false;
101
103 "ShaderFoundry shutdown complete");
104}
#define MF_INFO(comp, ctx,...)
std::unordered_map< std::string, ShaderID > m_shader_filepath_cache
std::unordered_map< FenceID, FenceState > m_fences
std::unordered_map< std::string, std::shared_ptr< Core::VKShaderModule > > m_shader_cache
std::unordered_map< DescriptorSetID, DescriptorSetState > m_descriptor_sets
std::unordered_map< CommandBufferID, CommandBufferState > m_command_buffers
std::shared_ptr< Core::VKDescriptorManager > m_global_descriptor_manager
std::shared_ptr< Core::VulkanBackend > m_backend
std::unordered_map< SemaphoreID, SemaphoreState > m_semaphores
std::unordered_map< ShaderID, ShaderState > m_shaders
@ ShaderCompilation
Shader compilation tasks (Portal::Graphics::ShaderCompiler)
@ Portal
High-level user-facing API layer.

References get_device(), m_backend, m_command_buffers, m_descriptor_sets, m_fences, m_global_descriptor_manager, m_semaphores, m_shader_cache, m_shader_filepath_cache, m_shaders, MF_INFO, MayaFlux::Journal::Portal, s_initialized, and MayaFlux::Journal::ShaderCompilation.

Referenced by MayaFlux::Portal::Graphics::shutdown().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: