diff options
| author | 2023-06-24 22:25:35 -0400 | |
|---|---|---|
| committer | 2023-06-30 21:49:59 -0400 | |
| commit | 5a09fa50122af7c56ca3a05b18a1d2ab1e6b0e8b (patch) | |
| tree | 6c45bf19fd1cad30ade5451dd8651d95be435ca8 /src | |
| parent | general: Use ScratchBuffer where possible (diff) | |
| download | yuzu-5a09fa50122af7c56ca3a05b18a1d2ab1e6b0e8b.tar.gz yuzu-5a09fa50122af7c56ca3a05b18a1d2ab1e6b0e8b.tar.xz yuzu-5a09fa50122af7c56ca3a05b18a1d2ab1e6b0e8b.zip | |
maxwell_dma: Specify dst_operand.pitch instead of a temp var
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/engines/maxwell_dma.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/video_core/engines/maxwell_dma.cpp b/src/video_core/engines/maxwell_dma.cpp index a290d6ea7..f8598fd98 100644 --- a/src/video_core/engines/maxwell_dma.cpp +++ b/src/video_core/engines/maxwell_dma.cpp | |||
| @@ -174,8 +174,7 @@ void MaxwellDMA::CopyBlockLinearToPitch() { | |||
| 174 | src_operand.address = regs.offset_in; | 174 | src_operand.address = regs.offset_in; |
| 175 | 175 | ||
| 176 | DMA::BufferOperand dst_operand; | 176 | DMA::BufferOperand dst_operand; |
| 177 | u32 abs_pitch_out = std::abs(static_cast<s32>(regs.pitch_out)); | 177 | dst_operand.pitch = static_cast<u32>(std::abs(regs.pitch_out)); |
| 178 | dst_operand.pitch = abs_pitch_out; | ||
| 179 | dst_operand.width = regs.line_length_in; | 178 | dst_operand.width = regs.line_length_in; |
| 180 | dst_operand.height = regs.line_count; | 179 | dst_operand.height = regs.line_count; |
| 181 | dst_operand.address = regs.offset_out; | 180 | dst_operand.address = regs.offset_out; |
| @@ -222,7 +221,7 @@ void MaxwellDMA::CopyBlockLinearToPitch() { | |||
| 222 | const size_t src_size = | 221 | const size_t src_size = |
| 223 | CalculateSize(true, bytes_per_pixel, width, height, depth, block_height, block_depth); | 222 | CalculateSize(true, bytes_per_pixel, width, height, depth, block_height, block_depth); |
| 224 | 223 | ||
| 225 | const size_t dst_size = static_cast<size_t>(abs_pitch_out) * regs.line_count; | 224 | const size_t dst_size = dst_operand.pitch * regs.line_count; |
| 226 | read_buffer.resize_destructive(src_size); | 225 | read_buffer.resize_destructive(src_size); |
| 227 | write_buffer.resize_destructive(dst_size); | 226 | write_buffer.resize_destructive(dst_size); |
| 228 | 227 | ||
| @@ -231,7 +230,7 @@ void MaxwellDMA::CopyBlockLinearToPitch() { | |||
| 231 | 230 | ||
| 232 | UnswizzleSubrect(write_buffer, read_buffer, bytes_per_pixel, width, height, depth, x_offset, | 231 | UnswizzleSubrect(write_buffer, read_buffer, bytes_per_pixel, width, height, depth, x_offset, |
| 233 | src_params.origin.y, x_elements, regs.line_count, block_height, block_depth, | 232 | src_params.origin.y, x_elements, regs.line_count, block_height, block_depth, |
| 234 | abs_pitch_out); | 233 | dst_operand.pitch); |
| 235 | 234 | ||
| 236 | memory_manager.WriteBlockCached(regs.offset_out, write_buffer.data(), dst_size); | 235 | memory_manager.WriteBlockCached(regs.offset_out, write_buffer.data(), dst_size); |
| 237 | } | 236 | } |