summaryrefslogtreecommitdiffstats
path: root/Graphics
diff options
context:
space:
mode:
authorazhirnov <zh1dron@gmail.com>2020-08-19 20:55:26 +0000
committerazhirnov <zh1dron@gmail.com>2020-08-19 20:55:26 +0000
commit882d621fe50027dedbb69f3f84e5c294656f6c6b (patch)
treee7a4e16a14dfc0ad57dced8833e1ee99a20aea5b /Graphics
parentminor fixes and formatting (diff)
downloadDiligentCore-882d621fe50027dedbb69f3f84e5c294656f6c6b.tar.gz
DiligentCore-882d621fe50027dedbb69f3f84e5c294656f6c6b.zip
Removed macros HAS_D12_DXIL_COMPILER
Diffstat (limited to 'Graphics')
-rw-r--r--Graphics/GraphicsEngineD3D12/src/ShaderD3D12Impl.cpp5
-rw-r--r--Graphics/GraphicsEngineD3D12/src/ShaderResourcesD3D12.cpp4
-rw-r--r--Graphics/GraphicsEngineD3DBase/CMakeLists.txt1
-rw-r--r--Graphics/GraphicsEngineD3DBase/include/ShaderD3DBase.hpp7
-rw-r--r--Graphics/GraphicsEngineD3DBase/src/ShaderD3DBase.cpp7
5 files changed, 1 insertions, 23 deletions
diff --git a/Graphics/GraphicsEngineD3D12/src/ShaderD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/ShaderD3D12Impl.cpp
index 86ccaa02..768983da 100644
--- a/Graphics/GraphicsEngineD3D12/src/ShaderD3D12Impl.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/ShaderD3D12Impl.cpp
@@ -40,13 +40,8 @@ static ShaderVersion GetD3D12ShaderModel(RenderDeviceD3D12Impl* pDevice, const S
{
if (HLSLVersion.Major == 0 && HLSLVersion.Minor == 0)
{
-#ifdef HAS_D12_DXIL_COMPILER
D3D_SHADER_MODEL ver = pDevice->GetShaderModel();
return ShaderVersion{Uint8((ver >> 4) & 0xF), Uint8(ver & 0xF)};
-#else
- // without DXIL compiler you can use only SM 5.1
- return ShaderVersion{5, 1};
-#endif
}
else
{
diff --git a/Graphics/GraphicsEngineD3D12/src/ShaderResourcesD3D12.cpp b/Graphics/GraphicsEngineD3D12/src/ShaderResourcesD3D12.cpp
index f3680ee7..e2093eaa 100644
--- a/Graphics/GraphicsEngineD3D12/src/ShaderResourcesD3D12.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/ShaderResourcesD3D12.cpp
@@ -58,7 +58,6 @@ ShaderResourcesD3D12::ShaderResourcesD3D12(ID3DBlob* pShaderBytecode, bool isDXI
if (isDXIL)
{
-#ifdef HAS_D12_DXIL_COMPILER
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;
@@ -70,9 +69,6 @@ ShaderResourcesD3D12::ShaderResourcesD3D12(ID3DBlob* pShaderBytecode, bool isDXI
CHECK_D3D_RESULT_THROW(hr, "Failed to find DXIL part");
hr = pReflection->GetPartReflection(shaderIdx, __uuidof(pShaderReflection), reinterpret_cast<void**>(&pShaderReflection));
CHECK_D3D_RESULT_THROW(hr, "Failed to get the shader reflection");
-#else
- LOG_ERROR_AND_THROW("DXIL compiler is not supported");
-#endif
}
else
{
diff --git a/Graphics/GraphicsEngineD3DBase/CMakeLists.txt b/Graphics/GraphicsEngineD3DBase/CMakeLists.txt
index bd7423ee..289ecc7e 100644
--- a/Graphics/GraphicsEngineD3DBase/CMakeLists.txt
+++ b/Graphics/GraphicsEngineD3DBase/CMakeLists.txt
@@ -71,7 +71,6 @@ set_common_target_properties(Diligent-GraphicsEngineD3DBase)
if(${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION} STRGREATER_EQUAL "10.0.17763.0")
set(HAS_D12_DXIL_COMPILER TRUE CACHE INTERNAL "" FORCE)
- target_compile_definitions(Diligent-GraphicsEngineD3DBase PRIVATE HAS_D12_DXIL_COMPILER)
else()
set(HAS_D12_DXIL_COMPILER FALSE CACHE INTERNAL "" FORCE)
endif()
diff --git a/Graphics/GraphicsEngineD3DBase/include/ShaderD3DBase.hpp b/Graphics/GraphicsEngineD3DBase/include/ShaderD3DBase.hpp
index ed41bb5f..5e834c98 100644
--- a/Graphics/GraphicsEngineD3DBase/include/ShaderD3DBase.hpp
+++ b/Graphics/GraphicsEngineD3DBase/include/ShaderD3DBase.hpp
@@ -28,10 +28,7 @@
#pragma once
#include <d3dcommon.h>
-
-#ifdef HAS_D12_DXIL_COMPILER
-# include "dxcapi.h"
-#endif
+#include <dxcapi.h>
#include "Shader.h"
@@ -52,12 +49,10 @@ protected:
bool m_isDXIL;
};
-#ifdef HAS_D12_DXIL_COMPILER
// calls DxcCreateInstance
HRESULT DXILCreateInstance(
_In_ REFCLSID rclsid,
_In_ REFIID riid,
_Out_ LPVOID* ppv);
-#endif
} // namespace Diligent
diff --git a/Graphics/GraphicsEngineD3DBase/src/ShaderD3DBase.cpp b/Graphics/GraphicsEngineD3DBase/src/ShaderD3DBase.cpp
index 604e385a..53c57e44 100644
--- a/Graphics/GraphicsEngineD3DBase/src/ShaderD3DBase.cpp
+++ b/Graphics/GraphicsEngineD3DBase/src/ShaderD3DBase.cpp
@@ -45,7 +45,6 @@ static const Char* g_HLSLDefinitions =
};
-#ifdef HAS_D12_DXIL_COMPILER
struct DXILCompilerLib
{
HMODULE Module = nullptr;
@@ -150,7 +149,6 @@ private:
ULONG m_RefCount;
std::vector<RefCntAutoPtr<IDataBlob>> m_FileDataCache;
};
-#endif
static HRESULT CompileDxilShader(const char* Source,
const ShaderCreateInfo& ShaderCI,
@@ -158,7 +156,6 @@ static HRESULT CompileDxilShader(const char* Source,
ID3DBlob** ppBlobOut,
ID3DBlob** ppCompilerOutput)
{
-#ifdef HAS_D12_DXIL_COMPILER
if (DXILCompilerLib::Instance().CreateInstance == nullptr)
{
LOG_ERROR("Failed to load dxcompiler.dll");
@@ -327,10 +324,6 @@ static HRESULT CompileDxilShader(const char* Source,
hr = result->GetResult(reinterpret_cast<IDxcBlob**>(ppBlobOut));
return hr;
-#else
- UNSUPPORTED("Shader model 6 and above requires DXIL compiler");
- return E_FAIL;
-#endif
}