diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-09-09 00:42:51 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-09-09 00:42:51 +0000 |
| commit | d06553e2b4700aa026acd4445a598eadf10dfb35 (patch) | |
| tree | 534c3761a92cfb93d370b75f29f6b720a10c64a8 /Graphics/GraphicsEngineVulkan | |
| parent | Renamed IDeviceContext::Wait to IDeviceContext::WaitForFence (updated API ver... (diff) | |
| download | DiligentCore-d06553e2b4700aa026acd4445a598eadf10dfb35.tar.gz DiligentCore-d06553e2b4700aa026acd4445a598eadf10dfb35.zip | |
Added IDeviceContext::WaitForIdle() method (updated API version to 240028)
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
3 files changed, 11 insertions, 3 deletions
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<RenderDeviceVkImpl>()->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(); } |
