From 7b30ece38d8e18b033a1a02a27c2784954efce79 Mon Sep 17 00:00:00 2001 From: azhirnov Date: Wed, 19 Aug 2020 18:53:37 +0300 Subject: Rename HAS_DXIL_COMPILER to HAS_D12_DXIL_COMPILER --- Graphics/GraphicsEngineD3DBase/CMakeLists.txt | 7 +++---- Graphics/GraphicsEngineD3DBase/include/ShaderD3DBase.hpp | 4 ++++ Graphics/GraphicsEngineD3DBase/src/ShaderD3DBase.cpp | 8 ++------ 3 files changed, 9 insertions(+), 10 deletions(-) (limited to 'Graphics/GraphicsEngineD3DBase') 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 +#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 #include -#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 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; -- cgit v1.2.3