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 --- .../GraphicsEngine/include/DeviceContextBase.h | 110 +++++++++++---------- .../GraphicsEngineD3D11/include/BufferD3D11Impl.h | 2 +- .../include/BufferViewD3D11Impl.h | 2 +- .../include/CommandListD3D11Impl.h | 3 +- .../include/DeviceContextD3D11Impl.h | 7 +- .../include/PipelineStateD3D11Impl.h | 2 +- .../include/RenderDeviceD3D11Impl.h | 2 +- .../GraphicsEngineD3D11/include/SamplerD3D11Impl.h | 2 +- .../GraphicsEngineD3D11/include/ShaderD3D11Impl.h | 2 +- .../include/ShaderResourceBindingD3D11Impl.h | 3 +- .../include/SwapChainD3D11Impl.h | 1 + .../include/TextureViewD3D11Impl.h | 2 +- .../src/DeviceContextD3D11Impl.cpp | 8 +- .../GraphicsEngineD3D12/include/BufferD3D12Impl.h | 3 +- .../include/BufferViewD3D12Impl.h | 2 +- .../include/CommandListD3D12Impl.h | 3 +- .../include/CommandQueueD3D12Impl.h | 2 +- .../include/DeviceContextD3D12Impl.h | 8 +- .../include/PipelineStateD3D12Impl.h | 2 +- .../include/RenderDeviceD3D12Impl.h | 2 +- .../GraphicsEngineD3D12/include/SamplerD3D12Impl.h | 2 +- .../GraphicsEngineD3D12/include/ShaderD3D12Impl.h | 2 +- .../include/ShaderResourceBindingD3D12Impl.h | 3 +- .../include/SwapChainD3D12Impl.h | 1 + .../GraphicsEngineD3D12/include/TextureD3D12Impl.h | 2 +- .../include/TextureViewD3D12Impl.h | 2 +- .../src/DeviceContextD3D12Impl.cpp | 12 +-- .../GraphicsEngineOpenGL/include/BufferGLImpl.h | 2 +- .../include/BufferViewGLImpl.h | 2 +- .../include/DeviceContextGLImpl.h | 7 +- .../include/PipelineStateGLImpl.h | 2 +- .../include/RenderDeviceGLImpl.h | 2 +- .../GraphicsEngineOpenGL/include/SamplerGLImpl.h | 2 +- .../GraphicsEngineOpenGL/include/ShaderGLImpl.h | 2 +- .../include/ShaderResourceBindingGLImpl.h | 3 +- .../GraphicsEngineOpenGL/include/SwapChainGLImpl.h | 2 +- .../GraphicsEngineOpenGL/include/TextureBaseGL.h | 2 +- .../include/TextureViewGLImpl.h | 2 +- .../src/DeviceContextGLImpl.cpp | 6 +- .../include/BufferViewVkImpl.h | 2 +- .../GraphicsEngineVulkan/include/BufferVkImpl.h | 3 +- .../include/CommandListVkImpl.h | 3 +- .../include/CommandQueueVkImpl.h | 2 +- .../include/DeviceContextVkImpl.h | 7 +- .../include/PipelineStateVkImpl.h | 2 +- .../include/RenderDeviceVkImpl.h | 2 +- .../GraphicsEngineVulkan/include/SamplerVkImpl.h | 2 +- .../include/ShaderResourceBindingVkImpl.h | 3 +- .../GraphicsEngineVulkan/include/ShaderVkImpl.h | 2 +- .../GraphicsEngineVulkan/include/SwapChainVkImpl.h | 3 +- .../include/TextureViewVkImpl.h | 2 +- .../GraphicsEngineVulkan/include/TextureVkImpl.h | 2 +- .../src/DeviceContextVkImpl.cpp | 14 ++- 53 files changed, 150 insertions(+), 125 deletions(-) (limited to 'Graphics') diff --git a/Graphics/GraphicsEngine/include/DeviceContextBase.h b/Graphics/GraphicsEngine/include/DeviceContextBase.h index aae0ef1f..1a291a10 100644 --- a/Graphics/GraphicsEngine/include/DeviceContextBase.h +++ b/Graphics/GraphicsEngine/include/DeviceContextBase.h @@ -50,17 +50,22 @@ struct VertexStreamInfo /// Base implementation of the device context. -/// \tparam BaseInterface - base interface that this class will inheret. +/// \tparam BaseInterface - base interface that this class will inheret. +/// \tparam BufferImplType - buffer implemenation type (BufferD3D11Impl, BufferD3D12Impl, etc.) +/// \tparam TextureViewImplType - texture view implemenation type (TextureViewD3D11Impl, TextureViewD3D12Impl, etc.) +/// \tparam PipelineStateImplType - pipeline state implementation type (PipelineStateD3D11Impl, PipelineStateD3D12Impl, etc.) /// \remarks Device context keeps strong references to all objects currently bound to /// the pipeline: buffers, states, samplers, shaders, etc. /// The context also keeps strong references to the device and /// the swap chain. -template +template class DeviceContextBase : public ObjectBase { public: - - typedef ObjectBase TObjectBase; + using TObjectBase = ObjectBase; /// \param pRefCounters - reference counters object that controls the lifetime of this device context. /// \param pRenderDevice - render device. @@ -88,7 +93,6 @@ public: inline virtual void SetPipelineState(IPipelineState* pPipelineState)override = 0; /// Base implementation of IDeviceContext::CommitShaderResources(); validates parameters. - template inline bool CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding, Uint32 Flags, int); /// Base implementation of IDeviceContext::SetIndexBuffer(); caches the strong reference to the index buffer @@ -150,11 +154,13 @@ protected: /// Number of bound vertex streams Uint32 m_NumVertexStreams = 0; - /// Strong reference to the bound pipeline state object - RefCntAutoPtr m_pPipelineState; + /// Strong reference to the bound pipeline state object. + /// Use final PSO implementation type to avoid virtual calls to AddRef()/Release() + RefCntAutoPtr m_pPipelineState; - /// Strong reference to the bound index buffer - RefCntAutoPtr m_pIndexBuffer; + /// Strong reference to the bound index buffer. + /// Use final buffer implementation type to avoid virtual calls to AddRef()/Release() + RefCntAutoPtr m_pIndexBuffer; /// Offset from the beginning of the index buffer to the start of the index data, in bytes. Uint32 m_IndexDataStartOffset = 0; @@ -175,8 +181,9 @@ protected: /// Number of current scissor rects Uint32 m_NumScissorRects = 0; - /// Vector of strong references to the bound render targets - RefCntAutoPtr m_pBoundRenderTargets[MaxRenderTargets]; + /// Vector of strong references to the bound render targets. + /// Use final texture view implementation type to avoid virtual calls to AddRef()/Release() + RefCntAutoPtr m_pBoundRenderTargets[MaxRenderTargets]; /// Number of bound render targets Uint32 m_NumBoundRenderTargets = 0; /// Width of the currently bound framebuffer @@ -189,15 +196,16 @@ protected: /// buffer are currently bound bool m_IsDefaultFramebufferBound = false; - /// Strong references to the bound depth stencil view - RefCntAutoPtr m_pBoundDepthStencil; + /// Strong references to the bound depth stencil view. + /// Use final texture view implementation type to avoid virtual calls to AddRef()/Release() + RefCntAutoPtr m_pBoundDepthStencil; const bool m_bIsDeferred = false; }; -template -inline void DeviceContextBase :: SetVertexBuffers( Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer** ppBuffers, Uint32* pOffsets, Uint32 Flags ) +template +inline void DeviceContextBase :: SetVertexBuffers( Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer** ppBuffers, Uint32* pOffsets, Uint32 Flags ) { #ifdef DEVELOPMENT if ( StartSlot >= MaxBufferSlots ) @@ -247,15 +255,14 @@ inline void DeviceContextBase :: SetVertexBuffers( Uint32 StartSl m_VertexStreams[m_NumVertexStreams--] = VertexStreamInfo{}; } -template -inline void DeviceContextBase :: SetPipelineState(IPipelineState* pPipelineState) +template +inline void DeviceContextBase :: SetPipelineState(IPipelineState* pPipelineState) { - m_pPipelineState = pPipelineState; + m_pPipelineState = ValidatedCast(pPipelineState); } -template -template -inline bool DeviceContextBase :: CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding, Uint32 Flags, int) +template +inline bool DeviceContextBase :: CommitShaderResources(IShaderResourceBinding* pShaderResourceBinding, Uint32 Flags, int) { #ifdef DEVELOPMENT if (!m_pPipelineState) @@ -266,8 +273,7 @@ inline bool DeviceContextBase :: CommitShaderResources(IShaderRes if (pShaderResourceBinding) { - auto* pPSOImpl = m_pPipelineState.RawPtr(); - if (pPSOImpl->IsIncompatibleWith(pShaderResourceBinding->GetPipelineState())) + if (m_pPipelineState->IsIncompatibleWith(pShaderResourceBinding->GetPipelineState())) { LOG_ERROR_MESSAGE("Shader resource binding object is not compatible with the currently bound pipeline state"); return false; @@ -277,20 +283,20 @@ inline bool DeviceContextBase :: CommitShaderResources(IShaderRes return true; } -template -inline void DeviceContextBase :: InvalidateState() +template +inline void DeviceContextBase :: InvalidateState() { - DeviceContextBase :: ClearStateCache(); + DeviceContextBase :: ClearStateCache(); m_IsDefaultFramebufferBound = false; } -template -inline void DeviceContextBase :: SetIndexBuffer( IBuffer* pIndexBuffer, Uint32 ByteOffset ) +template +inline void DeviceContextBase :: SetIndexBuffer( IBuffer* pIndexBuffer, Uint32 ByteOffset ) { - m_pIndexBuffer = pIndexBuffer; + m_pIndexBuffer = ValidatedCast(pIndexBuffer); m_IndexDataStartOffset = ByteOffset; #ifdef DEVELOPMENT - const auto &BuffDesc = m_pIndexBuffer->GetDesc(); + const auto& BuffDesc = m_pIndexBuffer->GetDesc(); if ( !(BuffDesc.BindFlags & BIND_INDEX_BUFFER) ) { LOG_ERROR_MESSAGE( "Buffer \"", BuffDesc.Name ? BuffDesc.Name : "", "\" being bound as index buffer was not created with BIND_INDEX_BUFFER flag" ); @@ -299,8 +305,8 @@ inline void DeviceContextBase :: SetIndexBuffer( IBuffer* pIndexB } -template -inline void DeviceContextBase :: GetPipelineState(IPipelineState** ppPSO, float* BlendFactors, Uint32& StencilRef) +template +inline void DeviceContextBase :: GetPipelineState(IPipelineState** ppPSO, float* BlendFactors, Uint32& StencilRef) { VERIFY( ppPSO != nullptr, "Null pointer provided null" ); VERIFY(* ppPSO == nullptr, "Memory address contains a pointer to a non-null blend state" ); @@ -318,8 +324,8 @@ inline void DeviceContextBase :: GetPipelineState(IPipelineState* StencilRef = m_StencilRef; }; -template -inline bool DeviceContextBase ::SetBlendFactors(const float* BlendFactors, int) +template +inline bool DeviceContextBase ::SetBlendFactors(const float* BlendFactors, int) { bool FactorsDiffer = false; for( Uint32 f = 0; f < 4; ++f ) @@ -331,8 +337,8 @@ inline bool DeviceContextBase ::SetBlendFactors(const float* Blen return FactorsDiffer; } -template -inline bool DeviceContextBase :: SetStencilRef(Uint32 StencilRef, int) +template +inline bool DeviceContextBase :: SetStencilRef(Uint32 StencilRef, int) { if (m_StencilRef != StencilRef) { @@ -342,8 +348,8 @@ inline bool DeviceContextBase :: SetStencilRef(Uint32 StencilRef, return false; } -template -inline void DeviceContextBase :: SetViewports( Uint32 NumViewports, const Viewport* pViewports, Uint32& RTWidth, Uint32& RTHeight ) +template +inline void DeviceContextBase :: SetViewports( Uint32 NumViewports, const Viewport* pViewports, Uint32& RTWidth, Uint32& RTHeight ) { if ( RTWidth == 0 || RTHeight == 0 ) { @@ -370,8 +376,8 @@ inline void DeviceContextBase :: SetViewports( Uint32 NumViewport } } -template -inline void DeviceContextBase :: GetViewports( Uint32 &NumViewports, Viewport* pViewports ) +template +inline void DeviceContextBase :: GetViewports( Uint32 &NumViewports, Viewport* pViewports ) { NumViewports = m_NumViewports; if ( pViewports ) @@ -381,8 +387,8 @@ inline void DeviceContextBase :: GetViewports( Uint32 &NumViewpor } } -template -inline void DeviceContextBase :: SetScissorRects( Uint32 NumRects, const Rect* pRects, Uint32& RTWidth, Uint32& RTHeight ) +template +inline void DeviceContextBase :: SetScissorRects( Uint32 NumRects, const Rect* pRects, Uint32& RTWidth, Uint32& RTHeight ) { if ( RTWidth == 0 || RTHeight == 0 ) { @@ -401,8 +407,8 @@ inline void DeviceContextBase :: SetScissorRects( Uint32 NumRects } } -template -inline bool DeviceContextBase :: SetRenderTargets( Uint32 NumRenderTargets, ITextureView* ppRenderTargets[], ITextureView* pDepthStencil, Uint32 Dummy ) +template +inline bool DeviceContextBase :: SetRenderTargets( Uint32 NumRenderTargets, ITextureView* ppRenderTargets[], ITextureView* pDepthStencil, Uint32 Dummy ) { bool bBindRenderTargets = false; m_FramebufferWidth = 0; @@ -475,7 +481,7 @@ inline bool DeviceContextBase :: SetRenderTargets( Uint32 NumRend // can safely compare pointers. if ( m_pBoundRenderTargets[rt] != pRTView ) { - m_pBoundRenderTargets[rt] = pRTView; + m_pBoundRenderTargets[rt] = ValidatedCast(pRTView); bBindRenderTargets = true; } } @@ -513,7 +519,7 @@ inline bool DeviceContextBase :: SetRenderTargets( Uint32 NumRend if ( m_pBoundDepthStencil != pDepthStencil) { - m_pBoundDepthStencil = pDepthStencil; + m_pBoundDepthStencil = ValidatedCast(pDepthStencil); bBindRenderTargets = true; } @@ -523,8 +529,8 @@ inline bool DeviceContextBase :: SetRenderTargets( Uint32 NumRend return bBindRenderTargets; } -template -inline void DeviceContextBase :: GetRenderTargets( Uint32 &NumRenderTargets, ITextureView** ppRTVs, ITextureView** ppDSV ) +template +inline void DeviceContextBase :: GetRenderTargets( Uint32 &NumRenderTargets, ITextureView** ppRTVs, ITextureView** ppDSV ) { NumRenderTargets = m_NumBoundRenderTargets; @@ -556,8 +562,8 @@ inline void DeviceContextBase :: GetRenderTargets( Uint32 &NumRen } } -template -inline void DeviceContextBase :: ClearStateCache() +template +inline void DeviceContextBase :: ClearStateCache() { for(Uint32 stream=0; stream < m_NumVertexStreams; ++stream) m_VertexStreams[stream] = VertexStreamInfo(); @@ -591,8 +597,8 @@ inline void DeviceContextBase :: ClearStateCache() ResetRenderTargets(); } -template -inline void DeviceContextBase :: ResetRenderTargets() +template +inline void DeviceContextBase :: ResetRenderTargets() { for (Uint32 rt = 0; rt < m_NumBoundRenderTargets; ++rt) m_pBoundRenderTargets[rt].Release(); 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 { public: - typedef BufferBase TBufferBase; + using TBufferBase = BufferBase; 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 { public: - typedef BufferViewBase TBufferViewBase; + using TBufferViewBase = BufferViewBase; 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 { public: - typedef CommandListBase TCommandListBase; + using TCommandListBase = CommandListBase; + 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 +class DeviceContextD3D11Impl : public DeviceContextBase { public: - typedef DeviceContextBase TDeviceContextBase; + using TDeviceContextBase = DeviceContextBase; 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 { public: - typedef PipelineStateBase TPipelineStateBase; + using TPipelineStateBase = PipelineStateBase; 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 { public: - typedef RenderDeviceD3DBase TRenderDeviceBase; + using TRenderDeviceBase = RenderDeviceD3DBase; 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 { public: - typedef SamplerBase TSamplerBase; + using TSamplerBase = SamplerBase; 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, public ShaderD3DBase { public: - typedef ShaderBase TShaderBase; + using TShaderBase = ShaderBase; 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 { public: - typedef ShaderResourceBindingBase TBase; + using TBase = ShaderResourceBindingBase; + 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; + 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 { public: - typedef TextureViewBase TTextureViewBase; + using TTextureViewBase = TextureViewBase; 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(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()->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()->GetD3D11BlendState(); + pd3d11BS = m_pPipelineState->GetD3D11BlendState(); } m_pd3d11DeviceContext->OMSetBlendState(pd3d11BS, m_BlendFactors, SampleMask); } @@ -683,7 +683,7 @@ namespace Diligent } #endif - auto* pPipelineStateD3D11 = m_pPipelineState.RawPtr(); + auto* pPipelineStateD3D11 = m_pPipelineState.RawPtr(); #ifdef _DEBUG if (pPipelineStateD3D11->GetDesc().IsComputePipeline) { 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() ); diff --git a/Graphics/GraphicsEngineOpenGL/include/BufferGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/BufferGLImpl.h index cb0aa744..eb3b2de5 100644 --- a/Graphics/GraphicsEngineOpenGL/include/BufferGLImpl.h +++ b/Graphics/GraphicsEngineOpenGL/include/BufferGLImpl.h @@ -40,7 +40,7 @@ class FixedBlockMemoryAllocator; class BufferGLImpl : public BufferBase, public AsyncWritableResource { public: - typedef BufferBase TBufferBase; + using TBufferBase = BufferBase; BufferGLImpl(IReferenceCounters *pRefCounters, FixedBlockMemoryAllocator &BuffViewObjMemAllocator, diff --git a/Graphics/GraphicsEngineOpenGL/include/BufferViewGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/BufferViewGLImpl.h index c2a11c4a..28cca382 100644 --- a/Graphics/GraphicsEngineOpenGL/include/BufferViewGLImpl.h +++ b/Graphics/GraphicsEngineOpenGL/include/BufferViewGLImpl.h @@ -42,7 +42,7 @@ struct BufferViewDesc; class BufferViewGLImpl : public BufferViewBase { public: - typedef BufferViewBase TBuffViewBase; + using TBuffViewBase = BufferViewBase; BufferViewGLImpl( IReferenceCounters *pRefCounters, IRenderDevice *pDevice, diff --git a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h index f757f771..bff4710d 100644 --- a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h +++ b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h @@ -28,15 +28,18 @@ #include "BaseInterfacesGL.h" #include "GLContextState.h" #include "GLObjectWrapper.h" +#include "BufferGLImpl.h" +#include "TextureViewGLImpl.h" +#include "PipelineStateGLImpl.h" namespace Diligent { /// Implementation of the Diligent::IDeviceContextGL interface -class DeviceContextGLImpl : public DeviceContextBase +class DeviceContextGLImpl : public DeviceContextBase { public: - typedef DeviceContextBase TDeviceContextBase; + using TDeviceContextBase = DeviceContextBase; DeviceContextGLImpl( IReferenceCounters *pRefCounters, class RenderDeviceGLImpl *pDeviceGL, bool bIsDeferred ); diff --git a/Graphics/GraphicsEngineOpenGL/include/PipelineStateGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/PipelineStateGLImpl.h index 5aabba85..6e48b7b8 100644 --- a/Graphics/GraphicsEngineOpenGL/include/PipelineStateGLImpl.h +++ b/Graphics/GraphicsEngineOpenGL/include/PipelineStateGLImpl.h @@ -39,7 +39,7 @@ class FixedBlockMemoryAllocator; class PipelineStateGLImpl : public PipelineStateBase { public: - typedef PipelineStateBase TPipelineStateBase; + using TPipelineStateBase = PipelineStateBase; PipelineStateGLImpl(IReferenceCounters *pRefCounters, class RenderDeviceGLImpl *pDeviceGL, const PipelineStateDesc& PipelineDesc, bool IsDeviceInternal = false); ~PipelineStateGLImpl(); diff --git a/Graphics/GraphicsEngineOpenGL/include/RenderDeviceGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/RenderDeviceGLImpl.h index 36d611cd..adb0f833 100644 --- a/Graphics/GraphicsEngineOpenGL/include/RenderDeviceGLImpl.h +++ b/Graphics/GraphicsEngineOpenGL/include/RenderDeviceGLImpl.h @@ -52,7 +52,7 @@ namespace Diligent class RenderDeviceGLImpl : public RenderDeviceBase { public: - typedef RenderDeviceBase TRenderDeviceBase; + using TRenderDeviceBase = RenderDeviceBase; RenderDeviceGLImpl( IReferenceCounters *pRefCounters, IMemoryAllocator &RawMemAllocator, const EngineGLAttribs &InitAttribs ); ~RenderDeviceGLImpl(); diff --git a/Graphics/GraphicsEngineOpenGL/include/SamplerGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/SamplerGLImpl.h index 98dfe4be..19e3a480 100644 --- a/Graphics/GraphicsEngineOpenGL/include/SamplerGLImpl.h +++ b/Graphics/GraphicsEngineOpenGL/include/SamplerGLImpl.h @@ -37,7 +37,7 @@ class FixedBlockMemoryAllocator; class SamplerGLImpl : public SamplerBase { public: - typedef SamplerBase TSamplerBase; + using TSamplerBase = SamplerBase; SamplerGLImpl( IReferenceCounters *pRefCounters, class RenderDeviceGLImpl *pDeviceGL, const SamplerDesc& SamplerDesc, bool bIsDeviceInternal = false ); ~SamplerGLImpl(); diff --git a/Graphics/GraphicsEngineOpenGL/include/ShaderGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/ShaderGLImpl.h index fd9ac9b8..cf0116c5 100644 --- a/Graphics/GraphicsEngineOpenGL/include/ShaderGLImpl.h +++ b/Graphics/GraphicsEngineOpenGL/include/ShaderGLImpl.h @@ -67,7 +67,7 @@ inline GLenum ShaderTypeToGLShaderBit(SHADER_TYPE ShaderType) class ShaderGLImpl : public ShaderBase { public: - typedef ShaderBase TShaderBase; + using TShaderBase = ShaderBase; ShaderGLImpl( IReferenceCounters *pRefCounters, class RenderDeviceGLImpl *pDeviceGL, const ShaderCreationAttribs &ShaderCreationAttribs, bool bIsDeviceInternal = false ); ~ShaderGLImpl(); diff --git a/Graphics/GraphicsEngineOpenGL/include/ShaderResourceBindingGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/ShaderResourceBindingGLImpl.h index 53c1af98..61b9d013 100644 --- a/Graphics/GraphicsEngineOpenGL/include/ShaderResourceBindingGLImpl.h +++ b/Graphics/GraphicsEngineOpenGL/include/ShaderResourceBindingGLImpl.h @@ -40,7 +40,8 @@ class FixedBlockMemoryAllocator; class ShaderResourceBindingGLImpl : public ShaderResourceBindingBase { public: - typedef ShaderResourceBindingBase TBase; + using TBase = ShaderResourceBindingBase; + ShaderResourceBindingGLImpl(IReferenceCounters *pRefCounters, class PipelineStateGLImpl *pPSO); ~ShaderResourceBindingGLImpl(); diff --git a/Graphics/GraphicsEngineOpenGL/include/SwapChainGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/SwapChainGLImpl.h index f3c01d18..c37f736c 100644 --- a/Graphics/GraphicsEngineOpenGL/include/SwapChainGLImpl.h +++ b/Graphics/GraphicsEngineOpenGL/include/SwapChainGLImpl.h @@ -36,7 +36,7 @@ class IMemoryAllocator; class SwapChainGLImpl final : public SwapChainBase { public: - typedef SwapChainBase TSwapChainBase; + using TSwapChainBase = SwapChainBase; SwapChainGLImpl(IReferenceCounters *pRefCounters, const EngineGLAttribs &InitAttribs, diff --git a/Graphics/GraphicsEngineOpenGL/include/TextureBaseGL.h b/Graphics/GraphicsEngineOpenGL/include/TextureBaseGL.h index c0c5ca66..f8be69c2 100644 --- a/Graphics/GraphicsEngineOpenGL/include/TextureBaseGL.h +++ b/Graphics/GraphicsEngineOpenGL/include/TextureBaseGL.h @@ -41,7 +41,7 @@ class FixedBlockMemoryAllocator; class TextureBaseGL : public TextureBase, public AsyncWritableResource { public: - typedef TextureBase TTextureBase; + using TTextureBase = TextureBase; TextureBaseGL(IReferenceCounters *pRefCounters, FixedBlockMemoryAllocator& TexViewObjAllocator, diff --git a/Graphics/GraphicsEngineOpenGL/include/TextureViewGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/TextureViewGLImpl.h index f06ed0d2..8675a86c 100644 --- a/Graphics/GraphicsEngineOpenGL/include/TextureViewGLImpl.h +++ b/Graphics/GraphicsEngineOpenGL/include/TextureViewGLImpl.h @@ -37,7 +37,7 @@ class FixedBlockMemoryAllocator; class TextureViewGLImpl : public TextureViewBase { public: - typedef TextureViewBase TTextureViewBase; + using TTextureViewBase = TextureViewBase; TextureViewGLImpl(IReferenceCounters *pRefCounters, class IRenderDevice *pDevice, diff --git a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp index a1509fbb..df788886 100644 --- a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp @@ -131,7 +131,7 @@ namespace Diligent void DeviceContextGLImpl::CommitShaderResources(IShaderResourceBinding *pShaderResourceBinding, Uint32 Flags) { - if(!DeviceContextBase::CommitShaderResources(pShaderResourceBinding, Flags, 0)) + if(!DeviceContextBase::CommitShaderResources(pShaderResourceBinding, Flags, 0)) return; if(m_CommitedResourcesTentativeBarriers != 0) @@ -342,8 +342,8 @@ namespace Diligent LOG_ERROR("No pipeline state is bound"); return; } - auto *pPipelineStateGL = m_pPipelineState.RawPtr(); - auto *pShaderResBindingGL = ValidatedCast(pResBinding); + auto* pPipelineStateGL = m_pPipelineState.RawPtr(); + auto* pShaderResBindingGL = ValidatedCast(pResBinding); const auto &DeviceCaps = pRenderDeviceGL->GetDeviceCaps(); auto &Prog = pPipelineStateGL->GetGLProgram(); diff --git a/Graphics/GraphicsEngineVulkan/include/BufferViewVkImpl.h b/Graphics/GraphicsEngineVulkan/include/BufferViewVkImpl.h index 6c88c16e..5d6671ce 100644 --- a/Graphics/GraphicsEngineVulkan/include/BufferViewVkImpl.h +++ b/Graphics/GraphicsEngineVulkan/include/BufferViewVkImpl.h @@ -41,7 +41,7 @@ class BufferVkImpl; class BufferViewVkImpl : public BufferViewBase { public: - typedef BufferViewBase TBufferViewBase; + using TBufferViewBase = BufferViewBase; BufferViewVkImpl( IReferenceCounters* pRefCounters, IRenderDevice* pDevice, diff --git a/Graphics/GraphicsEngineVulkan/include/BufferVkImpl.h b/Graphics/GraphicsEngineVulkan/include/BufferVkImpl.h index e4a0edf4..6b448e1b 100644 --- a/Graphics/GraphicsEngineVulkan/include/BufferVkImpl.h +++ b/Graphics/GraphicsEngineVulkan/include/BufferVkImpl.h @@ -45,7 +45,8 @@ class FixedBlockMemoryAllocator; class BufferVkImpl : public BufferBase { public: - typedef BufferBase TBufferBase; + using TBufferBase = BufferBase; + BufferVkImpl(IReferenceCounters* pRefCounters, FixedBlockMemoryAllocator& BuffViewObjMemAllocator, class RenderDeviceVkImpl* pDeviceVk, diff --git a/Graphics/GraphicsEngineVulkan/include/CommandListVkImpl.h b/Graphics/GraphicsEngineVulkan/include/CommandListVkImpl.h index d309b49e..d4507a28 100644 --- a/Graphics/GraphicsEngineVulkan/include/CommandListVkImpl.h +++ b/Graphics/GraphicsEngineVulkan/include/CommandListVkImpl.h @@ -36,7 +36,8 @@ namespace Diligent class CommandListVkImpl : public CommandListBase { public: - typedef CommandListBase TCommandListBase; + using TCommandListBase = CommandListBase; + CommandListVkImpl(IReferenceCounters* pRefCounters, IRenderDevice* pDevice, IDeviceContext* pDeferredCtx, diff --git a/Graphics/GraphicsEngineVulkan/include/CommandQueueVkImpl.h b/Graphics/GraphicsEngineVulkan/include/CommandQueueVkImpl.h index b1ec606f..5a3de325 100644 --- a/Graphics/GraphicsEngineVulkan/include/CommandQueueVkImpl.h +++ b/Graphics/GraphicsEngineVulkan/include/CommandQueueVkImpl.h @@ -41,7 +41,7 @@ namespace Diligent class CommandQueueVkImpl : public ObjectBase { public: - typedef ObjectBase TBase; + using TBase = ObjectBase; CommandQueueVkImpl(IReferenceCounters* pRefCounters, std::shared_ptr LogicalDevice, diff --git a/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h b/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h index 26e74a25..4470c028 100644 --- a/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h +++ b/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h @@ -37,15 +37,18 @@ #include "DescriptorPoolManager.h" #include "PipelineLayout.h" #include "GenerateMipsVkHelper.h" +#include "BufferVKImpl.h" +#include "TextureViewVKImpl.h" +#include "PipelineStateVKImpl.h" namespace Diligent { /// Implementation of the Diligent::IDeviceContext interface -class DeviceContextVkImpl : public DeviceContextBase +class DeviceContextVkImpl : public DeviceContextBase { public: - typedef DeviceContextBase TDeviceContextBase; + using TDeviceContextBase = DeviceContextBase; DeviceContextVkImpl(IReferenceCounters* pRefCounters, class RenderDeviceVkImpl* pDevice, diff --git a/Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.h b/Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.h index e06d853d..b98dedf5 100644 --- a/Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.h +++ b/Graphics/GraphicsEngineVulkan/include/PipelineStateVkImpl.h @@ -48,7 +48,7 @@ class FixedBlockMemoryAllocator; class PipelineStateVkImpl : public PipelineStateBase { public: - typedef PipelineStateBase TPipelineStateBase; + using TPipelineStateBase = PipelineStateBase; PipelineStateVkImpl( IReferenceCounters* pRefCounters, class RenderDeviceVkImpl* pDeviceVk, const PipelineStateDesc &PipelineDesc ); ~PipelineStateVkImpl(); diff --git a/Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.h b/Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.h index 612854f7..11257bf0 100644 --- a/Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.h +++ b/Graphics/GraphicsEngineVulkan/include/RenderDeviceVkImpl.h @@ -54,7 +54,7 @@ namespace Diligent class RenderDeviceVkImpl : public RenderDeviceBase { public: - typedef RenderDeviceBase TRenderDeviceBase; + using TRenderDeviceBase = RenderDeviceBase; RenderDeviceVkImpl( IReferenceCounters* pRefCounters, IMemoryAllocator& RawMemAllocator, diff --git a/Graphics/GraphicsEngineVulkan/include/SamplerVkImpl.h b/Graphics/GraphicsEngineVulkan/include/SamplerVkImpl.h index 23d4c713..c3595b0e 100644 --- a/Graphics/GraphicsEngineVulkan/include/SamplerVkImpl.h +++ b/Graphics/GraphicsEngineVulkan/include/SamplerVkImpl.h @@ -38,7 +38,7 @@ class FixedBlockMemoryAllocator; class SamplerVkImpl : public SamplerBase { public: - typedef SamplerBase TSamplerBase; + using TSamplerBase = SamplerBase; SamplerVkImpl(IReferenceCounters* pRefCounters, class RenderDeviceVkImpl* pRenderDeviceVk, const SamplerDesc& SamplerDesc); ~SamplerVkImpl(); diff --git a/Graphics/GraphicsEngineVulkan/include/ShaderResourceBindingVkImpl.h b/Graphics/GraphicsEngineVulkan/include/ShaderResourceBindingVkImpl.h index 978a967d..34186c61 100644 --- a/Graphics/GraphicsEngineVulkan/include/ShaderResourceBindingVkImpl.h +++ b/Graphics/GraphicsEngineVulkan/include/ShaderResourceBindingVkImpl.h @@ -43,7 +43,8 @@ class FixedBlockMemoryAllocator; class ShaderResourceBindingVkImpl : public ShaderResourceBindingBase { public: - typedef ShaderResourceBindingBase TBase; + using TBase = ShaderResourceBindingBase; + ShaderResourceBindingVkImpl(IReferenceCounters* pRefCounters, class PipelineStateVkImpl* pPSO, bool IsPSOInternal); ~ShaderResourceBindingVkImpl(); diff --git a/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h b/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h index 2c6d7272..09d14a9b 100644 --- a/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h +++ b/Graphics/GraphicsEngineVulkan/include/ShaderVkImpl.h @@ -43,7 +43,7 @@ class FixedBlockMemoryAllocator; class ShaderVkImpl : public ShaderBase { public: - typedef ShaderBase TShaderBase; + using TShaderBase = ShaderBase; ShaderVkImpl(IReferenceCounters* pRefCounters, class RenderDeviceVkImpl* pRenderDeviceVk, const ShaderCreationAttribs &CreationAttribs); ~ShaderVkImpl(); diff --git a/Graphics/GraphicsEngineVulkan/include/SwapChainVkImpl.h b/Graphics/GraphicsEngineVulkan/include/SwapChainVkImpl.h index 018e1eb8..dcb62ab5 100644 --- a/Graphics/GraphicsEngineVulkan/include/SwapChainVkImpl.h +++ b/Graphics/GraphicsEngineVulkan/include/SwapChainVkImpl.h @@ -40,7 +40,8 @@ class IMemoryAllocator; class SwapChainVkImpl : public SwapChainBase { public: - typedef SwapChainBase TSwapChainBase; + using TSwapChainBase = SwapChainBase; + SwapChainVkImpl(IReferenceCounters* pRefCounters, const SwapChainDesc& SwapChainDesc, class RenderDeviceVkImpl* pRenderDeviceVk, diff --git a/Graphics/GraphicsEngineVulkan/include/TextureViewVkImpl.h b/Graphics/GraphicsEngineVulkan/include/TextureViewVkImpl.h index 63d66ac0..9863d6aa 100644 --- a/Graphics/GraphicsEngineVulkan/include/TextureViewVkImpl.h +++ b/Graphics/GraphicsEngineVulkan/include/TextureViewVkImpl.h @@ -39,7 +39,7 @@ class FixedBlockMemoryAllocator; class TextureViewVkImpl : public TextureViewBase { public: - typedef TextureViewBase TTextureViewBase; + using TTextureViewBase = TextureViewBase; TextureViewVkImpl( IReferenceCounters* pRefCounters, IRenderDevice* pDevice, diff --git a/Graphics/GraphicsEngineVulkan/include/TextureVkImpl.h b/Graphics/GraphicsEngineVulkan/include/TextureVkImpl.h index 660dd151..825a5f44 100644 --- a/Graphics/GraphicsEngineVulkan/include/TextureVkImpl.h +++ b/Graphics/GraphicsEngineVulkan/include/TextureVkImpl.h @@ -41,7 +41,7 @@ class FixedBlockMemoryAllocator; class TextureVkImpl : public TextureBase { public: - typedef TextureBase TTextureBase; + using TTextureBase = TextureBase; // Creates a new Vk resource TextureVkImpl(IReferenceCounters* pRefCounters, diff --git a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp index 1c8352d6..b4cd4dc9 100644 --- a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp @@ -264,11 +264,10 @@ namespace Diligent void DeviceContextVkImpl::CommitShaderResources(IShaderResourceBinding *pShaderResourceBinding, Uint32 Flags) { - if (!DeviceContextBase::CommitShaderResources(pShaderResourceBinding, Flags, 0 /*Dummy*/)) + if (!DeviceContextBase::CommitShaderResources(pShaderResourceBinding, Flags, 0 /*Dummy*/)) return; - auto *pPipelineStateVk = m_pPipelineState.RawPtr(); - pPipelineStateVk->CommitAndTransitionShaderResources(pShaderResourceBinding, this, true, Flags, &m_DesrSetBindInfo); + m_pPipelineState->CommitAndTransitionShaderResources(pShaderResourceBinding, this, true, Flags, &m_DesrSetBindInfo); } void DeviceContextVkImpl::SetStencilRef(Uint32 StencilRef) @@ -304,9 +303,8 @@ namespace Diligent void DeviceContextVkImpl::CommitVkVertexBuffers() { #ifdef DEVELOPMENT - auto *pPipelineStateVk = m_pPipelineState.RawPtr(); - if (m_NumVertexStreams < pPipelineStateVk->GetNumBufferSlotsUsed()) - LOG_ERROR("Currently bound pipeline state \"", pPipelineStateVk->GetDesc().Name, "\" expects ", pPipelineStateVk->GetNumBufferSlotsUsed(), " input buffer slots, but only ", m_NumVertexStreams, " is bound"); + if (m_NumVertexStreams < m_pPipelineState->GetNumBufferSlotsUsed()) + LOG_ERROR("Currently bound pipeline state \"", m_pPipelineState->GetDesc().Name, "\" expects ", m_pPipelineState->GetNumBufferSlotsUsed(), " input buffer slots, but only ", m_NumVertexStreams, " is bound"); #endif // Do not initialize array with zeroes for performance reasons VkBuffer vkVertexBuffers[MaxBufferSlots];// = {} @@ -399,7 +397,7 @@ namespace Diligent } #endif - auto *pPipelineStateVk = m_pPipelineState.RawPtr(); + auto *pPipelineStateVk = m_pPipelineState.RawPtr(); EnsureVkCmdBuffer(); @@ -507,7 +505,7 @@ namespace Diligent } #endif - auto *pPipelineStateVk = m_pPipelineState.RawPtr(); + auto *pPipelineStateVk = m_pPipelineState.RawPtr(); EnsureVkCmdBuffer(); -- cgit v1.2.3