6#include <unordered_map>
10#include "misc/Error.h"
11#include "shader/ShaderDescription.h"
12#include "shader/general/format/VertexFormat.h"
62 const std::filesystem::path& shaderCacheDirectory,
63 const std::string& sConfiguration,
86 const std::filesystem::path& pathToCompiledShaderBytecode,
88 const std::string& sShaderNameWithoutConfiguration,
89 std::optional<ShaderCacheInvalidationReason>& cacheInvalidationReason);
138 std::optional<VertexFormat> vertexFormat);
162 [[nodiscard]]
virtual std::optional<Error>
180 std::optional<ShaderCacheInvalidationReason>& cacheInvalidationReason) {
214 const std::filesystem::path& shaderCacheDirectory,
215 const std::string& sConfiguration,
234 const std::filesystem::path& pathToSourceShaderFile,
235 const std::filesystem::path& pathToCompiledShaderBytecode,
238 std::optional<VertexFormat> vertexFormat);
Definition: ConfigManager.h:27
Definition: Renderer.h:43
std::optional< VertexFormat > getVertexFormat() const
Definition: Shader.cpp:311
virtual std::optional< Error > checkCachedAdditionalCompilationResultsInfo(ConfigManager &cacheMetadataConfigManager, std::optional< ShaderCacheInvalidationReason > &cacheInvalidationReason)
Definition: Shader.h:178
virtual bool releaseShaderDataFromMemoryIfLoaded()=0
const std::optional< VertexFormat > optionalVertexFormat
Definition: Shader.h:248
static std::variant< std::shared_ptr< Shader >, std::string, Error > compileShader(Renderer *pRenderer, const std::filesystem::path &shaderCacheDirectory, const std::string &sConfiguration, const ShaderDescription &shaderDescription)
Definition: Shader.cpp:81
Renderer * getRenderer() const
Definition: Shader.cpp:313
const ShaderType shaderType
Definition: Shader.h:254
ShaderType getShaderType() const
Definition: Shader.cpp:315
std::string getShaderName() const
Definition: Shader.cpp:300
static constexpr auto pFrameConstantBufferName
Definition: Shader.h:263
virtual std::optional< Error > saveAdditionalCompilationResultsInfo(ConfigManager &cacheMetadataConfigManager)
Definition: Shader.h:163
const std::filesystem::path pathToCompiledShader
Definition: Shader.h:257
static void notifyShaderBytecodeReleasedFromMemory()
Definition: Shader.cpp:34
static const auto sCompiledBytecodeHashKeyName
Definition: Shader.h:260
static constexpr const char * getFrameConstantsShaderResourceName()
Definition: Shader.h:36
static size_t getCurrentAmountOfShadersInMemory()
Definition: Shader.cpp:30
const std::string sShaderName
Definition: Shader.h:251
static std::variant< std::shared_ptr< Shader >, std::string, Error > compileRenderDependentShader(Renderer *pRenderer, const std::filesystem::path &shaderCacheDirectory, const std::string &sConfiguration, const ShaderDescription &shaderDescription)
Definition: Shader.cpp:45
std::variant< std::filesystem::path, Error > getPathToCompiledShader()
Definition: Shader.cpp:302
static std::variant< std::shared_ptr< Shader >, Error > createFromCache(Renderer *pRenderer, const std::filesystem::path &pathToCompiledShaderBytecode, ShaderDescription &shaderDescription, const std::string &sShaderNameWithoutConfiguration, std::optional< ShaderCacheInvalidationReason > &cacheInvalidationReason)
Definition: Shader.cpp:153
static void notifyShaderBytecodeLoadedIntoMemory()
Definition: Shader.cpp:32
Renderer *const pRenderer
Definition: Shader.h:241
static std::variant< std::shared_ptr< Shader >, Error > createRenderDependentShaderFromCache(Renderer *pRenderer, const std::filesystem::path &pathToSourceShaderFile, const std::filesystem::path &pathToCompiledShaderBytecode, const std::string &sShaderName, ShaderType shaderType, std::optional< VertexFormat > vertexFormat)
Definition: Shader.cpp:265
Definition: ShaderDescription.h:74