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

◆ reload_shader()

ShaderID MayaFlux::Portal::Graphics::ShaderFoundry::reload_shader ( const std::string &  filepath)

Hot-reload shader (returns new ID)

Definition at line 412 of file ShaderFoundry.cpp.

413{
414 invalidate_cache(filepath);
415
416 auto cache_it = m_shader_filepath_cache.find(filepath);
417 if (cache_it != m_shader_filepath_cache.end()) {
418 destroy_shader(cache_it->second);
419 m_shader_filepath_cache.erase(cache_it);
420 }
421
422 return load_shader(filepath);
423}
std::unordered_map< std::string, ShaderID > m_shader_filepath_cache
void invalidate_cache(const std::string &cache_key)
Invalidate cache for specific shader.
void destroy_shader(ShaderID shader_id)
Destroy shader (cleanup internal state)
ShaderID load_shader(const std::string &content, std::optional< ShaderStage > stage=std::nullopt, const std::string &entry_point="main")
Universal shader loader - auto-detects source type.

References destroy_shader(), invalidate_cache(), load_shader(), and m_shader_filepath_cache.

+ Here is the call graph for this function: