18#ifndef INCLUDED_SHADERMANAGER
19#define INCLUDED_SHADERMANAGER
30#include <unordered_map>
113 using EffectCacheMap = std::unordered_map<EffectCacheKey, CShaderTechniquePtr, EffectCacheKeyHash>;
120 std::set<std::weak_ptr<T>, std::owner_less<std::weak_ptr<T>>>>;
Path VfsPath
Definition: HeightMipmap.h:30
std::shared_ptr< CShaderProgram > CShaderProgramPtr
Definition: ShaderProgramPtr.h:26
std::shared_ptr< CShaderTechnique > CShaderTechniquePtr
Definition: ShaderTechniquePtr.h:28
Represents a mapping of name strings to value strings, for use with #if and #ifdef and similar condit...
Definition: ShaderDefines.h:147
Shader manager: loads and caches shader programs.
Definition: ShaderManager.h:39
bool LoadTechnique(CShaderTechniquePtr &tech)
Definition: ShaderManager.cpp:145
HotloadFilesMap< CShaderProgram > m_HotloadPrograms
Definition: ShaderManager.h:122
Renderer::Backend::IDevice * m_Device
Definition: ShaderManager.h:85
CShaderProgramPtr LoadProgram(const CStr &name, const CShaderDefines &defines)
Load a shader program.
Definition: ShaderManager.cpp:69
void AddProgramFileDependency(const CShaderProgramPtr &program, const VfsPath &path)
Associates the file with the program to be reloaded if the file has changed.
Definition: ShaderManager.cpp:519
Status ReloadChangedFile(const VfsPath &path)
Definition: ShaderManager.cpp:485
HotloadFilesMap< CShaderTechnique > m_HotloadTechniques
Definition: ShaderManager.h:121
CShaderTechniquePtr LoadEffect(CStrIntern name, const CShaderDefines &defines)
Load a shader effect.
Definition: ShaderManager.cpp:109
void AddTechniqueFileDependency(const CShaderTechniquePtr &technique, const VfsPath &path)
Associates the file with the technique to be reloaded if the file has changed.
Definition: ShaderManager.cpp:514
std::unordered_map< VfsPath, std::set< std::weak_ptr< T >, std::owner_less< std::weak_ptr< T > > > > HotloadFilesMap
Definition: ShaderManager.h:120
~CShaderManager()
Definition: ShaderManager.cpp:64
CShaderManager(Renderer::Backend::IDevice *device)
Definition: ShaderManager.cpp:48
std::unordered_map< EffectCacheKey, CShaderTechniquePtr, EffectCacheKeyHash > EffectCacheMap
Definition: ShaderManager.h:113
std::map< CacheKey, CShaderProgramPtr > m_ProgramCache
Definition: ShaderManager.h:91
CShaderTechnique::PipelineStateDescCallback PipelineStateDescCallback
Load a shader effect with the pipeline state description overwriting.
Definition: ShaderManager.h:62
static Status ReloadChangedFileCB(void *param, const VfsPath &path)
Definition: ShaderManager.cpp:480
EffectCacheMap m_EffectCache
Definition: ShaderManager.h:114
size_t GetNumEffectsLoaded() const
Returns the number of shader effects that are currently loaded.
Definition: ShaderManager.cpp:475
std::function< void(Renderer::Backend::SGraphicsPipelineStateDesc &pipelineStateDesc)> PipelineStateDescCallback
Definition: ShaderTechnique.h:63
Interned 8-bit strings.
Definition: CStrIntern.h:38
i64 Status
Error handling system.
Definition: status.h:173
Definition: ShaderManager.h:73
CShaderDefines defines
Definition: ShaderManager.h:75
std::string name
Definition: ShaderManager.h:74
bool operator<(const CacheKey &k) const
Definition: ShaderManager.h:77
Definition: ShaderManager.h:109
size_t operator()(const EffectCacheKey &key) const
Definition: ShaderManager.cpp:91
Key for effect cache lookups.
Definition: ShaderManager.h:101
CStrIntern name
Definition: ShaderManager.h:102
CShaderDefines defines
Definition: ShaderManager.h:103
bool operator==(const EffectCacheKey &b) const
Definition: ShaderManager.cpp:99
pthread_key_t key
Definition: wpthread.cpp:149