MayaFlux 0.2.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 176 of file ShaderProcessor.cpp.

177{
179 "Hot-reloading shader: {}", m_config.shader_path);
180
181 auto& foundry = Portal::Graphics::get_shader_foundry();
182 auto new_shader_id = foundry.reload_shader(m_config.shader_path);
183
184 if (new_shader_id == Portal::Graphics::INVALID_SHADER) {
186 "Hot-reload failed for shader: {}", m_config.shader_path);
187 return false;
188 }
189
191 foundry.destroy_shader(m_shader_id);
192 }
193
194 m_shader_id = new_shader_id;
197
199 "Shader hot-reloaded successfully (ID: {})", m_shader_id);
200 return true;
201}
#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: