summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/OGL/OGLTexture.cpp
diff options
context:
space:
mode:
authorMarkus Wick <degasus@users.noreply.github.com>2017-12-11 08:44:09 +0100
committerGitHub <noreply@github.com>2017-12-11 08:44:09 +0100
commita70c03a1c0a6fce6724a323db3bdc41d8b905090 (patch)
tree3dce9e863d08e860ff3636dc3fc25280827e13ba /Source/Core/VideoBackends/OGL/OGLTexture.cpp
parent6a4e3cb3d609060191992b0fc71e849338ea57d6 (diff)
parent2579f8eaa5baf308a2eeafce172628d8264ee402 (diff)
Merge pull request #6249 from stenzek/texture-dump
Texture dumping regression fixes
Diffstat (limited to 'Source/Core/VideoBackends/OGL/OGLTexture.cpp')
-rw-r--r--Source/Core/VideoBackends/OGL/OGLTexture.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/Source/Core/VideoBackends/OGL/OGLTexture.cpp b/Source/Core/VideoBackends/OGL/OGLTexture.cpp
index bf1ec266d3..97f7500f71 100644
--- a/Source/Core/VideoBackends/OGL/OGLTexture.cpp
+++ b/Source/Core/VideoBackends/OGL/OGLTexture.cpp
@@ -427,12 +427,10 @@ void OGLStagingTexture::CopyFromTexture(const AbstractTexture* src,
}
else
{
- glActiveTexture(GL_TEXTURE9);
- glBindTexture(GL_TEXTURE_2D_ARRAY, gltex->GetRawTexIdentifier());
if (g_ogl_config.bSupportsTextureSubImage)
{
glGetTextureSubImage(
- GL_TEXTURE_2D_ARRAY, src_level, src_rect.left, src_rect.top, src_layer,
+ gltex->GetRawTexIdentifier(), src_level, src_rect.left, src_rect.top, src_layer,
src_rect.GetWidth(), src_rect.GetHeight(), 1,
GetGLFormatForTextureFormat(m_config.format), GetGLTypeForTextureFormat(m_config.format),
static_cast<GLsizei>(m_buffer_size - dst_offset), reinterpret_cast<void*>(dst_offset));
@@ -442,11 +440,12 @@ void OGLStagingTexture::CopyFromTexture(const AbstractTexture* src,
// TODO: Investigate whether it's faster to use glReadPixels() with a framebuffer, since we're
// copying the whole texture, which may waste bandwidth. So we're trading CPU work in creating
// the framebuffer for GPU work in copying potentially redundant texels.
+ glActiveTexture(GL_TEXTURE9);
+ glBindTexture(GL_TEXTURE_2D_ARRAY, gltex->GetRawTexIdentifier());
glGetTexImage(GL_TEXTURE_2D_ARRAY, src_level, GetGLFormatForTextureFormat(m_config.format),
GetGLTypeForTextureFormat(m_config.format), nullptr);
+ OGLTexture::SetStage();
}
-
- OGLTexture::SetStage();
}
glPixelStorei(GL_PACK_ROW_LENGTH, 0);