From 4b96db8fc9e8005221d46de5fcf2a603afef7d05 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Fri, 9 Feb 2018 01:15:27 +1000 Subject: [PATCH] OGL: Don't leave staging texture buffer bound after mapping This could cause glReadPixels() calls which assume no buffer is bound (e.g. CPU EFB access) to fail. The problem was limited to devices which don't support persistent mapping, as the map path is not otherwise. --- Source/Core/VideoBackends/OGL/OGLTexture.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Source/Core/VideoBackends/OGL/OGLTexture.cpp b/Source/Core/VideoBackends/OGL/OGLTexture.cpp index 89b6436f2b..bc93c37dd4 100644 --- a/Source/Core/VideoBackends/OGL/OGLTexture.cpp +++ b/Source/Core/VideoBackends/OGL/OGLTexture.cpp @@ -511,10 +511,8 @@ bool OGLStagingTexture::Map() flags = GL_MAP_READ_BIT | GL_MAP_WRITE_BIT; glBindBuffer(m_target, m_buffer_name); m_map_pointer = reinterpret_cast(glMapBufferRange(m_target, 0, m_buffer_size, flags)); - if (!m_map_pointer) - return false; - - return true; + glBindBuffer(m_target, 0); + return m_map_pointer != nullptr; } void OGLStagingTexture::Unmap()