summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3DBase
diff options
context:
space:
mode:
authorazhirnov <zh1dron@gmail.com>2020-08-19 15:53:37 +0000
committerazhirnov <zh1dron@gmail.com>2020-08-19 15:53:37 +0000
commit7b30ece38d8e18b033a1a02a27c2784954efce79 (patch)
tree427b927b24b62cba28a1380d6cfae801074553f1 /Graphics/GraphicsEngineD3DBase
parentUse ShaderVersion instead of Uint8 (diff)
downloadDiligentCore-7b30ece38d8e18b033a1a02a27c2784954efce79.tar.gz
DiligentCore-7b30ece38d8e18b033a1a02a27c2784954efce79.zip
Rename HAS_DXIL_COMPILER to HAS_D12_DXIL_COMPILER
Diffstat (limited to 'Graphics/GraphicsEngineD3DBase')
-rw-r--r--Graphics/GraphicsEngineD3DBase/CMakeLists.txt7
-rw-r--r--Graphics/GraphicsEngineD3DBase/include/ShaderD3DBase.hpp4
-rw-r--r--Graphics/GraphicsEngineD3DBase/src/ShaderD3DBase.cpp8
3 files changed, 9 insertions, 10 deletions
diff --git a/Graphics/GraphicsEngineD3DBase/CMakeLists.txt b/Graphics/GraphicsEngineD3DBase/CMakeLists.txt
index f95d6f39..bd7423ee 100644
--- a/Graphics/GraphicsEngineD3DBase/CMakeLists.txt
+++ b/Graphics/GraphicsEngineD3DBase/CMakeLists.txt
@@ -70,11 +70,10 @@ PUBLIC
set_common_target_properties(Diligent-GraphicsEngineD3DBase)
if(${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION} STRGREATER_EQUAL "10.0.17763.0")
- set(HAS_DXIL_COMPILER TRUE CACHE INTERNAL "" FORCE)
- target_compile_definitions(Diligent-GraphicsEngineD3DBase PRIVATE HAS_DXIL_COMPILER)
- target_link_libraries(Diligent-GraphicsEngineD3DBase PRIVATE dxcompiler.lib)
+ set(HAS_D12_DXIL_COMPILER TRUE CACHE INTERNAL "" FORCE)
+ target_compile_definitions(Diligent-GraphicsEngineD3DBase PRIVATE HAS_D12_DXIL_COMPILER)
else()
- set(HAS_DXIL_COMPILER FALSE CACHE INTERNAL "" FORCE)
+ set(HAS_D12_DXIL_COMPILER FALSE CACHE INTERNAL "" FORCE)
endif()
source_group("src" FILES ${SOURCE})
diff --git a/Graphics/GraphicsEngineD3DBase/include/ShaderD3DBase.hpp b/Graphics/GraphicsEngineD3DBase/include/ShaderD3DBase.hpp
index 7985da98..cbde6451 100644
--- a/Graphics/GraphicsEngineD3DBase/include/ShaderD3DBase.hpp
+++ b/Graphics/GraphicsEngineD3DBase/include/ShaderD3DBase.hpp
@@ -29,6 +29,10 @@
#include <d3dcommon.h>
+#ifdef HAS_D12_DXIL_COMPILER
+# include "dxcapi.h"
+#endif
+
#include "Shader.h"
/// \file
diff --git a/Graphics/GraphicsEngineD3DBase/src/ShaderD3DBase.cpp b/Graphics/GraphicsEngineD3DBase/src/ShaderD3DBase.cpp
index e96edb9a..51f8aa5c 100644
--- a/Graphics/GraphicsEngineD3DBase/src/ShaderD3DBase.cpp
+++ b/Graphics/GraphicsEngineD3DBase/src/ShaderD3DBase.cpp
@@ -36,10 +36,6 @@
#include <locale>
#include <cwchar>
-#ifdef HAS_DXIL_COMPILER
-# include "dxcapi.h"
-#endif
-
namespace Diligent
{
@@ -49,7 +45,7 @@ static const Char* g_HLSLDefinitions =
};
-#ifdef HAS_DXIL_COMPILER
+#ifdef HAS_D12_DXIL_COMPILER
class DxcIncludeHandlerImpl final : public IDxcIncludeHandler
{
public:
@@ -125,10 +121,10 @@ static HRESULT CompileDxilShader(const char* Source,
ID3DBlob** ppBlobOut,
ID3DBlob** ppCompilerOutput)
{
-#ifdef HAS_DXIL_COMPILER
std::vector<WCHAR> unicodeBuffer;
unicodeBuffer.resize(1u << 15);
size_t unicodeBufferOffset = 0;
+#ifdef HAS_D12_DXIL_COMPILER
const auto ToUnicode = [&unicodeBuffer, &unicodeBufferOffset](const char* str) {
auto len = strlen(str) + 1;