summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Kelebek12023-06-21 05:48:04 +0100
committerGravatar Kelebek12023-06-26 11:34:02 +0100
commitffbaf574ca1aa5e1559beee1c11bf732ec1c323c (patch)
treeb75456cd55f90c4e34afc4b8dfcb4b29bf88240d /src
parentMerge pull request #10891 from german77/sdl28v2 (diff)
downloadyuzu-ffbaf574ca1aa5e1559beee1c11bf732ec1c323c.tar.gz
yuzu-ffbaf574ca1aa5e1559beee1c11bf732ec1c323c.tar.xz
yuzu-ffbaf574ca1aa5e1559beee1c11bf732ec1c323c.zip
Use safe reads in DMA engine
Diffstat (limited to 'src')
-rw-r--r--src/video_core/engines/maxwell_dma.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/video_core/engines/maxwell_dma.cpp b/src/video_core/engines/maxwell_dma.cpp
index bc1eb41e7..a290d6ea7 100644
--- a/src/video_core/engines/maxwell_dma.cpp
+++ b/src/video_core/engines/maxwell_dma.cpp
@@ -130,7 +130,7 @@ void MaxwellDMA::Launch() {
130 UNIMPLEMENTED_IF(regs.offset_out % 16 != 0); 130 UNIMPLEMENTED_IF(regs.offset_out % 16 != 0);
131 read_buffer.resize_destructive(16); 131 read_buffer.resize_destructive(16);
132 for (u32 offset = 0; offset < regs.line_length_in; offset += 16) { 132 for (u32 offset = 0; offset < regs.line_length_in; offset += 16) {
133 memory_manager.ReadBlockUnsafe( 133 memory_manager.ReadBlock(
134 convert_linear_2_blocklinear_addr(regs.offset_in + offset), 134 convert_linear_2_blocklinear_addr(regs.offset_in + offset),
135 read_buffer.data(), read_buffer.size()); 135 read_buffer.data(), read_buffer.size());
136 memory_manager.WriteBlockCached(regs.offset_out + offset, read_buffer.data(), 136 memory_manager.WriteBlockCached(regs.offset_out + offset, read_buffer.data(),
@@ -142,8 +142,8 @@ void MaxwellDMA::Launch() {
142 UNIMPLEMENTED_IF(regs.offset_out % 16 != 0); 142 UNIMPLEMENTED_IF(regs.offset_out % 16 != 0);
143 read_buffer.resize_destructive(16); 143 read_buffer.resize_destructive(16);
144 for (u32 offset = 0; offset < regs.line_length_in; offset += 16) { 144 for (u32 offset = 0; offset < regs.line_length_in; offset += 16) {
145 memory_manager.ReadBlockUnsafe(regs.offset_in + offset, read_buffer.data(), 145 memory_manager.ReadBlock(regs.offset_in + offset, read_buffer.data(),
146 read_buffer.size()); 146 read_buffer.size());
147 memory_manager.WriteBlockCached( 147 memory_manager.WriteBlockCached(
148 convert_linear_2_blocklinear_addr(regs.offset_out + offset), 148 convert_linear_2_blocklinear_addr(regs.offset_out + offset),
149 read_buffer.data(), read_buffer.size()); 149 read_buffer.data(), read_buffer.size());
@@ -151,8 +151,9 @@ void MaxwellDMA::Launch() {
151 } else { 151 } else {
152 if (!accelerate.BufferCopy(regs.offset_in, regs.offset_out, regs.line_length_in)) { 152 if (!accelerate.BufferCopy(regs.offset_in, regs.offset_out, regs.line_length_in)) {
153 read_buffer.resize_destructive(regs.line_length_in); 153 read_buffer.resize_destructive(regs.line_length_in);
154 memory_manager.ReadBlockUnsafe(regs.offset_in, read_buffer.data(), 154 memory_manager.ReadBlock(regs.offset_in, read_buffer.data(),
155 regs.line_length_in); 155 regs.line_length_in,
156 VideoCommon::CacheType::NoBufferCache);
156 memory_manager.WriteBlockCached(regs.offset_out, read_buffer.data(), 157 memory_manager.WriteBlockCached(regs.offset_out, read_buffer.data(),
157 regs.line_length_in); 158 regs.line_length_in);
158 } 159 }