summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2019-12-24 18:39:56 +0000
committerassiduous <assiduous@diligentgraphics.com>2019-12-24 18:39:56 +0000
commit71595b9099ad70b474502ca3b16c2da7050cb6a8 (patch)
treecdb90b8170967e89f6da26410a4a2f0827e49301 /Graphics/GraphicsEngineVulkan
parentReworked ClearRenderTarget and ClearDepthStencil methods to not take nullptr (diff)
downloadDiligentCore-71595b9099ad70b474502ca3b16c2da7050cb6a8.tar.gz
DiligentCore-71595b9099ad70b474502ca3b16c2da7050cb6a8.zip
Updated swap chain Present() to unbind back buffers from immediate context
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
-rw-r--r--Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp5
1 files changed, 4 insertions, 1 deletions
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<DeviceContextVkImpl>();
auto* pDeviceVk = m_pRenderDevice.RawPtr<RenderDeviceVkImpl>();
+ auto* pBackBuffer = GetCurrentBackBufferRTV()->GetTexture();
+ pImmediateCtxVk->UnbindTextureFromFramebuffer(ValidatedCast<TextureVkImpl>(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]);