diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-07-25 04:31:09 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-07-25 04:31:09 +0000 |
| commit | c746f802d7b23d9c5ee0f52a7e5428a32bf3f316 (patch) | |
| tree | 344b4a987341150fda9fd7f8642b902e9f96df71 /Graphics/GraphicsEngineD3D11 | |
| parent | Fixed performance issue with resetting unchanged vertex buffers (diff) | |
| download | DiligentCore-c746f802d7b23d9c5ee0f52a7e5428a32bf3f316.tar.gz DiligentCore-c746f802d7b23d9c5ee0f52a7e5428a32bf3f316.zip | |
Updated DeviceContextBase to use final types for pipeline state, buffers and texture views
Diffstat (limited to 'Graphics/GraphicsEngineD3D11')
12 files changed, 21 insertions, 15 deletions
diff --git a/Graphics/GraphicsEngineD3D11/include/BufferD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/BufferD3D11Impl.h index 69ae864d..1a37c0d8 100644 --- a/Graphics/GraphicsEngineD3D11/include/BufferD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/BufferD3D11Impl.h @@ -51,7 +51,7 @@ enum class D3D11BufferState class BufferD3D11Impl : public BufferBase<IBufferD3D11, BufferViewD3D11Impl, FixedBlockMemoryAllocator> { public: - typedef BufferBase<IBufferD3D11, BufferViewD3D11Impl, FixedBlockMemoryAllocator> TBufferBase; + using TBufferBase = BufferBase<IBufferD3D11, BufferViewD3D11Impl, FixedBlockMemoryAllocator>; BufferD3D11Impl(IReferenceCounters* pRefCounters, FixedBlockMemoryAllocator& BuffViewObjMemAllocator, diff --git a/Graphics/GraphicsEngineD3D11/include/BufferViewD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/BufferViewD3D11Impl.h index da91f747..7b875fa8 100644 --- a/Graphics/GraphicsEngineD3D11/include/BufferViewD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/BufferViewD3D11Impl.h @@ -38,7 +38,7 @@ class FixedBlockMemoryAllocator; class BufferViewD3D11Impl : public BufferViewBase<IBufferViewD3D11> { public: - typedef BufferViewBase<IBufferViewD3D11> TBufferViewBase; + using TBufferViewBase = BufferViewBase<IBufferViewD3D11>; BufferViewD3D11Impl( IReferenceCounters* pRefCounters, IRenderDevice* pDevice, diff --git a/Graphics/GraphicsEngineD3D11/include/CommandListD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/CommandListD3D11Impl.h index d2a596d2..24235560 100644 --- a/Graphics/GraphicsEngineD3D11/include/CommandListD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/CommandListD3D11Impl.h @@ -38,7 +38,8 @@ class FixedBlockMemoryAllocator; class CommandListD3D11Impl : public CommandListBase<ICommandList> { public: - typedef CommandListBase<ICommandList> TCommandListBase; + using TCommandListBase = CommandListBase<ICommandList>; + CommandListD3D11Impl(IReferenceCounters* pRefCounters, IRenderDevice* pDevice, ID3D11CommandList* pd3d11CommandList); diff --git a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h index 7d30761c..469dd621 100644 --- a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h @@ -29,6 +29,9 @@ #include "DeviceContextD3D11.h" #include "DeviceContextBase.h" #include "ShaderD3D11Impl.h" +#include "BufferD3D11Impl.h" +#include "TextureViewD3D11Impl.h" +#include "PipelineStateD3D11Impl.h" #ifdef _DEBUG # define VERIFY_CONTEXT_BINDINGS @@ -38,10 +41,10 @@ namespace Diligent { /// Implementation of the Diligent::IDeviceContextD3D11 interface -class DeviceContextD3D11Impl : public DeviceContextBase<IDeviceContextD3D11> +class DeviceContextD3D11Impl : public DeviceContextBase<IDeviceContextD3D11, BufferD3D11Impl, TextureViewD3D11Impl, PipelineStateD3D11Impl> { public: - typedef DeviceContextBase<IDeviceContextD3D11> TDeviceContextBase; + using TDeviceContextBase = DeviceContextBase<IDeviceContextD3D11, BufferD3D11Impl, TextureViewD3D11Impl, PipelineStateD3D11Impl>; DeviceContextD3D11Impl(IReferenceCounters* pRefCounters, IMemoryAllocator& Allocator, diff --git a/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h index 2180cc0a..04d0d8e6 100644 --- a/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.h @@ -40,7 +40,7 @@ class FixedBlockMemoryAllocator; class PipelineStateD3D11Impl : public PipelineStateBase<IPipelineStateD3D11, IRenderDeviceD3D11> { public: - typedef PipelineStateBase<IPipelineStateD3D11, IRenderDeviceD3D11> TPipelineStateBase; + using TPipelineStateBase = PipelineStateBase<IPipelineStateD3D11, IRenderDeviceD3D11>; PipelineStateD3D11Impl(IReferenceCounters* pRefCounters, class RenderDeviceD3D11Impl* pDeviceD3D11, diff --git a/Graphics/GraphicsEngineD3D11/include/RenderDeviceD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/RenderDeviceD3D11Impl.h index 4ab28877..28f65829 100644 --- a/Graphics/GraphicsEngineD3D11/include/RenderDeviceD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/RenderDeviceD3D11Impl.h @@ -38,7 +38,7 @@ namespace Diligent class RenderDeviceD3D11Impl : public RenderDeviceD3DBase<IRenderDeviceD3D11> { public: - typedef RenderDeviceD3DBase<IRenderDeviceD3D11> TRenderDeviceBase; + using TRenderDeviceBase = RenderDeviceD3DBase<IRenderDeviceD3D11>; RenderDeviceD3D11Impl( IReferenceCounters* pRefCounters, IMemoryAllocator& RawMemAllocator, diff --git a/Graphics/GraphicsEngineD3D11/include/SamplerD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/SamplerD3D11Impl.h index 6aa5ed43..2d060515 100644 --- a/Graphics/GraphicsEngineD3D11/include/SamplerD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/SamplerD3D11Impl.h @@ -38,7 +38,7 @@ class FixedBlockMemoryAllocator; class SamplerD3D11Impl : public SamplerBase<ISamplerD3D11, IRenderDeviceD3D11> { public: - typedef SamplerBase<ISamplerD3D11, IRenderDeviceD3D11> TSamplerBase; + using TSamplerBase = SamplerBase<ISamplerD3D11, IRenderDeviceD3D11>; SamplerD3D11Impl(IReferenceCounters* pRefCounters, class RenderDeviceD3D11Impl* pRenderDeviceD3D11, diff --git a/Graphics/GraphicsEngineD3D11/include/ShaderD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/ShaderD3D11Impl.h index 6823dbb0..53d6d209 100644 --- a/Graphics/GraphicsEngineD3D11/include/ShaderD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/ShaderD3D11Impl.h @@ -45,7 +45,7 @@ class ResourceMapping; class ShaderD3D11Impl : public ShaderBase<IShaderD3D11, IRenderDeviceD3D11>, public ShaderD3DBase { public: - typedef ShaderBase<IShaderD3D11, IRenderDeviceD3D11> TShaderBase; + using TShaderBase = ShaderBase<IShaderD3D11, IRenderDeviceD3D11>; ShaderD3D11Impl(IReferenceCounters* pRefCounters, class RenderDeviceD3D11Impl* pRenderDeviceD3D11, diff --git a/Graphics/GraphicsEngineD3D11/include/ShaderResourceBindingD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/ShaderResourceBindingD3D11Impl.h index bb29591c..d85cde13 100644 --- a/Graphics/GraphicsEngineD3D11/include/ShaderResourceBindingD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/ShaderResourceBindingD3D11Impl.h @@ -41,7 +41,8 @@ class FixedBlockMemoryAllocator; class ShaderResourceBindingD3D11Impl : public ShaderResourceBindingBase<IShaderResourceBindingD3D11> { public: - typedef ShaderResourceBindingBase<IShaderResourceBindingD3D11> TBase; + using TBase = ShaderResourceBindingBase<IShaderResourceBindingD3D11>; + ShaderResourceBindingD3D11Impl(IReferenceCounters* pRefCounters, class PipelineStateD3D11Impl* pPSO, bool IsInternal); diff --git a/Graphics/GraphicsEngineD3D11/include/SwapChainD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/SwapChainD3D11Impl.h index 1f6a3325..cc9abd44 100644 --- a/Graphics/GraphicsEngineD3D11/include/SwapChainD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/SwapChainD3D11Impl.h @@ -38,6 +38,7 @@ class SwapChainD3D11Impl : public SwapChainD3DBase<ISwapChainD3D11, IDXGISwapCha { public: using TSwapChainBase = SwapChainD3DBase<ISwapChainD3D11, IDXGISwapChain>; + SwapChainD3D11Impl(IReferenceCounters* pRefCounters, const SwapChainDesc& SCDesc, const FullScreenModeDesc& FSDesc, diff --git a/Graphics/GraphicsEngineD3D11/include/TextureViewD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/TextureViewD3D11Impl.h index 3dca4273..b4882089 100644 --- a/Graphics/GraphicsEngineD3D11/include/TextureViewD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/TextureViewD3D11Impl.h @@ -39,7 +39,7 @@ class FixedBlockMemoryAllocator; class TextureViewD3D11Impl : public TextureViewBase<ITextureViewD3D11> { public: - typedef TextureViewBase<ITextureViewD3D11> TTextureViewBase; + using TTextureViewBase = TextureViewBase<ITextureViewD3D11>; TextureViewD3D11Impl( IReferenceCounters* pRefCounters, IRenderDevice* pDevice, diff --git a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp index 1af4d49e..0692c48c 100644 --- a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp @@ -541,7 +541,7 @@ namespace Diligent void DeviceContextD3D11Impl::CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding, Uint32 Flags) { - if( !DeviceContextBase::CommitShaderResources<PipelineStateD3D11Impl>(pShaderResourceBinding, Flags, 0 /*Dummy*/) ) + if( !DeviceContextBase::CommitShaderResources(pShaderResourceBinding, Flags, 0 /*Dummy*/) ) return; if(Flags & COMMIT_SHADER_RESOURCES_FLAG_TRANSITION_RESOURCES) @@ -555,7 +555,7 @@ namespace Diligent if (TDeviceContextBase::SetStencilRef(StencilRef, 0)) { ID3D11DepthStencilState* pd3d11DSS = - m_pPipelineState ? m_pPipelineState.RawPtr<PipelineStateD3D11Impl>()->GetD3D11DepthStencilState() : nullptr; + m_pPipelineState ? m_pPipelineState->GetD3D11DepthStencilState() : nullptr; m_pd3d11DeviceContext->OMSetDepthStencilState( pd3d11DSS, m_StencilRef ); } } @@ -570,7 +570,7 @@ namespace Diligent if(m_pPipelineState) { SampleMask = m_pPipelineState->GetDesc().GraphicsPipeline.SampleMask; - pd3d11BS = m_pPipelineState.RawPtr<PipelineStateD3D11Impl>()->GetD3D11BlendState(); + pd3d11BS = m_pPipelineState->GetD3D11BlendState(); } m_pd3d11DeviceContext->OMSetBlendState(pd3d11BS, m_BlendFactors, SampleMask); } @@ -683,7 +683,7 @@ namespace Diligent } #endif - auto* pPipelineStateD3D11 = m_pPipelineState.RawPtr<PipelineStateD3D11Impl>(); + auto* pPipelineStateD3D11 = m_pPipelineState.RawPtr(); #ifdef _DEBUG if (pPipelineStateD3D11->GetDesc().IsComputePipeline) { |
