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

◆ hot_reload_shader()

bool MayaFlux::Buffers::ShaderProcessor::hot_reload_shader ( )

Hot-reload shader from ShaderFoundry.

Returns
True if reload succeeded

Invalidates cached shader and rebuilds pipeline. Existing descriptor sets are preserved if compatible.

Definition at line 184 of file ShaderProcessor.cpp.

185{
187 "Hot-reloading shader: {}", m_config.shader_path);
188
189 auto& foundry = Portal::Graphics::get_shader_foundry();
190 auto new_shader_id = foundry.reload_shader(m_config.shader_path);
191
192 if (new_shader_id == Portal::Graphics::INVALID_SHADER) {
194 "Hot-reload failed for shader: {}", m_config.shader_path);
195 return false;
196 }
197
199 foundry.destroy_shader(m_shader_id);
200 }
201
202 m_shader_id = new_shader_id;
205
207 "Shader hot-reloaded successfully (ID: {})", m_shader_id);
208 return true;
209}
#define MF_INFO(comp, ctx,...)
#define MF_ERROR(comp, ctx,...)
Portal::Graphics::ShaderID m_shader_id
virtual void on_shader_loaded(Portal::Graphics::ShaderID shader_id)
Called after shader is loaded.
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.
constexpr ShaderID INVALID_SHADER
MAYAFLUX_API ShaderFoundry & get_shader_foundry()
Get the global shader compiler instance.
std::string shader_path
Path to shader file.

References MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, MayaFlux::Portal::Graphics::get_shader_foundry(), MayaFlux::Portal::Graphics::INVALID_SHADER, m_config, m_needs_pipeline_rebuild, m_shader_id, MF_ERROR, MF_INFO, on_shader_loaded(), and MayaFlux::Buffers::ShaderConfig::shader_path.

+ Here is the call graph for this function: