summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D12
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-09-14 05:27:46 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-09-14 05:27:46 +0000
commitd748358793c89dd77a2c5dbbf3ca64050b1d3bb4 (patch)
tree25008f90079aee9988a9e27851a31709df4777fa /Graphics/GraphicsEngineD3D12
parentMinor fix for timer query support detection in OpenGLES (diff)
downloadDiligentCore-d748358793c89dd77a2c5dbbf3ca64050b1d3bb4.tar.gz
DiligentCore-d748358793c89dd77a2c5dbbf3ca64050b1d3bb4.zip
Refactoring shader compilation tools - part I (https://github.com/DiligentGraphics/DiligentCore/issues/160)
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
-rw-r--r--Graphics/GraphicsEngineD3D12/CMakeLists.txt2
-rw-r--r--Graphics/GraphicsEngineD3D12/include/RenderDeviceD3D12Impl.hpp6
-rw-r--r--Graphics/GraphicsEngineD3D12/include/ShaderResourcesD3D12.hpp8
-rw-r--r--Graphics/GraphicsEngineD3D12/src/ShaderResourcesD3D12.cpp16
4 files changed, 16 insertions, 16 deletions
diff --git a/Graphics/GraphicsEngineD3D12/CMakeLists.txt b/Graphics/GraphicsEngineD3D12/CMakeLists.txt
index 24696d7c..9941b62b 100644
--- a/Graphics/GraphicsEngineD3D12/CMakeLists.txt
+++ b/Graphics/GraphicsEngineD3D12/CMakeLists.txt
@@ -157,7 +157,7 @@ PRIVATE
Diligent-GraphicsEngineD3DBase
Diligent-GraphicsEngineNextGenBase
Diligent-TargetPlatform
- Diligent-HLSLTools
+ Diligent-ShaderTools
dxgi.lib
d3dcompiler.lib
PUBLIC
diff --git a/Graphics/GraphicsEngineD3D12/include/RenderDeviceD3D12Impl.hpp b/Graphics/GraphicsEngineD3D12/include/RenderDeviceD3D12Impl.hpp
index 5c077497..0dc4201e 100644
--- a/Graphics/GraphicsEngineD3D12/include/RenderDeviceD3D12Impl.hpp
+++ b/Graphics/GraphicsEngineD3D12/include/RenderDeviceD3D12Impl.hpp
@@ -40,7 +40,7 @@
#include "CommandQueueD3D12.h"
#include "GenerateMips.hpp"
#include "QueryManagerD3D12.hpp"
-#include "DXILUtils.hpp"
+#include "DXCompiler.hpp"
namespace Diligent
{
@@ -152,7 +152,7 @@ public:
const GenerateMipsHelper& GetMipsGenerator() const { return m_MipsGenerator; }
QueryManagerD3D12& GetQueryManager() { return m_QueryMgr; }
- IDxCompilerLibrary* GetDxCompiler() const { return m_pDxCompiler.get(); }
+ IDXCompiler* GetDxCompiler() const { return m_pDxCompiler.get(); }
#ifdef D3D12_H_HAS_MESH_SHADER
ID3D12Device2* GetD3D12Device2();
@@ -194,7 +194,7 @@ private:
D3D_SHADER_MODEL m_MaxShaderModel = D3D_SHADER_MODEL_5_1;
- std::unique_ptr<IDxCompilerLibrary> m_pDxCompiler;
+ std::unique_ptr<IDXCompiler> m_pDxCompiler;
};
} // namespace Diligent
diff --git a/Graphics/GraphicsEngineD3D12/include/ShaderResourcesD3D12.hpp b/Graphics/GraphicsEngineD3D12/include/ShaderResourcesD3D12.hpp
index 228db950..fe867d89 100644
--- a/Graphics/GraphicsEngineD3D12/include/ShaderResourcesD3D12.hpp
+++ b/Graphics/GraphicsEngineD3D12/include/ShaderResourcesD3D12.hpp
@@ -92,10 +92,10 @@ class ShaderResourcesD3D12 final : public ShaderResources
{
public:
// Loads shader resources from the compiled shader bytecode
- ShaderResourcesD3D12(ID3DBlob* pShaderBytecode,
- const ShaderDesc& ShdrDesc,
- const char* CombinedSamplerSuffix,
- class IDxCompilerLibrary* pCompilerLibrary);
+ ShaderResourcesD3D12(ID3DBlob* pShaderBytecode,
+ const ShaderDesc& ShdrDesc,
+ const char* CombinedSamplerSuffix,
+ class IDXCompiler* pDXCompiler);
// clang-format off
ShaderResourcesD3D12 (const ShaderResourcesD3D12&) = delete;
diff --git a/Graphics/GraphicsEngineD3D12/src/ShaderResourcesD3D12.cpp b/Graphics/GraphicsEngineD3D12/src/ShaderResourcesD3D12.cpp
index 6cd31660..700a5c47 100644
--- a/Graphics/GraphicsEngineD3D12/src/ShaderResourcesD3D12.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/ShaderResourcesD3D12.cpp
@@ -31,16 +31,16 @@
#include "ShaderResourcesD3D12.hpp"
#include "ShaderD3DBase.hpp"
#include "ShaderBase.hpp"
-#include "DXILUtils.hpp"
+#include "DXCompiler.hpp"
namespace Diligent
{
-ShaderResourcesD3D12::ShaderResourcesD3D12(ID3DBlob* pShaderBytecode,
- const ShaderDesc& ShdrDesc,
- const char* CombinedSamplerSuffix,
- class IDxCompilerLibrary* pCompilerLibrary) :
+ShaderResourcesD3D12::ShaderResourcesD3D12(ID3DBlob* pShaderBytecode,
+ const ShaderDesc& ShdrDesc,
+ const char* CombinedSamplerSuffix,
+ IDXCompiler* pDXCompiler) :
ShaderResources{ShdrDesc.ShaderType}
{
class NewResourceHandler
@@ -57,15 +57,15 @@ ShaderResourcesD3D12::ShaderResourcesD3D12(ID3DBlob* pShaderByte
};
CComPtr<ID3D12ShaderReflection> pShaderReflection;
- if (pCompilerLibrary != nullptr)
+ if (pDXCompiler != nullptr)
{
// Try to get shader reflection with DXC.
- DxcGetShaderReflection(pCompilerLibrary, reinterpret_cast<IDxcBlob*>(pShaderBytecode), &pShaderReflection);
+ pDXCompiler->GetD3D12ShaderReflection(reinterpret_cast<IDxcBlob*>(pShaderBytecode), &pShaderReflection);
}
if (!pShaderReflection)
{
- // Use FXC to get reflection.
+ // Use D3D compiler to get reflection.
auto hr = D3DReflect(pShaderBytecode->GetBufferPointer(), pShaderBytecode->GetBufferSize(), __uuidof(pShaderReflection), reinterpret_cast<void**>(&pShaderReflection));
CHECK_D3D_RESULT_THROW(hr, "Failed to get the shader reflection");
}