diff options
| author | azhirnov <zh1dron@gmail.com> | 2020-08-19 15:53:37 +0000 |
|---|---|---|
| committer | azhirnov <zh1dron@gmail.com> | 2020-08-19 15:53:37 +0000 |
| commit | 7b30ece38d8e18b033a1a02a27c2784954efce79 (patch) | |
| tree | 427b927b24b62cba28a1380d6cfae801074553f1 /Graphics | |
| parent | Use ShaderVersion instead of Uint8 (diff) | |
| download | DiligentCore-7b30ece38d8e18b033a1a02a27c2784954efce79.tar.gz DiligentCore-7b30ece38d8e18b033a1a02a27c2784954efce79.zip | |
Rename HAS_DXIL_COMPILER to HAS_D12_DXIL_COMPILER
Diffstat (limited to 'Graphics')
5 files changed, 13 insertions, 18 deletions
diff --git a/Graphics/GraphicsEngineD3D12/CMakeLists.txt b/Graphics/GraphicsEngineD3D12/CMakeLists.txt index 8cf3cc46..b7215a64 100644 --- a/Graphics/GraphicsEngineD3D12/CMakeLists.txt +++ b/Graphics/GraphicsEngineD3D12/CMakeLists.txt @@ -179,11 +179,11 @@ PUBLIC target_compile_definitions(Diligent-GraphicsEngineD3D12-shared PUBLIC ENGINE_DLL=1) if(${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION} STRGREATER_EQUAL "10.0.19041.0") + set(D12_H_HAS_MESH_SHADER ON CACHE INTERNAL "" FORCE) target_compile_definitions(Diligent-GraphicsEngineD3D12-static PRIVATE D12_H_HAS_MESH_SHADER) endif() -if(${HAS_DXIL_COMPILER}) - target_compile_definitions(Diligent-GraphicsEngineD3D12-static PRIVATE HAS_DXIL_COMPILER) - target_link_libraries(Diligent-GraphicsEngineD3D12-static PRIVATE dxcompiler.lib) +if(${HAS_D12_DXIL_COMPILER}) + target_compile_definitions(Diligent-GraphicsEngineD3D12-static PRIVATE HAS_D12_DXIL_COMPILER) endif() # Set output name to GraphicsEngineD3D12_{32|64}{r|d} diff --git a/Graphics/GraphicsEngineD3D12/src/ShaderResourcesD3D12.cpp b/Graphics/GraphicsEngineD3D12/src/ShaderResourcesD3D12.cpp index 4d858503..b447c036 100644 --- a/Graphics/GraphicsEngineD3D12/src/ShaderResourcesD3D12.cpp +++ b/Graphics/GraphicsEngineD3D12/src/ShaderResourcesD3D12.cpp @@ -32,10 +32,6 @@ #include "ShaderD3DBase.hpp" #include "ShaderBase.hpp" -#ifdef HAS_DXIL_COMPILER -# include "dxcapi.h" -#endif - namespace Diligent { @@ -62,7 +58,7 @@ ShaderResourcesD3D12::ShaderResourcesD3D12(ID3DBlob* pShaderBytecode, bool isDXI if (isDXIL) { -#ifdef HAS_DXIL_COMPILER +#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; 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; |
