diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2019-12-24 18:39:56 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2019-12-24 18:39:56 +0000 |
| commit | 71595b9099ad70b474502ca3b16c2da7050cb6a8 (patch) | |
| tree | cdb90b8170967e89f6da26410a4a2f0827e49301 /Graphics/GraphicsEngineD3D12 | |
| parent | Reworked ClearRenderTarget and ClearDepthStencil methods to not take nullptr (diff) | |
| download | DiligentCore-71595b9099ad70b474502ca3b16c2da7050cb6a8.tar.gz DiligentCore-71595b9099ad70b474502ca3b16c2da7050cb6a8.zip | |
Updated swap chain Present() to unbind back buffers from immediate context
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
| -rw-r--r-- | Graphics/GraphicsEngineD3D12/src/SwapChainD3D12Impl.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/Graphics/GraphicsEngineD3D12/src/SwapChainD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/SwapChainD3D12Impl.cpp index 74cedd1c..af8e035b 100644 --- a/Graphics/GraphicsEngineD3D12/src/SwapChainD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/SwapChainD3D12Impl.cpp @@ -135,6 +135,11 @@ void SwapChainD3D12Impl::Present(Uint32 SyncInterval) auto& CmdCtx = pImmediateCtxD3D12->GetCmdContext(); auto* pBackBuffer = ValidatedCast<TextureD3D12Impl>(GetCurrentBackBufferRTV()->GetTexture()); + + // A successful Present call for DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL SwapChains unbinds + // backbuffer 0 from all GPU writeable bind points. + pImmediateCtxD3D12->UnbindTextureFromFramebuffer(pBackBuffer, false); + CmdCtx.TransitionResource(pBackBuffer, RESOURCE_STATE_PRESENT); pImmediateCtxD3D12->Flush(); @@ -149,15 +154,8 @@ void SwapChainD3D12Impl::Present(Uint32 SyncInterval) pDeviceD3D12->ReleaseStaleResources(); } -#if 0 -# if PLATFORM_UNIVERSAL_WINDOWS - // A successful Present call for DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL SwapChains unbinds + // 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 - pImmediateCtxD3D12->CommitRenderTargets(); -# endif -#endif } void SwapChainD3D12Impl::UpdateSwapChain(bool CreateNew) |
