MayaFlux 0.5.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 507 of file ShaderFoundry.cpp.

508{
509 invalidate_cache(filepath);
510
511 auto cache_it = m_shader_filepath_cache.find(filepath);
512 if (cache_it != m_shader_filepath_cache.end()) {
513 destroy_shader(cache_it->second);
514 m_shader_filepath_cache.erase(cache_it);
515 }
516
517 return load_shader(filepath);
518}
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: