8#include "shader/general/Shader.h"
9#include "render/RenderSettings.h"
10#include "shader/hlsl/RootSignatureGenerator.h"
13#include "directx/d3dx12.h"
14#include "DirectXShaderCompiler/inc/dxcapi.h"
20 using namespace Microsoft::WRL;
25 enum class StaticSamplerShaderRegister : UINT {
50 const std::optional<VertexFormat>& vertexFormat,
95 static CD3DX12_STATIC_SAMPLER_DESC
125 const std::optional<std::filesystem::path>& pathToPdb);
142 const std::filesystem::path& cacheDirectory,
143 const std::string& sConfiguration,
161 std::pair<std::mutex, std::optional<RootSignatureGenerator::CollectedInfo>>*
getRootSignatureInfo();
190 [[nodiscard]]
virtual std::optional<Error>
206 std::optional<ShaderCacheInvalidationReason>& cacheInvalidationReason)
override;
216 static std::variant<ComPtr<IDxcBlob>,
Error>
Definition: ConfigManager.h:27
Definition: HlslShader.h:31
virtual std::optional< Error > saveAdditionalCompilationResultsInfo(ConfigManager &cacheMetadataConfigManager) override
Definition: HlslShader.cpp:481
static std::variant< std::shared_ptr< Shader >, std::string, Error > compileShader(Renderer *pRenderer, const std::filesystem::path &cacheDirectory, const std::string &sConfiguration, const ShaderDescription &shaderDescription)
Definition: HlslShader.cpp:292
static std::variant< std::string, Error > getShaderCompilerVersion()
Definition: HlslShader.cpp:34
static constexpr std::string_view getPixelShaderModel()
Definition: HlslShader.h:71
static constexpr std::string_view sPixelShaderModel
Definition: HlslShader.h:272
static constexpr std::string_view sComputeShaderModel
Definition: HlslShader.h:274
static CD3DX12_STATIC_SAMPLER_DESC getStaticSamplerDescription(TextureFilteringQuality textureFilteringQuality)
Definition: HlslShader.cpp:59
static UINT iShaderFileCodepage
Definition: HlslShader.h:252
static auto sShaderReflectionFileExtension
Definition: HlslShader.h:255
std::string sSourceFileHash
Definition: HlslShader.h:249
std::string getShaderSourceFileHash() const
Definition: HlslShader.cpp:451
virtual bool releaseShaderDataFromMemoryIfLoaded() override
Definition: HlslShader.cpp:453
static UINT getStaticSamplerShaderRegisterSpace()
Definition: HlslShader.cpp:136
static const UINT iStaticSamplerShaderRegisterSpace
Definition: HlslShader.h:264
std::pair< std::mutex, std::optional< RootSignatureGenerator::CollectedInfo > > * getRootSignatureInfo()
Definition: HlslShader.cpp:447
std::variant< ComPtr< IDxcBlob >, Error > getCompiledBlob()
Definition: HlslShader.cpp:435
static const auto sHlslSectionName
Definition: HlslShader.h:261
static const auto sReflectionFileHashKeyName
Definition: HlslShader.h:258
std::optional< Error > loadShaderDataFromDiskIfNotLoaded()
Definition: HlslShader.cpp:605
static constexpr std::string_view getVertexShaderModel()
Definition: HlslShader.h:64
virtual std::optional< Error > checkCachedAdditionalCompilationResultsInfo(ConfigManager &cacheMetadataConfigManager, std::optional< ShaderCacheInvalidationReason > &cacheInvalidationReason) override
Definition: HlslShader.cpp:498
static std::variant< ComPtr< IDxcBlob >, Error > readBlobFromDisk(const std::filesystem::path &pathToFile)
Definition: HlslShader.cpp:524
std::pair< std::mutex, std::optional< RootSignatureGenerator::CollectedInfo > > mtxRootSignatureInfo
Definition: HlslShader.h:246
static constexpr std::string_view getComputeShaderModel()
Definition: HlslShader.h:78
static std::variant< ComPtr< IDxcResult >, std::string, Error > compileShaderToBytecode(const ShaderDescription &shaderDescription, const std::optional< std::filesystem::path > &pathToPdb)
Definition: HlslShader.cpp:138
std::variant< std::string, Error > calculateReflectionFileHash()
Definition: HlslShader.cpp:567
std::pair< std::recursive_mutex, ComPtr< IDxcBlob > > mtxCompiledBytecode
Definition: HlslShader.h:238
static CD3DX12_STATIC_SAMPLER_DESC getStaticComparisonSamplerDescription()
Definition: HlslShader.cpp:119
static constexpr std::string_view sVertexShaderModel
Definition: HlslShader.h:270
Definition: Renderer.h:43
const ShaderType shaderType
Definition: Shader.h:254
const std::filesystem::path pathToCompiledShader
Definition: Shader.h:257
const std::string sShaderName
Definition: Shader.h:251
Renderer *const pRenderer
Definition: Shader.h:241
Definition: ShaderDescription.h:74