Texture fixup.

This commit is contained in:
Ben Vanik 2015-05-18 19:08:30 -07:00
parent 5c2b2a2b58
commit 2cacacea8a
1 changed files with 3 additions and 1 deletions

View File

@ -710,7 +710,9 @@ bool TextureCache::UploadTexture2D(GLuint texture,
uint8_t* dest = reinterpret_cast<uint8_t*>(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;