MayaFlux 0.4.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 427 of file ShaderFoundry.cpp.

428{
429 invalidate_cache(filepath);
430
431 auto cache_it = m_shader_filepath_cache.find(filepath);
432 if (cache_it != m_shader_filepath_cache.end()) {
433 destroy_shader(cache_it->second);
434 m_shader_filepath_cache.erase(cache_it);
435 }
436
437 return load_shader(filepath);
438}
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: