From 3cd69ada3f3b2d89fce29f9aff6dd660535e75da Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Fri, 20 Apr 2018 22:38:47 -0700 Subject: Renamed ClearRenderTargets to ResetRenderTargets --- Graphics/GraphicsEngine/include/DeviceContextBase.h | 6 +++--- Graphics/GraphicsEngineD3D11/src/SwapChainD3D11Impl.cpp | 2 +- Graphics/GraphicsEngineD3D12/src/SwapChainD3D12Impl.cpp | 2 +- Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp | 2 ++ 4 files changed, 7 insertions(+), 5 deletions(-) (limited to 'Graphics') diff --git a/Graphics/GraphicsEngine/include/DeviceContextBase.h b/Graphics/GraphicsEngine/include/DeviceContextBase.h index 3eeffbda..29bd2398 100644 --- a/Graphics/GraphicsEngine/include/DeviceContextBase.h +++ b/Graphics/GraphicsEngine/include/DeviceContextBase.h @@ -134,7 +134,7 @@ public: /// Returns the render device IRenderDevice *GetDevice(){return m_pDevice;} - inline void ClearRenderTargets(); + inline void ResetRenderTargets(); protected: inline bool SetBlendFactors(const float *BlendFactors, int Dummy); @@ -581,11 +581,11 @@ inline void DeviceContextBase :: ClearStateCache() m_ScissorRects[sr] = Rect(); m_NumScissorRects = 0; - ClearRenderTargets(); + ResetRenderTargets(); } template -inline void DeviceContextBase :: ClearRenderTargets() +inline void DeviceContextBase :: ResetRenderTargets() { for (Uint32 rt = 0; rt < m_NumBoundRenderTargets; ++rt) m_pBoundRenderTargets[rt].Release(); diff --git a/Graphics/GraphicsEngineD3D11/src/SwapChainD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/SwapChainD3D11Impl.cpp index f5a191ad..ad619ef7 100644 --- a/Graphics/GraphicsEngineD3D11/src/SwapChainD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/SwapChainD3D11Impl.cpp @@ -142,7 +142,7 @@ void SwapChainD3D11Impl::UpdateSwapChain(bool CreateNew) auto *pImmediateCtxD3D11 = pDeviceContext.RawPtr(); bool bIsDefaultFBBound = pImmediateCtxD3D11->IsDefaultFBBound(); if (bIsDefaultFBBound) - pImmediateCtxD3D11->ClearRenderTargets(); + pImmediateCtxD3D11->ResetRenderTargets(); // Swap chain cannot be resized until all references are released m_pRenderTargetView.Release(); diff --git a/Graphics/GraphicsEngineD3D12/src/SwapChainD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/SwapChainD3D12Impl.cpp index 4ccadb64..353a7ef0 100644 --- a/Graphics/GraphicsEngineD3D12/src/SwapChainD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/SwapChainD3D12Impl.cpp @@ -159,7 +159,7 @@ void SwapChainD3D12Impl::UpdateSwapChain(bool CreateNew) auto *pImmediateCtxD3D12 = pDeviceContext.RawPtr(); bool bIsDefaultFBBound = pImmediateCtxD3D12->IsDefaultFBBound(); if(bIsDefaultFBBound) - pImmediateCtxD3D12->ClearRenderTargets(); + pImmediateCtxD3D12->ResetRenderTargets(); // All references to the swap chain must be released before it can be resized m_pBackBufferRTV.clear(); diff --git a/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp index 58915275..03722eb8 100644 --- a/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp @@ -475,6 +475,8 @@ void SwapChainVkImpl::Resize( Uint32 NewWidth, Uint32 NewHeight ) { auto *pImmediateCtxVk = pDeviceContext.RawPtr(); bool bIsDefaultFBBound = pImmediateCtxVk->IsDefaultFBBound(); + if(bIsDefaultFBBound) + pImmediateCtxVk->ResetRenderTargets(); // All references to the swap chain must be released before it can be resized m_pBackBufferRTV.clear(); -- cgit v1.2.3