diff options
| author | azhirnov <zh1dron@gmail.com> | 2020-08-25 01:56:42 +0000 |
|---|---|---|
| committer | azhirnov <zh1dron@gmail.com> | 2020-08-25 01:56:42 +0000 |
| commit | 1313de1ab167fe67d14fa2a848946f442491ca11 (patch) | |
| tree | a87dad429e9a639b5403d0c923ca2d35b610479c /Graphics/GraphicsEngineD3D12 | |
| parent | added AdapterId to Vulkan backend (diff) | |
| download | DiligentCore-1313de1ab167fe67d14fa2a848946f442491ca11.tar.gz DiligentCore-1313de1ab167fe67d14fa2a848946f442491ca11.zip | |
added HLSLTools, HLSL shader compiler refactoring
added ShaderCompiler field to ShaderCreateInfo,
fixed tests that doesn't compile on DXC,
added dxc/WinAdapter.h to fix compilation on linux
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
| -rw-r--r-- | Graphics/GraphicsEngineD3D12/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | Graphics/GraphicsEngineD3D12/src/ShaderD3D12Impl.cpp | 2 | ||||
| -rw-r--r-- | Graphics/GraphicsEngineD3D12/src/ShaderResourcesD3D12.cpp | 4 |
3 files changed, 5 insertions, 2 deletions
diff --git a/Graphics/GraphicsEngineD3D12/CMakeLists.txt b/Graphics/GraphicsEngineD3D12/CMakeLists.txt index 00ce6a91..b5e85ad4 100644 --- a/Graphics/GraphicsEngineD3D12/CMakeLists.txt +++ b/Graphics/GraphicsEngineD3D12/CMakeLists.txt @@ -157,6 +157,7 @@ PRIVATE Diligent-GraphicsEngineD3DBase Diligent-GraphicsEngineNextGenBase Diligent-TargetPlatform + Diligent-HLSLTools dxgi.lib d3dcompiler.lib PUBLIC diff --git a/Graphics/GraphicsEngineD3D12/src/ShaderD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/ShaderD3D12Impl.cpp index 768983da..3c740b29 100644 --- a/Graphics/GraphicsEngineD3D12/src/ShaderD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/ShaderD3D12Impl.cpp @@ -59,7 +59,7 @@ ShaderD3D12Impl::ShaderD3D12Impl(IReferenceCounters* pRefCounters, pRenderDeviceD3D12, ShaderCI.Desc }, - ShaderD3DBase{ShaderCI, GetD3D12ShaderModel(pRenderDeviceD3D12, ShaderCI.HLSLVersion)} + ShaderD3DBase{ShaderCI, GetD3D12ShaderModel(pRenderDeviceD3D12, ShaderCI.HLSLVersion), true} // clang-format on { // Load shader resources diff --git a/Graphics/GraphicsEngineD3D12/src/ShaderResourcesD3D12.cpp b/Graphics/GraphicsEngineD3D12/src/ShaderResourcesD3D12.cpp index e2093eaa..f7488afe 100644 --- a/Graphics/GraphicsEngineD3D12/src/ShaderResourcesD3D12.cpp +++ b/Graphics/GraphicsEngineD3D12/src/ShaderResourcesD3D12.cpp @@ -31,6 +31,8 @@ #include "ShaderResourcesD3D12.hpp" #include "ShaderD3DBase.hpp" #include "ShaderBase.hpp" +#include "DXILUtils.hpp" +#include "dxc/dxcapi.h" namespace Diligent { @@ -61,7 +63,7 @@ ShaderResourcesD3D12::ShaderResourcesD3D12(ID3DBlob* pShaderBytecode, bool isDXI const uint32_t DFCC_DXIL = uint32_t('D') | (uint32_t('X') << 8) | (uint32_t('I') << 16) | (uint32_t('L') << 24); CComPtr<IDxcContainerReflection> pReflection; UINT32 shaderIdx; - hr = DXILCreateInstance(CLSID_DxcContainerReflection, IID_PPV_ARGS(&pReflection)); + hr = D3D12DxcCreateInstance(CLSID_DxcContainerReflection, IID_PPV_ARGS(&pReflection)); CHECK_D3D_RESULT_THROW(hr, "Failed to create shader reflection instance"); hr = pReflection->Load(reinterpret_cast<IDxcBlob*>(pShaderBytecode)); CHECK_D3D_RESULT_THROW(hr, "Failed to load shader reflection from bytecode"); |
