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/GraphicsEngineOpenGL/src/SwapChainGLImpl.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Graphics/GraphicsEngineOpenGL') 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(); + auto* pBackBuffer = ValidatedCast(m_pRenderTargetView->GetTexture()); + pDeviceCtxGl->UnbindTextureFromFramebuffer(pBackBuffer, false); + } } void SwapChainGLImpl::Resize(Uint32 NewWidth, Uint32 NewHeight) -- cgit v1.2.3