From 71595b9099ad70b474502ca3b16c2da7050cb6a8 Mon Sep 17 00:00:00 2001 From: assiduous Date: Tue, 24 Dec 2019 10:39:56 -0800 Subject: Updated swap chain Present() to unbind back buffers from immediate context --- Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Graphics/GraphicsEngineVulkan') diff --git a/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp index 6dd304ac..cf4536b5 100644 --- a/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp @@ -542,10 +542,13 @@ void SwapChainVkImpl::Present(Uint32 SyncInterval) auto* pImmediateCtxVk = pDeviceContext.RawPtr(); auto* pDeviceVk = m_pRenderDevice.RawPtr(); + auto* pBackBuffer = GetCurrentBackBufferRTV()->GetTexture(); + pImmediateCtxVk->UnbindTextureFromFramebuffer(ValidatedCast(pBackBuffer), false); + if (!m_IsMinimized) { // TransitionImageLayout() never triggers flush - pImmediateCtxVk->TransitionImageLayout(GetCurrentBackBufferRTV()->GetTexture(), VK_IMAGE_LAYOUT_PRESENT_SRC_KHR); + pImmediateCtxVk->TransitionImageLayout(pBackBuffer, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR); // The context can be empty if no render commands were issued by the app //VERIFY(pImmediateCtxVk->GetNumCommandsInCtx() != 0, "The context must not be flushed"); pImmediateCtxVk->AddSignalSemaphore(m_DrawCompleteSemaphores[m_SemaphoreIndex]); -- cgit v1.2.3