From 6bd19518eb8718178b92d9072ef1e0173fcaa4e9 Mon Sep 17 00:00:00 2001 From: "Dr. Chat" Date: Sat, 18 Jun 2016 21:16:10 -0500 Subject: [PATCH] GL4: Fix incorrectly calculating the base offset for IssueCopy --- src/xenia/gpu/gl4/gl4_command_processor.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/xenia/gpu/gl4/gl4_command_processor.cc b/src/xenia/gpu/gl4/gl4_command_processor.cc index 451e77613..89074b029 100644 --- a/src/xenia/gpu/gl4/gl4_command_processor.cc +++ b/src/xenia/gpu/gl4/gl4_command_processor.cc @@ -1691,12 +1691,12 @@ bool GL4CommandProcessor::IssueCopy() { case ColorFormat::k_16_16_16_16: read_format = GL_RGBA16; read_type = GL_UNSIGNED_SHORT; - read_size = 32; + read_size = 64; break; case ColorFormat::k_16_16_16_16_FLOAT: read_format = GL_RGBA16F; read_type = GL_HALF_FLOAT; - read_size = 32; + read_size = 64; break; case ColorFormat::k_32_FLOAT: read_format = GL_R32F; @@ -1816,8 +1816,8 @@ bool GL4CommandProcessor::IssueCopy() { // offset, so to ensure texture lookup works we need to offset it. // TODO(benvanik): allow texture cache to lookup partial textures. // TODO(benvanik): change based on format. - int32_t dest_offset = window_offset_y * copy_dest_pitch * 4; - dest_offset += window_offset_x * 32 * 4; + int32_t dest_offset = window_offset_y * copy_dest_pitch * int(read_size / 8); + dest_offset += window_offset_x * 32 * int(read_size / 8); copy_dest_base += dest_offset; // Destination pointer in guest memory.