mirror of
https://github.com/yuzu-emu/yuzu-android
synced 2024-12-23 19:11:21 -08:00
Use safe reads in DMA engine
This commit is contained in:
parent
3a991f3aef
commit
ffbaf574ca
@ -130,7 +130,7 @@ void MaxwellDMA::Launch() {
|
|||||||
UNIMPLEMENTED_IF(regs.offset_out % 16 != 0);
|
UNIMPLEMENTED_IF(regs.offset_out % 16 != 0);
|
||||||
read_buffer.resize_destructive(16);
|
read_buffer.resize_destructive(16);
|
||||||
for (u32 offset = 0; offset < regs.line_length_in; offset += 16) {
|
for (u32 offset = 0; offset < regs.line_length_in; offset += 16) {
|
||||||
memory_manager.ReadBlockUnsafe(
|
memory_manager.ReadBlock(
|
||||||
convert_linear_2_blocklinear_addr(regs.offset_in + offset),
|
convert_linear_2_blocklinear_addr(regs.offset_in + offset),
|
||||||
read_buffer.data(), read_buffer.size());
|
read_buffer.data(), read_buffer.size());
|
||||||
memory_manager.WriteBlockCached(regs.offset_out + offset, read_buffer.data(),
|
memory_manager.WriteBlockCached(regs.offset_out + offset, read_buffer.data(),
|
||||||
@ -142,7 +142,7 @@ void MaxwellDMA::Launch() {
|
|||||||
UNIMPLEMENTED_IF(regs.offset_out % 16 != 0);
|
UNIMPLEMENTED_IF(regs.offset_out % 16 != 0);
|
||||||
read_buffer.resize_destructive(16);
|
read_buffer.resize_destructive(16);
|
||||||
for (u32 offset = 0; offset < regs.line_length_in; offset += 16) {
|
for (u32 offset = 0; offset < regs.line_length_in; offset += 16) {
|
||||||
memory_manager.ReadBlockUnsafe(regs.offset_in + offset, read_buffer.data(),
|
memory_manager.ReadBlock(regs.offset_in + offset, read_buffer.data(),
|
||||||
read_buffer.size());
|
read_buffer.size());
|
||||||
memory_manager.WriteBlockCached(
|
memory_manager.WriteBlockCached(
|
||||||
convert_linear_2_blocklinear_addr(regs.offset_out + offset),
|
convert_linear_2_blocklinear_addr(regs.offset_out + offset),
|
||||||
@ -151,8 +151,9 @@ void MaxwellDMA::Launch() {
|
|||||||
} else {
|
} else {
|
||||||
if (!accelerate.BufferCopy(regs.offset_in, regs.offset_out, regs.line_length_in)) {
|
if (!accelerate.BufferCopy(regs.offset_in, regs.offset_out, regs.line_length_in)) {
|
||||||
read_buffer.resize_destructive(regs.line_length_in);
|
read_buffer.resize_destructive(regs.line_length_in);
|
||||||
memory_manager.ReadBlockUnsafe(regs.offset_in, read_buffer.data(),
|
memory_manager.ReadBlock(regs.offset_in, read_buffer.data(),
|
||||||
regs.line_length_in);
|
regs.line_length_in,
|
||||||
|
VideoCommon::CacheType::NoBufferCache);
|
||||||
memory_manager.WriteBlockCached(regs.offset_out, read_buffer.data(),
|
memory_manager.WriteBlockCached(regs.offset_out, read_buffer.data(),
|
||||||
regs.line_length_in);
|
regs.line_length_in);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user