diff options
| author | Stenzek <stenzek@gmail.com> | 2018-02-09 01:15:27 +1000 |
|---|---|---|
| committer | Stenzek <stenzek@gmail.com> | 2018-02-09 01:15:27 +1000 |
| commit | 4b96db8fc9e8005221d46de5fcf2a603afef7d05 (patch) | |
| tree | a3450d72443227ed7a7c3592a10bedbc8c043b0b /Source/Core/VideoBackends/OGL/OGLTexture.cpp | |
| parent | c30ac55cf4c06cf896f0264443dfa3d5de904e69 (diff) | |
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.
Diffstat (limited to 'Source/Core/VideoBackends/OGL/OGLTexture.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/OGL/OGLTexture.cpp | 6 |
1 files 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<char*>(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() |
