From d748358793c89dd77a2c5dbbf3ca64050b1d3bb4 Mon Sep 17 00:00:00 2001 From: assiduous Date: Sun, 13 Sep 2020 22:27:46 -0700 Subject: Refactoring shader compilation tools - part I (https://github.com/DiligentGraphics/DiligentCore/issues/160) --- Graphics/GraphicsEngineVulkan/CMakeLists.txt | 3 +-- .../GraphicsEngineVulkan/include/RenderDeviceVkImpl.hpp | 6 +++--- Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp | 14 +++++++------- .../src/VulkanUtilities/VulkanInstance.cpp | 6 +++--- 4 files changed, 14 insertions(+), 15 deletions(-) (limited to 'Graphics/GraphicsEngineVulkan') diff --git a/Graphics/GraphicsEngineVulkan/CMakeLists.txt b/Graphics/GraphicsEngineVulkan/CMakeLists.txt index 2e9458f7..8299915a 100644 --- a/Graphics/GraphicsEngineVulkan/CMakeLists.txt +++ b/Graphics/GraphicsEngineVulkan/CMakeLists.txt @@ -178,8 +178,7 @@ set(PRIVATE_DEPENDENCIES Diligent-Common Diligent-TargetPlatform Diligent-GraphicsEngineNextGenBase - Diligent-GLSLTools - Diligent-HLSLTools + Diligent-ShaderTools ) if (${DILIGENT_NO_HLSL}) diff --git a/Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.hpp b/Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.hpp index caf198cd..25a9f44b 100644 --- a/Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.hpp +++ b/Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.hpp @@ -48,7 +48,7 @@ #include "FramebufferCache.hpp" #include "RenderPassCache.hpp" #include "CommandPoolManager.hpp" -#include "DXILUtils.hpp" +#include "DXCompiler.hpp" namespace Diligent { @@ -177,7 +177,7 @@ public: void FlushStaleResources(Uint32 CmdQueueIndex); - IDxCompilerLibrary* GetDxCompiler() const { return m_pDxCompiler.get(); } + IDXCompiler* GetDxCompiler() const { return m_pDxCompiler.get(); } private: virtual void TestTextureFormat(TEXTURE_FORMAT TexFormat) override final; @@ -209,7 +209,7 @@ private: VulkanDynamicMemoryManager m_DynamicMemoryManager; - std::unique_ptr m_pDxCompiler; + std::unique_ptr m_pDxCompiler; }; } // namespace Diligent diff --git a/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp index 7cfa5f97..733f5b74 100644 --- a/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp @@ -32,11 +32,11 @@ #include "ShaderVkImpl.hpp" #include "RenderDeviceVkImpl.hpp" #include "DataBlobImpl.hpp" -#include "GLSLSourceBuilder.hpp" -#include "DXILUtils.hpp" +#include "GLSLUtils.hpp" +#include "DXCompiler.hpp" #if !DILIGENT_NO_GLSLANG -# include "SPIRVUtils.hpp" +# include "GLSLangUtils.hpp" #endif namespace Diligent @@ -78,7 +78,7 @@ ShaderVkImpl::ShaderVkImpl(IReferenceCounters* pRefCounters, #else if (CreationAttribs.SourceLanguage == SHADER_SOURCE_LANGUAGE_HLSL) { - m_SPIRV = HLSLtoSPIRV(CreationAttribs, VulkanDefine, CreationAttribs.ppCompilerOutput); + m_SPIRV = GLSLangUtils::HLSLtoSPIRV(CreationAttribs, VulkanDefine, CreationAttribs.ppCompilerOutput); } else { @@ -86,9 +86,9 @@ ShaderVkImpl::ShaderVkImpl(IReferenceCounters* pRefCounters, TargetGLSLCompiler::glslang, VulkanDefine); - m_SPIRV = GLSLtoSPIRV(m_Desc.ShaderType, GLSLSource.c_str(), - static_cast(GLSLSource.length()), - CreationAttribs.ppCompilerOutput); + m_SPIRV = GLSLangUtils::GLSLtoSPIRV(m_Desc.ShaderType, GLSLSource.c_str(), + static_cast(GLSLSource.length()), + CreationAttribs.ppCompilerOutput); } #endif break; diff --git a/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanInstance.cpp b/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanInstance.cpp index 99620e7d..ead31fe5 100644 --- a/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanInstance.cpp +++ b/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanInstance.cpp @@ -38,7 +38,7 @@ #include "VulkanUtilities/VulkanDebug.hpp" #if !DILIGENT_NO_GLSLANG -# include "SPIRVUtils.hpp" +# include "GLSLangUtils.hpp" #endif #include "PlatformDefinitions.h" @@ -262,7 +262,7 @@ VulkanInstance::VulkanInstance(bool EnableValidation, VERIFY_EXPR(m_PhysicalDevices.size() == PhysicalDeviceCount); } #if !DILIGENT_NO_GLSLANG - Diligent::InitializeGlslang(); + Diligent::GLSLangUtils::InitializeGlslang(); #endif } @@ -275,7 +275,7 @@ VulkanInstance::~VulkanInstance() vkDestroyInstance(m_VkInstance, m_pVkAllocator); #if !DILIGENT_NO_GLSLANG - Diligent::FinalizeGlslang(); + Diligent::GLSLangUtils::FinalizeGlslang(); #endif } -- cgit v1.2.3