From c746f802d7b23d9c5ee0f52a7e5428a32bf3f316 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Tue, 24 Jul 2018 21:31:09 -0700 Subject: Updated DeviceContextBase to use final types for pipeline state, buffers and texture views --- Graphics/GraphicsEngineD3D12/include/BufferD3D12Impl.h | 3 ++- Graphics/GraphicsEngineD3D12/include/BufferViewD3D12Impl.h | 2 +- Graphics/GraphicsEngineD3D12/include/CommandListD3D12Impl.h | 3 ++- Graphics/GraphicsEngineD3D12/include/CommandQueueD3D12Impl.h | 2 +- .../GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h | 8 +++++--- .../GraphicsEngineD3D12/include/PipelineStateD3D12Impl.h | 2 +- Graphics/GraphicsEngineD3D12/include/RenderDeviceD3D12Impl.h | 2 +- Graphics/GraphicsEngineD3D12/include/SamplerD3D12Impl.h | 2 +- Graphics/GraphicsEngineD3D12/include/ShaderD3D12Impl.h | 2 +- .../include/ShaderResourceBindingD3D12Impl.h | 3 ++- Graphics/GraphicsEngineD3D12/include/SwapChainD3D12Impl.h | 1 + Graphics/GraphicsEngineD3D12/include/TextureD3D12Impl.h | 2 +- Graphics/GraphicsEngineD3D12/include/TextureViewD3D12Impl.h | 2 +- Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp | 12 +++++------- 14 files changed, 25 insertions(+), 21 deletions(-) (limited to 'Graphics/GraphicsEngineD3D12') diff --git a/Graphics/GraphicsEngineD3D12/include/BufferD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/BufferD3D12Impl.h index 51ac7489..9a804c0c 100644 --- a/Graphics/GraphicsEngineD3D12/include/BufferD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/BufferD3D12Impl.h @@ -42,7 +42,8 @@ class FixedBlockMemoryAllocator; class BufferD3D12Impl : public BufferBase, public D3D12ResourceBase { public: - typedef BufferBase TBufferBase; + using TBufferBase = BufferBase; + BufferD3D12Impl(IReferenceCounters* pRefCounters, FixedBlockMemoryAllocator& BuffViewObjMemAllocator, class RenderDeviceD3D12Impl* pDeviceD3D12, diff --git a/Graphics/GraphicsEngineD3D12/include/BufferViewD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/BufferViewD3D12Impl.h index 7a8336d6..8b074440 100644 --- a/Graphics/GraphicsEngineD3D12/include/BufferViewD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/BufferViewD3D12Impl.h @@ -39,7 +39,7 @@ class FixedBlockMemoryAllocator; class BufferViewD3D12Impl : public BufferViewBase { public: - typedef BufferViewBase TBufferViewBase; + using TBufferViewBase = BufferViewBase; BufferViewD3D12Impl( IReferenceCounters* pRefCounters, IRenderDevice* pDevice, diff --git a/Graphics/GraphicsEngineD3D12/include/CommandListD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/CommandListD3D12Impl.h index bf97df8c..767abf3b 100644 --- a/Graphics/GraphicsEngineD3D12/include/CommandListD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/CommandListD3D12Impl.h @@ -35,7 +35,8 @@ namespace Diligent class CommandListD3D12Impl : public CommandListBase { public: - typedef CommandListBase TCommandListBase; + using TCommandListBase = CommandListBase; + CommandListD3D12Impl(IReferenceCounters* pRefCounters, IRenderDevice* pDevice, class CommandContext* pCmdContext) : diff --git a/Graphics/GraphicsEngineD3D12/include/CommandQueueD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/CommandQueueD3D12Impl.h index 0db94e2b..d30fa2b4 100644 --- a/Graphics/GraphicsEngineD3D12/include/CommandQueueD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/CommandQueueD3D12Impl.h @@ -36,7 +36,7 @@ namespace Diligent class CommandQueueD3D12Impl : public ObjectBase { public: - typedef ObjectBase TBase; + using TBase = ObjectBase; CommandQueueD3D12Impl(IReferenceCounters *pRefCounters, ID3D12CommandQueue *pd3d12NativeCmdQueue, ID3D12Fence *pd3d12Fence); ~CommandQueueD3D12Impl(); diff --git a/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h index 785c6f32..2dfdfacf 100644 --- a/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h @@ -29,7 +29,9 @@ #include "DeviceContextD3D12.h" #include "DeviceContextBase.h" #include "GenerateMips.h" - +#include "BufferD3D12Impl.h" +#include "TextureViewD3D12Impl.h" +#include "PipelineStateD3D12Impl.h" #ifdef _DEBUG # define VERIFY_CONTEXT_BINDINGS #endif @@ -38,10 +40,10 @@ namespace Diligent { /// Implementation of the Diligent::IDeviceContext interface -class DeviceContextD3D12Impl : public DeviceContextBase +class DeviceContextD3D12Impl : public DeviceContextBase { public: - typedef DeviceContextBase TDeviceContextBase; + using TDeviceContextBase = DeviceContextBase; DeviceContextD3D12Impl(IReferenceCounters* pRefCounters, class RenderDeviceD3D12Impl* pDevice, diff --git a/Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.h index f4aed5d4..d0525325 100644 --- a/Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/PipelineStateD3D12Impl.h @@ -42,7 +42,7 @@ class FixedBlockMemoryAllocator; class PipelineStateD3D12Impl : public PipelineStateBase { public: - typedef PipelineStateBase TPipelineStateBase; + using TPipelineStateBase = PipelineStateBase; PipelineStateD3D12Impl( IReferenceCounters *pRefCounters, class RenderDeviceD3D12Impl *pDeviceD3D12, const PipelineStateDesc &PipelineDesc ); ~PipelineStateD3D12Impl(); diff --git a/Graphics/GraphicsEngineD3D12/include/RenderDeviceD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/RenderDeviceD3D12Impl.h index 34b8f864..e0e947f9 100644 --- a/Graphics/GraphicsEngineD3D12/include/RenderDeviceD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/RenderDeviceD3D12Impl.h @@ -44,7 +44,7 @@ namespace Diligent class RenderDeviceD3D12Impl : public RenderDeviceD3DBase { public: - typedef RenderDeviceD3DBase TRenderDeviceBase; + using TRenderDeviceBase = RenderDeviceD3DBase; RenderDeviceD3D12Impl( IReferenceCounters* pRefCounters, IMemoryAllocator& RawMemAllocator, diff --git a/Graphics/GraphicsEngineD3D12/include/SamplerD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/SamplerD3D12Impl.h index 0c34888c..65813e83 100644 --- a/Graphics/GraphicsEngineD3D12/include/SamplerD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/SamplerD3D12Impl.h @@ -39,7 +39,7 @@ class FixedBlockMemoryAllocator; class SamplerD3D12Impl : public SamplerBase { public: - typedef SamplerBase TSamplerBase; + using TSamplerBase = SamplerBase; SamplerD3D12Impl(IReferenceCounters* pRefCounters, class RenderDeviceD3D12Impl* pRenderDeviceD3D12, diff --git a/Graphics/GraphicsEngineD3D12/include/ShaderD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/ShaderD3D12Impl.h index fc61928b..5005f9d6 100644 --- a/Graphics/GraphicsEngineD3D12/include/ShaderD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/ShaderD3D12Impl.h @@ -46,7 +46,7 @@ class FixedBlockMemoryAllocator; class ShaderD3D12Impl : public ShaderBase, public ShaderD3DBase { public: - typedef ShaderBase TShaderBase; + using TShaderBase = ShaderBase; ShaderD3D12Impl(IReferenceCounters* pRefCounters, class RenderDeviceD3D12Impl* pRenderDeviceD3D12, diff --git a/Graphics/GraphicsEngineD3D12/include/ShaderResourceBindingD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/ShaderResourceBindingD3D12Impl.h index a87b4b91..b9b39487 100644 --- a/Graphics/GraphicsEngineD3D12/include/ShaderResourceBindingD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/ShaderResourceBindingD3D12Impl.h @@ -41,7 +41,8 @@ class FixedBlockMemoryAllocator; class ShaderResourceBindingD3D12Impl : public ShaderResourceBindingBase { public: - typedef ShaderResourceBindingBase TBase; + using TBase = ShaderResourceBindingBase; + ShaderResourceBindingD3D12Impl(IReferenceCounters* pRefCounters, class PipelineStateD3D12Impl* pPSO, bool IsPSOInternal); diff --git a/Graphics/GraphicsEngineD3D12/include/SwapChainD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/SwapChainD3D12Impl.h index 9cca636e..30153804 100644 --- a/Graphics/GraphicsEngineD3D12/include/SwapChainD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/SwapChainD3D12Impl.h @@ -40,6 +40,7 @@ class SwapChainD3D12Impl : public SwapChainD3DBase; + SwapChainD3D12Impl(IReferenceCounters* pRefCounters, const SwapChainDesc& SwapChainDesc, const FullScreenModeDesc& FSDesc, diff --git a/Graphics/GraphicsEngineD3D12/include/TextureD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/TextureD3D12Impl.h index 86cc6f0e..46d88f6c 100644 --- a/Graphics/GraphicsEngineD3D12/include/TextureD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/TextureD3D12Impl.h @@ -42,7 +42,7 @@ class FixedBlockMemoryAllocator; class TextureD3D12Impl : public TextureBase, public D3D12ResourceBase { public: - typedef TextureBase TTextureBase; + using TTextureBase = TextureBase; // Creates a new D3D12 resource TextureD3D12Impl(IReferenceCounters* pRefCounters, diff --git a/Graphics/GraphicsEngineD3D12/include/TextureViewD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/TextureViewD3D12Impl.h index 072446d9..219fedf5 100644 --- a/Graphics/GraphicsEngineD3D12/include/TextureViewD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/TextureViewD3D12Impl.h @@ -39,7 +39,7 @@ class FixedBlockMemoryAllocator; class TextureViewD3D12Impl : public TextureViewBase { public: - typedef TextureViewBase TTextureViewBase; + using TTextureViewBase = TextureViewBase; TextureViewD3D12Impl( IReferenceCounters* pRefCounters, IRenderDevice* pDevice, diff --git a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp index 4484d615..f490ff9a 100644 --- a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp @@ -170,13 +170,11 @@ namespace Diligent void DeviceContextD3D12Impl::CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding, Uint32 Flags) { - if (!DeviceContextBase::CommitShaderResources(pShaderResourceBinding, Flags, 0 /*Dummy*/)) + if (!DeviceContextBase::CommitShaderResources(pShaderResourceBinding, Flags, 0 /*Dummy*/)) return; auto *pCtx = RequestCmdContext(); - auto *pPipelineStateD3D12 = m_pPipelineState.RawPtr(); - - m_pCommittedResourceCache = pPipelineStateD3D12->CommitAndTransitionShaderResources(pShaderResourceBinding, *pCtx, true, (Flags & COMMIT_SHADER_RESOURCES_FLAG_TRANSITION_RESOURCES)!=0); + m_pCommittedResourceCache = m_pPipelineState->CommitAndTransitionShaderResources(pShaderResourceBinding, *pCtx, true, (Flags & COMMIT_SHADER_RESOURCES_FLAG_TRANSITION_RESOURCES)!=0); } void DeviceContextD3D12Impl::SetStencilRef(Uint32 StencilRef) @@ -261,7 +259,7 @@ namespace Diligent void DeviceContextD3D12Impl::CommitD3D12VertexBuffers(GraphicsContext& GraphCtx) { - auto *pPipelineStateD3D12 = m_pPipelineState.RawPtr(); + auto *pPipelineStateD3D12 = m_pPipelineState.RawPtr(); // Do not initialize array with zeroes for performance reasons D3D12_VERTEX_BUFFER_VIEW VBViews[MaxBufferSlots];// = {} @@ -336,7 +334,7 @@ namespace Diligent CommitD3D12IndexBuffer(DrawAttribs.IndexType); } - auto *pPipelineStateD3D12 = m_pPipelineState.RawPtr(); + auto *pPipelineStateD3D12 = m_pPipelineState.RawPtr(); if(m_bCommittedD3D12VBsUpToDate) TransitionD3D12VertexBuffers(GraphCtx); @@ -398,7 +396,7 @@ namespace Diligent } #endif - auto *pPipelineStateD3D12 = m_pPipelineState.RawPtr(); + auto *pPipelineStateD3D12 = m_pPipelineState.RawPtr(); auto &ComputeCtx = RequestCmdContext()->AsComputeContext(); ComputeCtx.SetRootSignature( pPipelineStateD3D12->GetD3D12RootSignature() ); -- cgit v1.2.3