|
SDEngine
Game Engine
|
Compiles HLSL → SPIR-V and caches VkShaderModules. More...
#include <ShaderLibrary.hpp>
Collaboration diagram for sd::ShaderLibrary:Classes | |
| struct | ShaderEntry |
Public Member Functions | |
| ShaderLibrary (VkDevice device) | |
| ~ShaderLibrary () | |
| VkShaderModule | load (const std::string &hlsl_path, const std::string &profile) |
| std::set< std::string > | check_for_changes () |
| void | clear_cache () |
| Destroys all shader modules and clears the cache. | |
| ShaderLibrary (const ShaderLibrary &)=delete | |
| ShaderLibrary & | operator= (const ShaderLibrary &)=delete |
Private Attributes | |
| VkDevice | m_device |
| std::unordered_map< std::string, ShaderEntry > | m_cache |
| ShaderCompiler | m_compiler |
Compiles HLSL → SPIR-V and caches VkShaderModules.
|
explicit |
|
default |
|
delete |
| std::set< std::string > sd::ShaderLibrary::check_for_changes | ( | ) |
Checks if any cached shaders have changed on disk. Returns a set of paths that have been modified.
| void sd::ShaderLibrary::clear_cache | ( | ) |
Destroys all shader modules and clears the cache.
| VkShaderModule sd::ShaderLibrary::load | ( | const std::string & | hlsl_path, |
| const std::string & | profile | ||
| ) |
|
delete |
|
private |
|
private |
|
private |