diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-03-08 03:00:46 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-03-08 03:00:46 +0000 |
| commit | 07a7f4bd9e05a8c170d308af83063024bcdfaad4 (patch) | |
| tree | ae222f99f91788dba53387e6f2eb5558fb309247 /Graphics/GraphicsEngineD3D11 | |
| parent | A bunch of minor code improvements (diff) | |
| download | DiligentCore-07a7f4bd9e05a8c170d308af83063024bcdfaad4.tar.gz DiligentCore-07a7f4bd9e05a8c170d308af83063024bcdfaad4.zip | |
Added IShaderD3D interface and HLSLShaderResourceDesc structure
Diffstat (limited to 'Graphics/GraphicsEngineD3D11')
4 files changed, 25 insertions, 5 deletions
diff --git a/Graphics/GraphicsEngineD3D11/CMakeLists.txt b/Graphics/GraphicsEngineD3D11/CMakeLists.txt index f54fa680..630de8cb 100644 --- a/Graphics/GraphicsEngineD3D11/CMakeLists.txt +++ b/Graphics/GraphicsEngineD3D11/CMakeLists.txt @@ -79,7 +79,7 @@ INTERFACE ) target_link_libraries(GraphicsEngineD3D11Interface INTERFACE - GraphicsEngineInterface + GraphicsEngineD3DBaseInterface ) diff --git a/Graphics/GraphicsEngineD3D11/include/ShaderD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/ShaderD3D11Impl.h index 35a50a08..f297bc47 100644 --- a/Graphics/GraphicsEngineD3D11/include/ShaderD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/ShaderD3D11Impl.h @@ -53,7 +53,7 @@ public: const ShaderCreateInfo& ShaderCI); ~ShaderD3D11Impl(); - IMPLEMENT_QUERY_INTERFACE_IN_PLACE(IID_ShaderD3D11, TShaderBase); + virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface)override final; virtual Uint32 GetResourceCount()const override final { @@ -62,7 +62,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); } virtual ID3D11DeviceChild* GetD3D11Shader()override final diff --git a/Graphics/GraphicsEngineD3D11/interface/ShaderD3D11.h b/Graphics/GraphicsEngineD3D11/interface/ShaderD3D11.h index 15d7aed6..b2e5d6f5 100644 --- a/Graphics/GraphicsEngineD3D11/interface/ShaderD3D11.h +++ b/Graphics/GraphicsEngineD3D11/interface/ShaderD3D11.h @@ -26,7 +26,7 @@ /// \file /// Definition of the Diligent::IShaderD3D11 interface -#include "../../GraphicsEngine/interface/Shader.h" +#include "../../GraphicsEngineD3DBase/interface/ShaderD3D.h" namespace Diligent { @@ -36,7 +36,7 @@ static constexpr INTERFACE_ID IID_ShaderD3D11 = { 0xc513e83e, 0xb037, 0x405b, { 0x8b, 0x49, 0xbf, 0x8f, 0x5c, 0x22, 0xd, 0xee } }; /// Interface to the shader object implemented in D3D11 -class IShaderD3D11 : public IShader +class IShaderD3D11 : public IShaderD3D { public: diff --git a/Graphics/GraphicsEngineD3D11/src/ShaderD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/ShaderD3D11Impl.cpp index 677cd40c..7a6d1d91 100644 --- a/Graphics/GraphicsEngineD3D11/src/ShaderD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/ShaderD3D11Impl.cpp @@ -88,4 +88,19 @@ ShaderD3D11Impl::~ShaderD3D11Impl() { } +void ShaderD3D11Impl::QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface) +{ + if (ppInterface == nullptr) + return; + if (IID == IID_ShaderD3D || IID == IID_ShaderD3D11) + { + *ppInterface = this; + (*ppInterface)->AddRef(); + } + else + { + TShaderBase::QueryInterface( IID, ppInterface ); + } +} + } |
