From be98554b40c802986b2b89ae278b833a1582894c Mon Sep 17 00:00:00 2001 From: kd-11 Date: Mon, 19 Aug 2019 20:00:35 +0300 Subject: [PATCH] rsx: Fix surface split logic - Calculations are supposed to be done based on the properties of the outgoing surface --- rpcs3/Emu/RSX/Common/surface_store.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/RSX/Common/surface_store.h b/rpcs3/Emu/RSX/Common/surface_store.h index a6102cebf3..29402a7cce 100644 --- a/rpcs3/Emu/RSX/Common/surface_store.h +++ b/rpcs3/Emu/RSX/Common/surface_store.h @@ -122,6 +122,7 @@ namespace rsx size2u old, _new; const auto prev_area = prev_surface->get_normalized_memory_area(); + const auto prev_bpp = prev_surface->get_bpp(); old.width = prev_area.x2; old.height = prev_area.y2; @@ -132,7 +133,7 @@ namespace rsx { // Split in X const u32 baseaddr = address + _new.width; - const u32 bytes_to_texels_x = (bpp * prev_surface->samples_x); + const u32 bytes_to_texels_x = (prev_bpp * prev_surface->samples_x); deferred_clipped_region copy; copy.src_x = _new.width / bytes_to_texels_x; @@ -160,7 +161,7 @@ namespace rsx { // Split in Y const u32 baseaddr = address + (_new.height * prev_surface->get_rsx_pitch()); - const u32 bytes_to_texels_x = (bpp * prev_surface->samples_x); + const u32 bytes_to_texels_x = (prev_bpp * prev_surface->samples_x); deferred_clipped_region copy; copy.src_x = 0;