From 28e4a9e0d0a50a2fadb1bfa2ac9ce3478b34365a Mon Sep 17 00:00:00 2001 From: eladash Date: Fri, 30 Nov 2018 21:06:48 -0800 Subject: [PATCH] rsx image_in: Fix in_pitch 0 The hw doesnt fix pitch, when specifying src pitch 0 it copies the same pixels line to dst. keep in mind out_pitch = 0 is not allowed in image_in. Same goes for buffer_notify, though it allows out_pitch to be 0. --- rpcs3/Emu/RSX/Capture/rsx_capture.cpp | 13 +------------ rpcs3/Emu/RSX/rsx_methods.cpp | 15 --------------- 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/rpcs3/Emu/RSX/Capture/rsx_capture.cpp b/rpcs3/Emu/RSX/Capture/rsx_capture.cpp index 38707c0427..84d19fae97 100644 --- a/rpcs3/Emu/RSX/Capture/rsx_capture.cpp +++ b/rpcs3/Emu/RSX/Capture/rsx_capture.cpp @@ -150,7 +150,7 @@ namespace rsx { const auto& range = method_registers.current_draw_clause.get_range(); const u32 vertCount = range.count; - const size_t bufferSize = vertCount * vertStride + vertSize; + const size_t bufferSize = (vertCount - 1) * vertStride + vertSize; frame_capture_data::memory_block block; block.offset = base_address + (range.first * vertStride); @@ -306,11 +306,6 @@ namespace rsx u8* pixels_src = src_region.tile ? src_region.ptr + src_region.base : src_region.ptr; - if (in_pitch == 0) - { - in_pitch = in_bpp * in_w; - } - const u32 src_size = in_pitch * (in_h - 1) + (in_w * in_bpp); rsx->read_barrier(src_region.address, src_size); @@ -329,11 +324,6 @@ namespace rsx const u32 line_count = method_registers.nv0039_line_count(); const u8 in_format = method_registers.nv0039_input_format(); - if (!in_pitch) - { - in_pitch = line_length; - } - u32 src_offset = method_registers.nv0039_input_offset(); u32 src_dma = method_registers.nv0039_input_location(); u32 src_addr = get_address(src_offset, src_dma); @@ -355,7 +345,6 @@ namespace rsx } insert_mem_block_in_map(replay_command.memory_state, std::move(block), std::move(block_data)); - capture_display_tile_state(rsx, replay_command); } diff --git a/rpcs3/Emu/RSX/rsx_methods.cpp b/rpcs3/Emu/RSX/rsx_methods.cpp index 0ff4d881e1..b658df77d8 100644 --- a/rpcs3/Emu/RSX/rsx_methods.cpp +++ b/rpcs3/Emu/RSX/rsx_methods.cpp @@ -885,11 +885,6 @@ namespace rsx out_pitch = out_bpp * out_w; } - if (in_pitch == 0) - { - in_pitch = in_bpp * in_w; - } - const u32 in_offset = u32(in_x * in_bpp + in_pitch * in_y); const s32 out_offset = out_x * out_bpp + out_pitch * out_y; @@ -1165,16 +1160,6 @@ namespace rsx LOG_TRACE(RSX, "NV0039_OFFSET_IN: pitch(in=0x%x, out=0x%x), line(len=0x%x, cnt=0x%x), fmt(in=0x%x, out=0x%x), notify=0x%x", in_pitch, out_pitch, line_length, line_count, in_format, out_format, notify); - if (!in_pitch) - { - in_pitch = line_length; - } - - if (!out_pitch) - { - out_pitch = line_length; - } - u32 src_offset = method_registers.nv0039_input_offset(); u32 src_dma = method_registers.nv0039_input_location();