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 391 of file ShaderProcessor.cpp.

392{
394 "Hot-reloading shader: {}", m_config.shader_path);
395
396 auto& foundry = Portal::Graphics::get_shader_foundry();
397 auto new_shader_id = foundry.reload_shader(m_config.shader_path);
398
399 if (new_shader_id == Portal::Graphics::INVALID_SHADER) {
401 "Hot-reload failed for shader: {}", m_config.shader_path);
402 return false;
403 }
404
406 foundry.destroy_shader(m_shader_id);
407 }
408
409 m_shader_id = new_shader_id;
412
414 "Shader hot-reloaded successfully (ID: {})", m_shader_id);
415 return true;
416}
#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: