From 7840cd914e16cc4c209e1788d0f4cbbea0c41eb4 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Fri, 5 Jul 2019 21:21:48 +0300 Subject: [PATCH] rsx: Fixup nv3089::image_in - Correct pitch when sourcing from temp block - Remove obsolete? double transfer that also introduced a stale pointer reference to freed memory --- rpcs3/Emu/RSX/rsx_methods.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/rpcs3/Emu/RSX/rsx_methods.cpp b/rpcs3/Emu/RSX/rsx_methods.cpp index 9c6d633a49..56454a2958 100644 --- a/rpcs3/Emu/RSX/rsx_methods.cpp +++ b/rpcs3/Emu/RSX/rsx_methods.cpp @@ -1128,6 +1128,7 @@ namespace rsx } pixels_src = temp3.get(); + in_pitch = out_pitch; } // It looks like rsx may ignore the requested swizzle size and just always @@ -1146,10 +1147,8 @@ namespace rsx u32 sw_width = next_pow2(out_w); u32 sw_height = next_pow2(out_h); - temp3.reset(new u8[out_bpp * sw_width * sw_height]); - u8* linear_pixels = pixels_src; - u8* swizzled_pixels = temp3.get(); + u8* swizzled_pixels = pixels_dst; // Check and pad texture out if we are given non power of 2 output if (sw_width != out_w || sw_height != out_h) @@ -1184,8 +1183,6 @@ namespace rsx convert_linear_swizzle(linear_pixels, swizzled_pixels, sw_width, sw_height, in_pitch, false); break; } - - std::memcpy(pixels_dst, swizzled_pixels, out_bpp * sw_width * sw_height); } } }