From d06553e2b4700aa026acd4445a598eadf10dfb35 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sun, 8 Sep 2019 17:42:51 -0700 Subject: Added IDeviceContext::WaitForIdle() method (updated API version to 240028) --- Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h | 6 ++++-- Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp | 6 ++++++ Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) (limited to 'Graphics/GraphicsEngineVulkan') diff --git a/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h b/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h index a7f02919..c220a8e5 100644 --- a/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h +++ b/Graphics/GraphicsEngineVulkan/include/DeviceContextVkImpl.h @@ -112,8 +112,6 @@ public: virtual void ClearRenderTarget( ITextureView* pView, const float* RGBA, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode )override final; - virtual void Flush()override final; - virtual void UpdateBuffer(IBuffer* pBuffer, Uint32 Offset, Uint32 Size, @@ -161,6 +159,10 @@ public: virtual void WaitForFence(IFence* pFence, Uint64 Value, bool FlushContext)override final; + virtual void WaitForIdle()override final; + + virtual void Flush()override final; + // Transitions texture subresources from OldState to NewState, and optionally updates // internal texture state. // If OldState == RESOURCE_STATE_UNKNOWN, internal texture state is used as old state. diff --git a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp index 2a8cafde..4e87d6d4 100644 --- a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp @@ -1925,6 +1925,12 @@ namespace Diligent pFenceVk->Wait(Value); } + void DeviceContextVkImpl::WaitForIdle() + { + VERIFY(!m_bIsDeferred, "Only immediate contexts can be idled"); + Flush(); + m_pDevice.RawPtr()->IdleCommandQueue(m_CommandQueueId, true); + } void DeviceContextVkImpl::TransitionImageLayout(ITexture* pTexture, VkImageLayout NewLayout) { diff --git a/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp index 271af6e0..ca9b3200 100644 --- a/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp @@ -281,7 +281,7 @@ Uint64 RenderDeviceVkImpl::ExecuteCommandBuffer(Uint32 QueueIndex, const VkSubmi void RenderDeviceVkImpl::IdleGPU() { - IdleCommandQueues(true); + IdleAllCommandQueues(true); m_LogicalVkDevice->WaitIdle(); ReleaseStaleResources(); } -- cgit v1.2.3