GL4: Fix incorrectly calculating the base offset for IssueCopy

This commit is contained in:
Dr. Chat 2016-06-18 21:16:10 -05:00
parent 0c69e05eb1
commit 6bd19518eb
1 changed files with 4 additions and 4 deletions

View File

@ -1691,12 +1691,12 @@ bool GL4CommandProcessor::IssueCopy() {
case ColorFormat::k_16_16_16_16: case ColorFormat::k_16_16_16_16:
read_format = GL_RGBA16; read_format = GL_RGBA16;
read_type = GL_UNSIGNED_SHORT; read_type = GL_UNSIGNED_SHORT;
read_size = 32; read_size = 64;
break; break;
case ColorFormat::k_16_16_16_16_FLOAT: case ColorFormat::k_16_16_16_16_FLOAT:
read_format = GL_RGBA16F; read_format = GL_RGBA16F;
read_type = GL_HALF_FLOAT; read_type = GL_HALF_FLOAT;
read_size = 32; read_size = 64;
break; break;
case ColorFormat::k_32_FLOAT: case ColorFormat::k_32_FLOAT:
read_format = GL_R32F; read_format = GL_R32F;
@ -1816,8 +1816,8 @@ bool GL4CommandProcessor::IssueCopy() {
// offset, so to ensure texture lookup works we need to offset it. // offset, so to ensure texture lookup works we need to offset it.
// TODO(benvanik): allow texture cache to lookup partial textures. // TODO(benvanik): allow texture cache to lookup partial textures.
// TODO(benvanik): change based on format. // TODO(benvanik): change based on format.
int32_t dest_offset = window_offset_y * copy_dest_pitch * 4; int32_t dest_offset = window_offset_y * copy_dest_pitch * int(read_size / 8);
dest_offset += window_offset_x * 32 * 4; dest_offset += window_offset_x * 32 * int(read_size / 8);
copy_dest_base += dest_offset; copy_dest_base += dest_offset;
// Destination pointer in guest memory. // Destination pointer in guest memory.