MayaFlux 0.3.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 423 of file ShaderFoundry.cpp.

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