From 98f46b397b76ead7aaa701ebdadb949ac9ecb7d6 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Mon, 1 Oct 2018 19:55:30 -0700 Subject: Removed ForceRelease parameter of IDeviceContext::FinishFrame() --- Graphics/GraphicsEngine/interface/DeviceContext.h | 6 ++---- Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h | 2 +- Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp | 2 +- Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h | 2 +- Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp | 2 +- Graphics/GraphicsEngineD3D12/src/SwapChainD3D12Impl.cpp | 2 +- Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h | 2 +- Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp | 2 +- Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h | 3 +-- Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp | 4 ++-- Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp | 2 +- 11 files changed, 13 insertions(+), 16 deletions(-) (limited to 'Graphics') diff --git a/Graphics/GraphicsEngine/interface/DeviceContext.h b/Graphics/GraphicsEngine/interface/DeviceContext.h index ccbe8745..5469931d 100644 --- a/Graphics/GraphicsEngine/interface/DeviceContext.h +++ b/Graphics/GraphicsEngine/interface/DeviceContext.h @@ -513,13 +513,11 @@ public: /// release dynamic resources. The method has some overhead, so it is better to call it once /// per frame, though it can be called with different frequency. Note that unless the GPU is idled, /// the resources may actually be released several frames after the one they were used in last time. - /// \param ForceRelease - force release all stale resources. Use this option only if you are sure - /// the resources are not in use by the GPU (the GPU has been idled or a - /// fence indicates all commands are finished). /// \note After the call all dynamic resources become invalid and must be written again before the next use. + /// Also, all committed resources become invalid. /// For deferred contexts, this method must be called after all command lists referencing dynamic resources /// have been executed through immediate context. - virtual void FinishFrame(bool ForceRelease = false) = 0; + virtual void FinishFrame() = 0; }; } diff --git a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h index e4aab32d..30f5c83f 100755 --- a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h @@ -86,7 +86,7 @@ public: virtual void Flush()override final; - virtual void FinishFrame(bool ForceRelease)override final; + virtual void FinishFrame()override final; void FinishCommandList(class ICommandList **ppCommandList)override final; diff --git a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp index 0ea85161..369b632e 100755 --- a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp @@ -916,7 +916,7 @@ namespace Diligent m_pd3d11DeviceContext->Flush(); } - void DeviceContextD3D11Impl::FinishFrame(bool ForceRelease) + void DeviceContextD3D11Impl::FinishFrame() { } diff --git a/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h b/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h index 84a69462..fa9f4d2c 100644 --- a/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h +++ b/Graphics/GraphicsEngineD3D12/include/DeviceContextD3D12Impl.h @@ -86,7 +86,7 @@ public: virtual void Flush()override final; - virtual void FinishFrame(bool ForceRelease)override final; + virtual void FinishFrame()override final; virtual void FinishCommandList(class ICommandList **ppCommandList)override final; diff --git a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp index 7115dde0..494c1df9 100644 --- a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp @@ -528,7 +528,7 @@ namespace Diligent Flush(true); } - void DeviceContextD3D12Impl::FinishFrame(bool ForceRelease) + void DeviceContextD3D12Impl::FinishFrame() { //Uint64 FenceValue = ForceRelease ? std::numeric_limits::max() : m_pDevice.RawPtr()->GetCompletedFenceValue(); m_DynamicHeap.FinishFrame(m_LastSubmittedFenceValue); diff --git a/Graphics/GraphicsEngineD3D12/src/SwapChainD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/SwapChainD3D12Impl.cpp index d01d4ab5..d9caef16 100644 --- a/Graphics/GraphicsEngineD3D12/src/SwapChainD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/SwapChainD3D12Impl.cpp @@ -131,7 +131,7 @@ void SwapChainD3D12Impl::Present(Uint32 SyncInterval) auto hr = m_pSwapChain->Present( SyncInterval, 0 ); VERIFY(SUCCEEDED(hr), "Present failed"); - pImmediateCtxD3D12->FinishFrame(false); + pImmediateCtxD3D12->FinishFrame(); pDeviceD3D12->FinishFrame(); #if 0 diff --git a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h index a33ff3a3..34e126e3 100644 --- a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h +++ b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h @@ -78,7 +78,7 @@ public: virtual void Flush()override final; - virtual void FinishFrame(bool ForceRelease)override final; + virtual void FinishFrame()override final; virtual void FinishCommandList(class ICommandList **ppCommandList)override final; diff --git a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp index c8de2ae5..00c31a42 100644 --- a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp @@ -973,7 +973,7 @@ namespace Diligent glFlush(); } - void DeviceContextGLImpl::FinishFrame(bool ForceRelease) + void DeviceContextGLImpl::FinishFrame() { } diff --git a/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h b/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h index b8860e90..cd598c40 100644 --- a/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h +++ b/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h @@ -158,8 +158,7 @@ public: return m_CommandBuffer; } - // TODO: remove ForceRelease - virtual void FinishFrame(bool /*ForceRelease*/)override final; + virtual void FinishFrame()override final; VkDescriptorSet AllocateDynamicDescriptorSet(VkDescriptorSetLayout SetLayout) { diff --git a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp index 84a47bd7..202babab 100644 --- a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp @@ -111,7 +111,7 @@ namespace Diligent Flush(); } - FinishFrame(false); + FinishFrame(); // There must be no stale resources DEV_CHECK_ERR(m_UploadHeap.GetStalePagesCount() == 0, "All allocated upload heap pages must have been released at this point"); @@ -743,7 +743,7 @@ namespace Diligent ++m_State.NumCommands; } - void DeviceContextVkImpl::FinishFrame(bool /*ForceRelease*/) + void DeviceContextVkImpl::FinishFrame() { if(GetNumCommandsInCtx() != 0) LOG_ERROR_MESSAGE(m_bIsDeferred ? diff --git a/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp index 2d25b036..1251f5c1 100644 --- a/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp @@ -462,7 +462,7 @@ void SwapChainVkImpl::Present(Uint32 SyncInterval) ); } - pImmediateCtxVk->FinishFrame(false); + pImmediateCtxVk->FinishFrame(); pDeviceVk->ReleaseStaleResources(); if (!m_IsMinimized) -- cgit v1.2.3