MayaFlux 0.4.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 183 of file ShaderProcessor.cpp.

184{
186 "Hot-reloading shader: {}", m_config.shader_path);
187
188 auto& foundry = Portal::Graphics::get_shader_foundry();
189 auto new_shader_id = foundry.reload_shader(m_config.shader_path);
190
191 if (new_shader_id == Portal::Graphics::INVALID_SHADER) {
193 "Hot-reload failed for shader: {}", m_config.shader_path);
194 return false;
195 }
196
198 foundry.destroy_shader(m_shader_id);
199 }
200
201 m_shader_id = new_shader_id;
204
206 "Shader hot-reloaded successfully (ID: {})", m_shader_id);
207 return true;
208}
#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: