Merge pull request #6249 from stenzek/texture-dump

Texture dumping regression fixes
This commit is contained in:
Markus Wick 2017-12-11 08:44:09 +01:00 committed by GitHub
commit a70c03a1c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View File

@ -427,12 +427,10 @@ void OGLStagingTexture::CopyFromTexture(const AbstractTexture* src,
} }
else else
{ {
glActiveTexture(GL_TEXTURE9);
glBindTexture(GL_TEXTURE_2D_ARRAY, gltex->GetRawTexIdentifier());
if (g_ogl_config.bSupportsTextureSubImage) if (g_ogl_config.bSupportsTextureSubImage)
{ {
glGetTextureSubImage( 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, src_rect.GetWidth(), src_rect.GetHeight(), 1,
GetGLFormatForTextureFormat(m_config.format), GetGLTypeForTextureFormat(m_config.format), GetGLFormatForTextureFormat(m_config.format), GetGLTypeForTextureFormat(m_config.format),
static_cast<GLsizei>(m_buffer_size - dst_offset), reinterpret_cast<void*>(dst_offset)); 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 // 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 // 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. // 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), glGetTexImage(GL_TEXTURE_2D_ARRAY, src_level, GetGLFormatForTextureFormat(m_config.format),
GetGLTypeForTextureFormat(m_config.format), nullptr); GetGLTypeForTextureFormat(m_config.format), nullptr);
OGLTexture::SetStage();
} }
OGLTexture::SetStage();
} }
glPixelStorei(GL_PACK_ROW_LENGTH, 0); glPixelStorei(GL_PACK_ROW_LENGTH, 0);

View File

@ -1090,7 +1090,7 @@ TextureCacheBase::GetTexture(u32 address, u32 width, u32 height, const TextureFo
entry->has_arbitrary_mips = arbitrary_mip_detector.HasArbitraryMipmaps(dst_buffer); entry->has_arbitrary_mips = arbitrary_mip_detector.HasArbitraryMipmaps(dst_buffer);
if (g_ActiveConfig.bDumpTextures) if (g_ActiveConfig.bDumpTextures && !hires_tex)
{ {
for (u32 level = 0; level < texLevels; ++level) for (u32 level = 0; level < texLevels; ++level)
{ {