diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2023-06-25 04:25:35 +0200 |
---|---|---|
committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2023-07-01 03:49:59 +0200 |
commit | 5a09fa50122af7c56ca3a05b18a1d2ab1e6b0e8b (patch) | |
tree | 6c45bf19fd1cad30ade5451dd8651d95be435ca8 /src/video_core | |
parent | general: Use ScratchBuffer where possible (diff) | |
download | yuzu-5a09fa50122af7c56ca3a05b18a1d2ab1e6b0e8b.tar yuzu-5a09fa50122af7c56ca3a05b18a1d2ab1e6b0e8b.tar.gz yuzu-5a09fa50122af7c56ca3a05b18a1d2ab1e6b0e8b.tar.bz2 yuzu-5a09fa50122af7c56ca3a05b18a1d2ab1e6b0e8b.tar.lz yuzu-5a09fa50122af7c56ca3a05b18a1d2ab1e6b0e8b.tar.xz yuzu-5a09fa50122af7c56ca3a05b18a1d2ab1e6b0e8b.tar.zst yuzu-5a09fa50122af7c56ca3a05b18a1d2ab1e6b0e8b.zip |
Diffstat (limited to 'src/video_core')
-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() { src_operand.address = regs.offset_in; DMA::BufferOperand dst_operand; - u32 abs_pitch_out = std::abs(static_cast<s32>(regs.pitch_out)); - dst_operand.pitch = abs_pitch_out; + dst_operand.pitch = static_cast<u32>(std::abs(regs.pitch_out)); dst_operand.width = regs.line_length_in; dst_operand.height = regs.line_count; dst_operand.address = regs.offset_out; @@ -222,7 +221,7 @@ void MaxwellDMA::CopyBlockLinearToPitch() { const size_t src_size = CalculateSize(true, bytes_per_pixel, width, height, depth, block_height, block_depth); - const size_t dst_size = static_cast<size_t>(abs_pitch_out) * regs.line_count; + const size_t dst_size = dst_operand.pitch * regs.line_count; read_buffer.resize_destructive(src_size); write_buffer.resize_destructive(dst_size); @@ -231,7 +230,7 @@ void MaxwellDMA::CopyBlockLinearToPitch() { UnswizzleSubrect(write_buffer, read_buffer, bytes_per_pixel, width, height, depth, x_offset, src_params.origin.y, x_elements, regs.line_count, block_height, block_depth, - abs_pitch_out); + dst_operand.pitch); memory_manager.WriteBlockCached(regs.offset_out, write_buffer.data(), dst_size); } |