summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
diff options
context:
space:
mode:
authorazhirnov <zh1dron@gmail.com>2020-09-09 09:25:47 +0000
committerazhirnov <zh1dron@gmail.com>2020-09-09 15:56:51 +0000
commit381f66352dfaefcdeaeba3c71183ad558bb70cd6 (patch)
treea18b2fa0763a310317f6926677d87d91666bf4b6 /Graphics/GraphicsEngineVulkan
parentMerge branch 'master' into mesh_shader (diff)
downloadDiligentCore-381f66352dfaefcdeaeba3c71183ad558bb70cd6.tar.gz
DiligentCore-381f66352dfaefcdeaeba3c71183ad558bb70cd6.zip
added IDxCompilerLibrary interface. DXCompilerBase moved to platform specific files
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
-rw-r--r--Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.hpp5
-rw-r--r--Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanPhysicalDevice.hpp4
-rw-r--r--Graphics/GraphicsEngineVulkan/src/EngineFactoryVk.cpp3
-rw-r--r--Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp3
-rw-r--r--Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp2
5 files changed, 9 insertions, 8 deletions
diff --git a/Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.hpp b/Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.hpp
index 1adf71ee..9f18c99c 100644
--- a/Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.hpp
@@ -48,6 +48,7 @@
#include "FramebufferCache.hpp"
#include "RenderPassCache.hpp"
#include "CommandPoolManager.hpp"
+#include "DXILUtils.hpp"
namespace Diligent
{
@@ -176,6 +177,8 @@ public:
void FlushStaleResources(Uint32 CmdQueueIndex);
+ IDxCompilerLibrary* GetDxCompiler() const { return m_pDxCompiler.get(); }
+
private:
virtual void TestTextureFormat(TEXTURE_FORMAT TexFormat) override final;
@@ -205,6 +208,8 @@ private:
VulkanUtilities::VulkanMemoryManager m_MemoryMgr;
VulkanDynamicMemoryManager m_DynamicMemoryManager;
+
+ std::unique_ptr<IDxCompilerLibrary> m_pDxCompiler;
};
} // namespace Diligent
diff --git a/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanPhysicalDevice.hpp b/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanPhysicalDevice.hpp
index 760099e2..57631b91 100644
--- a/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanPhysicalDevice.hpp
+++ b/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanPhysicalDevice.hpp
@@ -39,9 +39,7 @@ class VulkanPhysicalDevice
public:
struct ExtensionFeatures
{
-#ifdef VK_NV_mesh_shader
- VkPhysicalDeviceMeshShaderFeaturesNV MeshShader;
-#endif
+ VkPhysicalDeviceMeshShaderFeaturesNV MeshShader = {};
};
struct ExtensionProperties
diff --git a/Graphics/GraphicsEngineVulkan/src/EngineFactoryVk.cpp b/Graphics/GraphicsEngineVulkan/src/EngineFactoryVk.cpp
index 9a17c9e2..f0dafcff 100644
--- a/Graphics/GraphicsEngineVulkan/src/EngineFactoryVk.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/EngineFactoryVk.cpp
@@ -39,7 +39,6 @@
#include "VulkanUtilities/VulkanInstance.hpp"
#include "VulkanUtilities/VulkanPhysicalDevice.hpp"
#include "EngineFactoryBase.hpp"
-#include "DXILUtils.hpp"
#if PLATFORM_ANDROID
# include "FileSystem.hpp"
@@ -248,8 +247,6 @@ void EngineFactoryVkImpl::CreateDeviceAndContextsVk(const EngineVkCreateInfo& _E
std::array<ICommandQueueVk*, 1> CommandQueues = {{pCmdQueueVk}};
AttachToVulkanDevice(Instance, std::move(PhysicalDevice), LogicalDevice, CommandQueues.size(), CommandQueues.data(), EngineCI, ppDevice, ppContexts);
-
- DxcLoadLibrary(DXCompilerTarget::Vulkan, EngineCI.pDxCompilerPath);
}
catch (std::runtime_error&)
{
diff --git a/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp
index e9fae8e7..c619dc59 100644
--- a/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp
@@ -148,7 +148,8 @@ RenderDeviceVkImpl::RenderDeviceVkImpl(IReferenceCounters*
*this,
EngineCI.DynamicHeapSize,
~Uint64{0}
- }
+ },
+ m_pDxCompiler{CreateDXCompiler(DXCompilerTarget::Vulkan, EngineCI.pDxCompilerPath)}
// clang-format on
{
m_DeviceCaps.DevType = RENDER_DEVICE_TYPE_VULKAN;
diff --git a/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp
index cafa7303..7cfa5f97 100644
--- a/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp
@@ -67,7 +67,7 @@ ShaderVkImpl::ShaderVkImpl(IReferenceCounters* pRefCounters,
switch (CreationAttribs.ShaderCompiler)
{
case SHADER_COMPILER_DXC:
- m_SPIRV = DXILtoSPIRV(CreationAttribs, VulkanDefine, CreationAttribs.ppCompilerOutput);
+ m_SPIRV = DXILtoSPIRV(pRenderDeviceVk->GetDxCompiler(), CreationAttribs, VulkanDefine, CreationAttribs.ppCompilerOutput);
break;
case SHADER_COMPILER_DEFAULT: