summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D11
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/GraphicsEngineD3D11
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/GraphicsEngineD3D11')
-rw-r--r--Graphics/GraphicsEngineD3D11/src/SwapChainD3D11Impl.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/Graphics/GraphicsEngineD3D11/src/SwapChainD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/SwapChainD3D11Impl.cpp
index 305a0b93..f75cdfb6 100644
--- a/Graphics/GraphicsEngineD3D11/src/SwapChainD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/SwapChainD3D11Impl.cpp
@@ -123,6 +123,10 @@ void SwapChainD3D11Impl::Present(Uint32 SyncInterval)
auto* pImmediateCtxD3D11 = pDeviceContext.RawPtr<DeviceContextD3D11Impl>();
+ // A successful Present call for DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL SwapChains unbinds
+ // backbuffer 0 from all GPU writeable bind points.
+ pImmediateCtxD3D11->UnbindTextureFromFramebuffer(ValidatedCast<TextureBaseD3D11>(m_pRenderTargetView->GetTexture()), false);
+
if (m_SwapChainDesc.IsPrimary)
{
// Clear the state caches to release all outstanding objects
@@ -135,15 +139,6 @@ void SwapChainD3D11Impl::Present(Uint32 SyncInterval)
}
m_pSwapChain->Present(SyncInterval, 0);
-
- if (m_SwapChainDesc.IsPrimary)
- {
- // A successful Present call for DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL SwapChains unbinds
- // backbuffer 0 from all GPU writeable bind points.
- // We need to rebind all render targets to make sure that
- // the back buffer is not unbound
- pImmediateCtxD3D11->CommitRenderTargets();
- }
}
void SwapChainD3D11Impl::UpdateSwapChain(bool CreateNew)