summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D12
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-03-08 03:00:46 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-03-08 03:00:46 +0000
commit07a7f4bd9e05a8c170d308af83063024bcdfaad4 (patch)
treeae222f99f91788dba53387e6f2eb5558fb309247 /Graphics/GraphicsEngineD3D12
parentA bunch of minor code improvements (diff)
downloadDiligentCore-07a7f4bd9e05a8c170d308af83063024bcdfaad4.tar.gz
DiligentCore-07a7f4bd9e05a8c170d308af83063024bcdfaad4.zip
Added IShaderD3D interface and HLSLShaderResourceDesc structure
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
-rw-r--r--Graphics/GraphicsEngineD3D12/CMakeLists.txt2
-rw-r--r--Graphics/GraphicsEngineD3D12/include/ShaderD3D12Impl.h7
-rw-r--r--Graphics/GraphicsEngineD3D12/interface/ShaderD3D12.h4
-rw-r--r--Graphics/GraphicsEngineD3D12/src/ShaderD3D12Impl.cpp15
4 files changed, 23 insertions, 5 deletions
diff --git a/Graphics/GraphicsEngineD3D12/CMakeLists.txt b/Graphics/GraphicsEngineD3D12/CMakeLists.txt
index a5fac952..0f5aea78 100644
--- a/Graphics/GraphicsEngineD3D12/CMakeLists.txt
+++ b/Graphics/GraphicsEngineD3D12/CMakeLists.txt
@@ -109,7 +109,7 @@ INTERFACE
)
target_link_libraries(GraphicsEngineD3D12Interface
INTERFACE
- GraphicsEngineInterface
+ GraphicsEngineD3DBaseInterface
)
add_library(GraphicsEngineD3D12-static STATIC
diff --git a/Graphics/GraphicsEngineD3D12/include/ShaderD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/ShaderD3D12Impl.h
index 9227287e..f9dd4037 100644
--- a/Graphics/GraphicsEngineD3D12/include/ShaderD3D12Impl.h
+++ b/Graphics/GraphicsEngineD3D12/include/ShaderD3D12Impl.h
@@ -59,7 +59,12 @@ public:
virtual ShaderResourceDesc GetResource(Uint32 Index)const override final
{
- return m_pShaderResources->GetShaderResourceDesc(Index);
+ return GetHLSLResource(Index);
+ }
+
+ virtual HLSLShaderResourceDesc GetHLSLResource(Uint32 Index)const override final
+ {
+ return m_pShaderResources->GetHLSLShaderResourceDesc(Index);
}
ID3DBlob* GetShaderByteCode(){return m_pShaderByteCode;}
diff --git a/Graphics/GraphicsEngineD3D12/interface/ShaderD3D12.h b/Graphics/GraphicsEngineD3D12/interface/ShaderD3D12.h
index 31dec253..9a28a404 100644
--- a/Graphics/GraphicsEngineD3D12/interface/ShaderD3D12.h
+++ b/Graphics/GraphicsEngineD3D12/interface/ShaderD3D12.h
@@ -26,7 +26,7 @@
/// \file
/// Definition of the Diligent::IShaderD3D12 interface
-#include "../../GraphicsEngine/interface/Shader.h"
+#include "../../GraphicsEngineD3DBase/interface/ShaderD3D.h"
namespace Diligent
{
@@ -36,7 +36,7 @@ static constexpr INTERFACE_ID IID_ShaderD3D12 =
{ 0xc059b160, 0x7f31, 0x4029, { 0x94, 0x3d, 0x9, 0x96, 0xb9, 0x8e, 0xe7, 0x9a } };
/// Interface to the shader object implemented in D3D12
-class IShaderD3D12 : public IShader
+class IShaderD3D12 : public IShaderD3D
{
public:
diff --git a/Graphics/GraphicsEngineD3D12/src/ShaderD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/ShaderD3D12Impl.cpp
index ba069332..f4128b88 100644
--- a/Graphics/GraphicsEngineD3D12/src/ShaderD3D12Impl.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/ShaderD3D12Impl.cpp
@@ -49,6 +49,19 @@ ShaderD3D12Impl::~ShaderD3D12Impl()
{
}
-IMPLEMENT_QUERY_INTERFACE( ShaderD3D12Impl, IID_ShaderD3D12, TShaderBase )
+void ShaderD3D12Impl::QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface)
+{
+ if (ppInterface == nullptr)
+ return;
+ if (IID == IID_ShaderD3D || IID == IID_ShaderD3D12)
+ {
+ *ppInterface = this;
+ (*ppInterface)->AddRef();
+ }
+ else
+ {
+ TShaderBase::QueryInterface( IID, ppInterface );
+ }
+}
}