summaryrefslogtreecommitdiffstats
path: root/src/video_core/engines
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2018-09-08 23:02:16 +0200
committerSubv <subv2112@gmail.com>2018-09-08 23:02:16 +0200
commitfdb199290bb1752e1500997a39a4e458e7d62a0a (patch)
tree08f7bae3bbb8e9eb3b275243a2f2a2530cb1461e /src/video_core/engines
parentMerge pull request #1246 from degasus/instanced_rendering (diff)
downloadyuzu-fdb199290bb1752e1500997a39a4e458e7d62a0a.tar
yuzu-fdb199290bb1752e1500997a39a4e458e7d62a0a.tar.gz
yuzu-fdb199290bb1752e1500997a39a4e458e7d62a0a.tar.bz2
yuzu-fdb199290bb1752e1500997a39a4e458e7d62a0a.tar.lz
yuzu-fdb199290bb1752e1500997a39a4e458e7d62a0a.tar.xz
yuzu-fdb199290bb1752e1500997a39a4e458e7d62a0a.tar.zst
yuzu-fdb199290bb1752e1500997a39a4e458e7d62a0a.zip
Diffstat (limited to 'src/video_core/engines')
-rw-r--r--src/video_core/engines/maxwell_dma.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/video_core/engines/maxwell_dma.cpp b/src/video_core/engines/maxwell_dma.cpp
index 6e740713f..c24d33d5c 100644
--- a/src/video_core/engines/maxwell_dma.cpp
+++ b/src/video_core/engines/maxwell_dma.cpp
@@ -41,7 +41,6 @@ void MaxwellDMA::HandleCopy() {
// TODO(Subv): Perform more research and implement all features of this engine.
ASSERT(regs.exec.enable_swizzle == 0);
- ASSERT(regs.exec.enable_2d == 1);
ASSERT(regs.exec.query_mode == Regs::QueryMode::None);
ASSERT(regs.exec.query_intr == Regs::QueryIntr::None);
ASSERT(regs.exec.copy_mode == Regs::CopyMode::Unk2);
@@ -51,10 +50,19 @@ void MaxwellDMA::HandleCopy() {
ASSERT(regs.dst_params.pos_y == 0);
if (regs.exec.is_dst_linear == regs.exec.is_src_linear) {
- Memory::CopyBlock(dest_cpu, source_cpu, regs.x_count * regs.y_count);
+ size_t copy_size = regs.x_count;
+
+ // When the enable_2d bit is disabled, the copy is performed as if we were copying a 1D
+ // buffer of length `x_count`, otherwise we copy a 2D buffer of size (x_count, y_count).
+ if (regs.exec.enable_2d) {
+ copy_size = copy_size * regs.y_count;
+ }
+
+ Memory::CopyBlock(dest_cpu, source_cpu, copy_size);
return;
}
+ ASSERT(regs.exec.enable_2d == 1);
u8* src_buffer = Memory::GetPointer(source_cpu);
u8* dst_buffer = Memory::GetPointer(dest_cpu);