summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2018-09-09 19:53:17 -0400
committerGravatar GitHub2018-09-09 19:53:17 -0400
commit223ddb20086324e9f91e84373beee87f5905c70a (patch)
tree4420185ecd0069281281d002f5d8133242a290e9 /src
parentMerge pull request #1280 from zero334/improvements (diff)
parentGPU/DMA: Partially implemented the 'enable_2d' bit in the DMA engine. (diff)
downloadyuzu-223ddb20086324e9f91e84373beee87f5905c70a.tar.gz
yuzu-223ddb20086324e9f91e84373beee87f5905c70a.tar.xz
yuzu-223ddb20086324e9f91e84373beee87f5905c70a.zip
Merge pull request #1272 from Subv/dma_2d
GPU/DMA: Partially implemented the 'enable_2d' bit in the DMA engine.
Diffstat (limited to 'src')
-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() {
41 41
42 // TODO(Subv): Perform more research and implement all features of this engine. 42 // TODO(Subv): Perform more research and implement all features of this engine.
43 ASSERT(regs.exec.enable_swizzle == 0); 43 ASSERT(regs.exec.enable_swizzle == 0);
44 ASSERT(regs.exec.enable_2d == 1);
45 ASSERT(regs.exec.query_mode == Regs::QueryMode::None); 44 ASSERT(regs.exec.query_mode == Regs::QueryMode::None);
46 ASSERT(regs.exec.query_intr == Regs::QueryIntr::None); 45 ASSERT(regs.exec.query_intr == Regs::QueryIntr::None);
47 ASSERT(regs.exec.copy_mode == Regs::CopyMode::Unk2); 46 ASSERT(regs.exec.copy_mode == Regs::CopyMode::Unk2);
@@ -51,10 +50,19 @@ void MaxwellDMA::HandleCopy() {
51 ASSERT(regs.dst_params.pos_y == 0); 50 ASSERT(regs.dst_params.pos_y == 0);
52 51
53 if (regs.exec.is_dst_linear == regs.exec.is_src_linear) { 52 if (regs.exec.is_dst_linear == regs.exec.is_src_linear) {
54 Memory::CopyBlock(dest_cpu, source_cpu, regs.x_count * regs.y_count); 53 size_t copy_size = regs.x_count;
54
55 // When the enable_2d bit is disabled, the copy is performed as if we were copying a 1D
56 // buffer of length `x_count`, otherwise we copy a 2D buffer of size (x_count, y_count).
57 if (regs.exec.enable_2d) {
58 copy_size = copy_size * regs.y_count;
59 }
60
61 Memory::CopyBlock(dest_cpu, source_cpu, copy_size);
55 return; 62 return;
56 } 63 }
57 64
65 ASSERT(regs.exec.enable_2d == 1);
58 u8* src_buffer = Memory::GetPointer(source_cpu); 66 u8* src_buffer = Memory::GetPointer(source_cpu);
59 u8* dst_buffer = Memory::GetPointer(dest_cpu); 67 u8* dst_buffer = Memory::GetPointer(dest_cpu);
60 68