diff options
Diffstat (limited to '')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index 0996053f5..e95eb069e 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp | |||
| @@ -253,14 +253,12 @@ void CachedSurface::DownloadTexture(std::vector<u8>& staging_buffer) { | |||
| 253 | glPixelStorei(GL_PACK_ALIGNMENT, std::min(8U, params.GetRowAlignment(level))); | 253 | glPixelStorei(GL_PACK_ALIGNMENT, std::min(8U, params.GetRowAlignment(level))); |
| 254 | glPixelStorei(GL_PACK_ROW_LENGTH, static_cast<GLint>(params.GetMipWidth(level))); | 254 | glPixelStorei(GL_PACK_ROW_LENGTH, static_cast<GLint>(params.GetMipWidth(level))); |
| 255 | const std::size_t mip_offset = params.GetHostMipmapLevelOffset(level); | 255 | const std::size_t mip_offset = params.GetHostMipmapLevelOffset(level); |
| 256 | u8* const mip_data = staging_buffer.data() + mip_offset; | ||
| 257 | const GLsizei size = static_cast<GLsizei>(params.GetHostMipmapSize(level)); | ||
| 256 | if (is_compressed) { | 258 | if (is_compressed) { |
| 257 | glGetCompressedTextureImage(texture.handle, level, | 259 | glGetCompressedTextureImage(texture.handle, level, size, mip_data); |
| 258 | static_cast<GLsizei>(params.GetHostMipmapSize(level)), | ||
| 259 | staging_buffer.data() + mip_offset); | ||
| 260 | } else { | 260 | } else { |
| 261 | glGetTextureImage(texture.handle, level, format, type, | 261 | glGetTextureImage(texture.handle, level, format, type, size, mip_data); |
| 262 | static_cast<GLsizei>(params.GetHostMipmapSize(level)), | ||
| 263 | staging_buffer.data() + mip_offset); | ||
| 264 | } | 262 | } |
| 265 | } | 263 | } |
| 266 | } | 264 | } |