From 2cacacea8a993b1e4a5e2980f79a28be7629ac12 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Mon, 18 May 2015 19:08:30 -0700 Subject: [PATCH] Texture fixup. --- src/xenia/gpu/gl4/texture_cache.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/xenia/gpu/gl4/texture_cache.cc b/src/xenia/gpu/gl4/texture_cache.cc index 47e3776b1..e34839590 100644 --- a/src/xenia/gpu/gl4/texture_cache.cc +++ b/src/xenia/gpu/gl4/texture_cache.cc @@ -710,7 +710,9 @@ bool TextureCache::UploadTexture2D(GLuint texture, uint8_t* dest = reinterpret_cast(allocation.host_ptr); uint32_t pitch = std::min(texture_info.size_2d.input_pitch, texture_info.size_2d.output_pitch); - for (uint32_t y = 0; y < texture_info.size_2d.block_height; y++) { + for (uint32_t y = 0; y < std::min(texture_info.size_2d.block_height, + texture_info.size_2d.logical_height); + y++) { TextureSwap(texture_info.endianness, dest, src, pitch); src += texture_info.size_2d.input_pitch; dest += texture_info.size_2d.output_pitch;