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/GraphicsEngineOpenGL | |
| 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/GraphicsEngineOpenGL')
| -rw-r--r-- | Graphics/GraphicsEngineOpenGL/src/SwapChainGLImpl.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Graphics/GraphicsEngineOpenGL/src/SwapChainGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/SwapChainGLImpl.cpp index 831fdb7e..fc33ccf9 100644 --- a/Graphics/GraphicsEngineOpenGL/src/SwapChainGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/SwapChainGLImpl.cpp @@ -112,6 +112,14 @@ void SwapChainGLImpl::Present(Uint32 SyncInterval) #else # error Unsupported platform #endif + + // Unbind back buffer from device context to be consistent with other backends + if (auto pDeviceContext = m_wpDeviceContext.Lock()) + { + auto* pDeviceCtxGl = pDeviceContext.RawPtr<DeviceContextGLImpl>(); + auto* pBackBuffer = ValidatedCast<TextureBaseGL>(m_pRenderTargetView->GetTexture()); + pDeviceCtxGl->UnbindTextureFromFramebuffer(pBackBuffer, false); + } } void SwapChainGLImpl::Resize(Uint32 NewWidth, Uint32 NewHeight) |
