diff options
| -rw-r--r-- | src/video_core/engines/maxwell_dma.cpp | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/src/video_core/engines/maxwell_dma.cpp b/src/video_core/engines/maxwell_dma.cpp index 4eb7a100d..54523a4b2 100644 --- a/src/video_core/engines/maxwell_dma.cpp +++ b/src/video_core/engines/maxwell_dma.cpp | |||
| @@ -102,26 +102,29 @@ void MaxwellDMA::Launch() { | |||
| 102 | const bool is_src_pitch = IsPitchKind(static_cast<PTEKind>(src_kind)); | 102 | const bool is_src_pitch = IsPitchKind(static_cast<PTEKind>(src_kind)); |
| 103 | const bool is_dst_pitch = IsPitchKind(static_cast<PTEKind>(dst_kind)); | 103 | const bool is_dst_pitch = IsPitchKind(static_cast<PTEKind>(dst_kind)); |
| 104 | if (!is_src_pitch && is_dst_pitch) { | 104 | if (!is_src_pitch && is_dst_pitch) { |
| 105 | std::vector<u8> tmp_buffer(regs.line_length_in); | 105 | UNIMPLEMENTED_IF(regs.line_length_in % 16 != 0); |
| 106 | std::vector<u8> dst_buffer(regs.line_length_in); | 106 | UNIMPLEMENTED_IF(regs.offset_in % 16 != 0); |
| 107 | memory_manager.ReadBlockUnsafe(regs.offset_in, tmp_buffer.data(), | 107 | UNIMPLEMENTED_IF(regs.offset_out % 16 != 0); |
| 108 | regs.line_length_in); | 108 | std::vector<u8> tmp_buffer(16); |
| 109 | for (u32 offset = 0; offset < regs.line_length_in; ++offset) { | 109 | for (u32 offset = 0; offset < regs.line_length_in; offset += 16) { |
| 110 | dst_buffer[offset] = | 110 | memory_manager.ReadBlockUnsafe( |
| 111 | tmp_buffer[convert_linear_2_blocklinear_addr(regs.offset_in + offset) - | 111 | convert_linear_2_blocklinear_addr(regs.offset_in + offset), |
| 112 | regs.offset_in]; | 112 | tmp_buffer.data(), tmp_buffer.size()); |
| 113 | memory_manager.WriteBlock(regs.offset_out + offset, tmp_buffer.data(), | ||
| 114 | tmp_buffer.size()); | ||
| 113 | } | 115 | } |
| 114 | memory_manager.WriteBlock(regs.offset_out, dst_buffer.data(), regs.line_length_in); | ||
| 115 | } else if (is_src_pitch && !is_dst_pitch) { | 116 | } else if (is_src_pitch && !is_dst_pitch) { |
| 116 | std::vector<u8> tmp_buffer(regs.line_length_in); | 117 | UNIMPLEMENTED_IF(regs.line_length_in % 16 != 0); |
| 117 | std::vector<u8> dst_buffer(regs.line_length_in); | 118 | UNIMPLEMENTED_IF(regs.offset_in % 16 != 0); |
| 118 | memory_manager.ReadBlockUnsafe(regs.offset_in, tmp_buffer.data(), | 119 | UNIMPLEMENTED_IF(regs.offset_out % 16 != 0); |
| 119 | regs.line_length_in); | 120 | std::vector<u8> tmp_buffer(16); |
| 120 | for (u32 offset = 0; offset < regs.line_length_in; ++offset) { | 121 | for (u32 offset = 0; offset < regs.line_length_in; offset += 16) { |
| 121 | dst_buffer[convert_linear_2_blocklinear_addr(regs.offset_out + offset) - | 122 | memory_manager.ReadBlockUnsafe(regs.offset_in + offset, tmp_buffer.data(), |
| 122 | regs.offset_out] = tmp_buffer[offset]; | 123 | tmp_buffer.size()); |
| 124 | memory_manager.WriteBlock( | ||
| 125 | convert_linear_2_blocklinear_addr(regs.offset_out + offset), | ||
| 126 | tmp_buffer.data(), tmp_buffer.size()); | ||
| 123 | } | 127 | } |
| 124 | memory_manager.WriteBlock(regs.offset_out, dst_buffer.data(), regs.line_length_in); | ||
| 125 | } else { | 128 | } else { |
| 126 | if (!accelerate.BufferCopy(regs.offset_in, regs.offset_out, regs.line_length_in)) { | 129 | if (!accelerate.BufferCopy(regs.offset_in, regs.offset_out, regs.line_length_in)) { |
| 127 | std::vector<u8> tmp_buffer(regs.line_length_in); | 130 | std::vector<u8> tmp_buffer(regs.line_length_in); |