diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-07-25 15:09:57 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-07-25 15:09:57 +0000 |
| commit | 404459e2cb9a17e94ee7d26c22fbe2485828b496 (patch) | |
| tree | 7b81d6ed6fa0612a35443b91e7b7948c51d824c5 /Graphics/GraphicsEngineD3D11 | |
| parent | Few improvements to RefCntAutoPtr & DeviceContextBase::SetPipelineState (diff) | |
| download | DiligentCore-404459e2cb9a17e94ee7d26c22fbe2485828b496.tar.gz DiligentCore-404459e2cb9a17e94ee7d26c22fbe2485828b496.zip | |
Improved performance of DeviceObjectBase::Release()
Diffstat (limited to 'Graphics/GraphicsEngineD3D11')
14 files changed, 50 insertions, 40 deletions
diff --git a/Graphics/GraphicsEngineD3D11/include/BufferD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/BufferD3D11Impl.h index 1a37c0d8..b2b09730 100644 --- a/Graphics/GraphicsEngineD3D11/include/BufferD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/BufferD3D11Impl.h @@ -30,6 +30,7 @@ #include "RenderDeviceD3D11.h" #include "BufferBase.h" #include "BufferViewD3D11Impl.h" +#include "RenderDeviceD3D11Impl.h" namespace Diligent { @@ -48,10 +49,10 @@ enum class D3D11BufferState }; /// Implementation of the Diligent::IBufferD3D11 interface -class BufferD3D11Impl : public BufferBase<IBufferD3D11, BufferViewD3D11Impl, FixedBlockMemoryAllocator> +class BufferD3D11Impl : public BufferBase<IBufferD3D11, RenderDeviceD3D11Impl, BufferViewD3D11Impl, FixedBlockMemoryAllocator> { public: - using TBufferBase = BufferBase<IBufferD3D11, BufferViewD3D11Impl, FixedBlockMemoryAllocator>; + using TBufferBase = BufferBase<IBufferD3D11, RenderDeviceD3D11Impl, BufferViewD3D11Impl, FixedBlockMemoryAllocator>; BufferD3D11Impl(IReferenceCounters* pRefCounters, FixedBlockMemoryAllocator& BuffViewObjMemAllocator, diff --git a/Graphics/GraphicsEngineD3D11/include/BufferViewD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/BufferViewD3D11Impl.h index 7b875fa8..f1f48b93 100644 --- a/Graphics/GraphicsEngineD3D11/include/BufferViewD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/BufferViewD3D11Impl.h @@ -29,19 +29,20 @@ #include "BufferViewD3D11.h" #include "RenderDeviceD3D11.h" #include "BufferViewBase.h" +#include "RenderDeviceD3D11Impl.h" namespace Diligent { class FixedBlockMemoryAllocator; /// Implementation of the Diligent::IBufferViewD3D11 interface -class BufferViewD3D11Impl : public BufferViewBase<IBufferViewD3D11> +class BufferViewD3D11Impl : public BufferViewBase<IBufferViewD3D11, RenderDeviceD3D11Impl> { public: - using TBufferViewBase = BufferViewBase<IBufferViewD3D11>; + using TBufferViewBase = BufferViewBase<IBufferViewD3D11, RenderDeviceD3D11Impl>; BufferViewD3D11Impl( IReferenceCounters* pRefCounters, - IRenderDevice* pDevice, + RenderDeviceD3D11Impl* pDevice, const BufferViewDesc& ViewDesc, class IBuffer* pBuffer, ID3D11View* pD3D11View, diff --git a/Graphics/GraphicsEngineD3D11/include/CommandListD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/CommandListD3D11Impl.h index 24235560..6dbe28bb 100644 --- a/Graphics/GraphicsEngineD3D11/include/CommandListD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/CommandListD3D11Impl.h @@ -28,6 +28,7 @@ #include "RenderDeviceD3D11.h" #include "CommandListBase.h" +#include "RenderDeviceD3D11Impl.h" namespace Diligent { @@ -35,14 +36,14 @@ namespace Diligent class FixedBlockMemoryAllocator; /// Implementation of the Diligent::ICommandListD3D11 interface -class CommandListD3D11Impl : public CommandListBase<ICommandList> +class CommandListD3D11Impl : public CommandListBase<ICommandList, RenderDeviceD3D11Impl> { public: - using TCommandListBase = CommandListBase<ICommandList>; + using TCommandListBase = CommandListBase<ICommandList, RenderDeviceD3D11Impl>; - CommandListD3D11Impl(IReferenceCounters* pRefCounters, - IRenderDevice* pDevice, - ID3D11CommandList* pd3d11CommandList); + CommandListD3D11Impl(IReferenceCounters* pRefCounters, + RenderDeviceD3D11Impl* pDevice, + ID3D11CommandList* pd3d11CommandList); ~CommandListD3D11Impl(); ID3D11CommandList *GetD3D11CommandList(){ return m_pd3d11CommandList; } diff --git a/Graphics/GraphicsEngineD3D11/include/FenceD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/FenceD3D11Impl.h index 618a3e63..0b84cbae 100644 --- a/Graphics/GraphicsEngineD3D11/include/FenceD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/FenceD3D11Impl.h @@ -30,6 +30,7 @@ #include "FenceD3D11.h" #include "RenderDeviceD3D11.h" #include "FenceBase.h" +#include "RenderDeviceD3D11Impl.h" namespace Diligent { @@ -37,14 +38,14 @@ namespace Diligent class FixedBlockMemoryAllocator; /// Implementation of the Diligent::IFenceD3D11 interface -class FenceD3D11Impl : public FenceBase<IFenceD3D11> +class FenceD3D11Impl : public FenceBase<IFenceD3D11, RenderDeviceD3D11Impl> { public: - using TFenceBase = FenceBase<IFenceD3D11>; + using TFenceBase = FenceBase<IFenceD3D11, RenderDeviceD3D11Impl>; - FenceD3D11Impl(IReferenceCounters* pRefCounters, - IRenderDevice* pDevice, - const FenceDesc& Desc); + FenceD3D11Impl(IReferenceCounters* pRefCounters, + RenderDeviceD3D11Impl* pDevice, + const FenceDesc& Desc); ~FenceD3D11Impl(); virtual Uint64 GetCompletedValue()override final; diff --git a/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h index 04d0d8e6..d52d66f2 100644 --- a/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h @@ -31,16 +31,17 @@ #include "PipelineStateBase.h" #include "ShaderD3D11Impl.h" #include "SRBMemoryAllocator.h" +#include "RenderDeviceD3D11Impl.h" namespace Diligent { class FixedBlockMemoryAllocator; /// Implementation of the Diligent::IPipelineStateD3D11 interface -class PipelineStateD3D11Impl : public PipelineStateBase<IPipelineStateD3D11, IRenderDeviceD3D11> +class PipelineStateD3D11Impl : public PipelineStateBase<IPipelineStateD3D11, RenderDeviceD3D11Impl> { public: - using TPipelineStateBase = PipelineStateBase<IPipelineStateD3D11, IRenderDeviceD3D11>; + using TPipelineStateBase = PipelineStateBase<IPipelineStateD3D11, RenderDeviceD3D11Impl>; PipelineStateD3D11Impl(IReferenceCounters* pRefCounters, class RenderDeviceD3D11Impl* pDeviceD3D11, diff --git a/Graphics/GraphicsEngineD3D11/include/SamplerD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/SamplerD3D11Impl.h index 2d060515..58b7250a 100644 --- a/Graphics/GraphicsEngineD3D11/include/SamplerD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/SamplerD3D11Impl.h @@ -29,16 +29,17 @@ #include "SamplerD3D11.h" #include "RenderDeviceD3D11.h" #include "SamplerBase.h" +#include "RenderDeviceD3D11Impl.h" namespace Diligent { class FixedBlockMemoryAllocator; /// Implementation of the Diligent::ISamplerD3D11 interface -class SamplerD3D11Impl : public SamplerBase<ISamplerD3D11, IRenderDeviceD3D11> +class SamplerD3D11Impl : public SamplerBase<ISamplerD3D11, RenderDeviceD3D11Impl> { public: - using TSamplerBase = SamplerBase<ISamplerD3D11, IRenderDeviceD3D11>; + using TSamplerBase = SamplerBase<ISamplerD3D11, RenderDeviceD3D11Impl>; SamplerD3D11Impl(IReferenceCounters* pRefCounters, class RenderDeviceD3D11Impl* pRenderDeviceD3D11, diff --git a/Graphics/GraphicsEngineD3D11/include/ShaderD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/ShaderD3D11Impl.h index 53d6d209..23f22ffc 100644 --- a/Graphics/GraphicsEngineD3D11/include/ShaderD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/ShaderD3D11Impl.h @@ -34,6 +34,7 @@ #include "ShaderResourceCacheD3D11.h" #include "EngineD3D11Defines.h" #include "ShaderResourcesD3D11.h" +#include "RenderDeviceD3D11Impl.h" namespace Diligent { @@ -42,10 +43,10 @@ class FixedBlockMemoryAllocator; class ResourceMapping; /// Implementation of the Diligent::IShaderD3D11 interface -class ShaderD3D11Impl : public ShaderBase<IShaderD3D11, IRenderDeviceD3D11>, public ShaderD3DBase +class ShaderD3D11Impl : public ShaderBase<IShaderD3D11, RenderDeviceD3D11Impl>, public ShaderD3DBase { public: - using TShaderBase = ShaderBase<IShaderD3D11, IRenderDeviceD3D11>; + using TShaderBase = ShaderBase<IShaderD3D11, RenderDeviceD3D11Impl>; ShaderD3D11Impl(IReferenceCounters* pRefCounters, class RenderDeviceD3D11Impl* pRenderDeviceD3D11, diff --git a/Graphics/GraphicsEngineD3D11/include/TextureBaseD3D11.h b/Graphics/GraphicsEngineD3D11/include/TextureBaseD3D11.h index dcd58c0d..1284c52e 100644 --- a/Graphics/GraphicsEngineD3D11/include/TextureBaseD3D11.h +++ b/Graphics/GraphicsEngineD3D11/include/TextureBaseD3D11.h @@ -30,6 +30,7 @@ #include "RenderDeviceD3D11.h" #include "TextureBase.h" #include "TextureViewD3D11Impl.h" +#include "RenderDeviceD3D11Impl.h" namespace Diligent { @@ -47,10 +48,10 @@ enum class D3D11TextureState }; /// Base implementation of the Diligent::ITextureD3D11 interface -class TextureBaseD3D11 : public TextureBase<ITextureD3D11, TextureViewD3D11Impl, FixedBlockMemoryAllocator> +class TextureBaseD3D11 : public TextureBase<ITextureD3D11, RenderDeviceD3D11Impl, TextureViewD3D11Impl, FixedBlockMemoryAllocator> { public: - typedef TextureBase<ITextureD3D11, TextureViewD3D11Impl, FixedBlockMemoryAllocator> TTextureBase; + typedef TextureBase<ITextureD3D11, RenderDeviceD3D11Impl, TextureViewD3D11Impl, FixedBlockMemoryAllocator> TTextureBase; TextureBaseD3D11(IReferenceCounters* pRefCounters, FixedBlockMemoryAllocator& TexViewObjAllocator, diff --git a/Graphics/GraphicsEngineD3D11/include/TextureViewD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/TextureViewD3D11Impl.h index b4882089..9fcdf352 100644 --- a/Graphics/GraphicsEngineD3D11/include/TextureViewD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/TextureViewD3D11Impl.h @@ -29,6 +29,7 @@ #include "TextureViewD3D11.h" #include "RenderDeviceD3D11.h" #include "TextureViewBase.h" +#include "RenderDeviceD3D11Impl.h" namespace Diligent { @@ -36,13 +37,13 @@ namespace Diligent class FixedBlockMemoryAllocator; /// Implementation of the Diligent::ITextureViewD3D11 interface -class TextureViewD3D11Impl : public TextureViewBase<ITextureViewD3D11> +class TextureViewD3D11Impl : public TextureViewBase<ITextureViewD3D11, RenderDeviceD3D11Impl> { public: - using TTextureViewBase = TextureViewBase<ITextureViewD3D11>; + using TTextureViewBase = TextureViewBase<ITextureViewD3D11, RenderDeviceD3D11Impl>; TextureViewD3D11Impl( IReferenceCounters* pRefCounters, - IRenderDevice* pDevice, + RenderDeviceD3D11Impl* pDevice, const TextureViewDesc& ViewDesc, class ITexture* pTexture, ID3D11View* pD3D11View, diff --git a/Graphics/GraphicsEngineD3D11/src/BufferViewD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/BufferViewD3D11Impl.cpp index f500e9c1..10d8bbc1 100644 --- a/Graphics/GraphicsEngineD3D11/src/BufferViewD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/BufferViewD3D11Impl.cpp @@ -27,12 +27,12 @@ namespace Diligent { -BufferViewD3D11Impl::BufferViewD3D11Impl( IReferenceCounters* pRefCounters, - IRenderDevice* pDevice, - const BufferViewDesc& ViewDesc, - IBuffer* pBuffer, - ID3D11View* pD3D11View, - bool bIsDefaultView ) : +BufferViewD3D11Impl::BufferViewD3D11Impl( IReferenceCounters* pRefCounters, + RenderDeviceD3D11Impl* pDevice, + const BufferViewDesc& ViewDesc, + IBuffer* pBuffer, + ID3D11View* pD3D11View, + bool bIsDefaultView ) : TBufferViewBase( pRefCounters, pDevice, ViewDesc, pBuffer, bIsDefaultView ), m_pD3D11View( pD3D11View ) { diff --git a/Graphics/GraphicsEngineD3D11/src/CommandListD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/CommandListD3D11Impl.cpp index c415c998..06e476c1 100644 --- a/Graphics/GraphicsEngineD3D11/src/CommandListD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/CommandListD3D11Impl.cpp @@ -30,9 +30,9 @@ namespace Diligent { -CommandListD3D11Impl :: CommandListD3D11Impl(IReferenceCounters* pRefCounters, - IRenderDevice* pDevice, - ID3D11CommandList* pd3d11CommandList) : +CommandListD3D11Impl :: CommandListD3D11Impl(IReferenceCounters* pRefCounters, + RenderDeviceD3D11Impl* pDevice, + ID3D11CommandList* pd3d11CommandList) : TCommandListBase(pRefCounters, pDevice), m_pd3d11CommandList(pd3d11CommandList) { diff --git a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp index a36260ef..da8ac073 100644 --- a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp @@ -1256,7 +1256,8 @@ namespace Diligent // ID3D11DeviceContext::ClearState() was called. &pd3d11CmdList); - CommandListD3D11Impl* pCmdListD3D11( NEW_RC_OBJ(m_CmdListAllocator, "CommandListD3D11Impl instance", CommandListD3D11Impl)(m_pDevice, pd3d11CmdList) ); + auto* pDeviceD3D11Impl = m_pDevice.RawPtr<RenderDeviceD3D11Impl>(); + CommandListD3D11Impl* pCmdListD3D11( NEW_RC_OBJ(m_CmdListAllocator, "CommandListD3D11Impl instance", CommandListD3D11Impl)(pDeviceD3D11Impl, pd3d11CmdList) ); pCmdListD3D11->QueryInterface( IID_CommandList, reinterpret_cast<IObject**>(ppCommandList) ); // Device context is now in default state diff --git a/Graphics/GraphicsEngineD3D11/src/FenceD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/FenceD3D11Impl.cpp index 81d288be..950f13e5 100644 --- a/Graphics/GraphicsEngineD3D11/src/FenceD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/FenceD3D11Impl.cpp @@ -30,9 +30,9 @@ namespace Diligent { -FenceD3D11Impl :: FenceD3D11Impl(IReferenceCounters* pRefCounters, - IRenderDevice* pDevice, - const FenceDesc& Desc) : +FenceD3D11Impl :: FenceD3D11Impl(IReferenceCounters* pRefCounters, + RenderDeviceD3D11Impl* pDevice, + const FenceDesc& Desc) : TFenceBase(pRefCounters, pDevice, Desc) { } diff --git a/Graphics/GraphicsEngineD3D11/src/TextureViewD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/TextureViewD3D11Impl.cpp index f24e2661..9af2324c 100644 --- a/Graphics/GraphicsEngineD3D11/src/TextureViewD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/TextureViewD3D11Impl.cpp @@ -29,7 +29,7 @@ namespace Diligent { TextureViewD3D11Impl::TextureViewD3D11Impl( IReferenceCounters* pRefCounters, - IRenderDevice* pDevice, + RenderDeviceD3D11Impl* pDevice, const TextureViewDesc& ViewDesc, ITexture* pTexture, ID3D11View* pD3D11View, |
