GPU/DMA: Flush the source memory region before a DMA transfer and invalidate the destination region after the transfer.

This commit is contained in:
Subv
2018-09-17 09:46:53 -05:00
parent d0a814eaca
commit 393f2418c5

View File

@@ -65,6 +65,10 @@ void MaxwellDMA::HandleCopy() {
}
ASSERT(regs.exec.enable_2d == 1);
// TODO(Subv): For now, manually flush the regions until we implement GPU-accelerated copying.
rasterizer.FlushRegion(source_cpu, copy_size);
u8* src_buffer = Memory::GetPointer(source_cpu);
u8* dst_buffer = Memory::GetPointer(dest_cpu);
@@ -77,6 +81,9 @@ void MaxwellDMA::HandleCopy() {
Texture::CopySwizzledData(regs.dst_params.size_x, regs.dst_params.size_y, 1, 1, dst_buffer,
src_buffer, false, regs.dst_params.BlockHeight());
}
// We have to invalidate the destination region to evict any outdated surfaces from the cache.
rasterizer.InvalidateRegion(dest_cpu, copy_size);
}
} // namespace Engines