Nameless Engine
Loading...
Searching...
No Matches
ne::HlslShaderCacheManager Class Reference

#include <HlslShaderCacheManager.h>

Inheritance diagram for ne::HlslShaderCacheManager:
ne::ShaderCacheManager

Classes

struct  GlobalShaderCacheParameterNames
 

Public Member Functions

 HlslShaderCacheManager (const HlslShaderCacheManager &)=delete
 
HlslShaderCacheManageroperator= (const HlslShaderCacheManager &)=delete
 
- Public Member Functions inherited from ne::ShaderCacheManager
 ShaderCacheManager (const ShaderCacheManager &)=delete
 
ShaderCacheManageroperator= (const ShaderCacheManager &)=delete
 
std::optional< ErrorrefreshShaderCache ()
 

Protected Member Functions

virtual std::optional< std::string > isLanguageSpecificGlobalCacheOutdated (const ConfigManager &cacheConfig) override
 
virtual std::optional< ErrorwriteLanguageSpecificParameters (ConfigManager &cacheConfig) override
 
- Protected Member Functions inherited from ne::ShaderCacheManager
 ShaderCacheManager (Renderer *pRenderer)
 
virtual std::optional< std::string > isLanguageSpecificGlobalCacheOutdated (const ConfigManager &cacheConfig)=0
 
virtual std::optional< ErrorwriteLanguageSpecificParameters (ConfigManager &cacheConfig)=0
 

Private Member Functions

 HlslShaderCacheManager (Renderer *pRenderer)
 

Static Private Attributes

static constexpr std::string_view sHlslSectionName = "hlsl"
 

Friends

class ShaderCacheManager
 

Detailed Description

Responsible for validating HLSL shader cache, reading and updating the cache.

Constructor & Destructor Documentation

◆ HlslShaderCacheManager()

ne::HlslShaderCacheManager::HlslShaderCacheManager ( Renderer pRenderer)
private

Constructs a new manager.

Parameters
pRendererUsed renderer.

Member Function Documentation

◆ isLanguageSpecificGlobalCacheOutdated()

std::optional< std::string > ne::HlslShaderCacheManager::isLanguageSpecificGlobalCacheOutdated ( const ConfigManager cacheConfig)
overrideprotectedvirtual

Makes sure that the cache was generated using the same parameters as the current renderer's state and that the cache can be safely used. This function checks shader language specific parameters that might have changed.

Parameters
cacheConfigConfig that stores global cache parameters.
Returns
Empty if cache can be safely used, otherwise reason why it's outdated and cache can't be used.

Implements ne::ShaderCacheManager.

◆ writeLanguageSpecificParameters()

std::optional< Error > ne::HlslShaderCacheManager::writeLanguageSpecificParameters ( ConfigManager cacheConfig)
overrideprotectedvirtual

Writes shader language specific parameters that affect shader cache into the specified config.

Parameters
cacheConfigConfig that stores global cache parameters.
Returns
Error if something went wrong.

Implements ne::ShaderCacheManager.

Member Data Documentation

◆ sHlslSectionName

constexpr std::string_view ne::HlslShaderCacheManager::sHlslSectionName = "hlsl"
staticconstexprprivate

Name of the section in TOML file where all HLSL parameters are stored.


The documentation for this class was generated from the following files: