diff options
author | bunnei <bunneidev@gmail.com> | 2019-03-17 02:59:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-17 02:59:45 +0100 |
commit | 2392e146b09c2a4b3bb557bb3a20c4afc7f75957 (patch) | |
tree | 1eafa50be7af78d74b4781fbe858277ac8ab1d35 /src/video_core/engines/kepler_memory.cpp | |
parent | Merge pull request #2243 from bunnei/mem-simplify-cache (diff) | |
parent | video_core: Refactor to use MemoryManager interface for all memory access. (diff) | |
download | yuzu-2392e146b09c2a4b3bb557bb3a20c4afc7f75957.tar yuzu-2392e146b09c2a4b3bb557bb3a20c4afc7f75957.tar.gz yuzu-2392e146b09c2a4b3bb557bb3a20c4afc7f75957.tar.bz2 yuzu-2392e146b09c2a4b3bb557bb3a20c4afc7f75957.tar.lz yuzu-2392e146b09c2a4b3bb557bb3a20c4afc7f75957.tar.xz yuzu-2392e146b09c2a4b3bb557bb3a20c4afc7f75957.tar.zst yuzu-2392e146b09c2a4b3bb557bb3a20c4afc7f75957.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/engines/kepler_memory.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/video_core/engines/kepler_memory.cpp b/src/video_core/engines/kepler_memory.cpp index daefa43a6..0931b9626 100644 --- a/src/video_core/engines/kepler_memory.cpp +++ b/src/video_core/engines/kepler_memory.cpp @@ -41,18 +41,13 @@ void KeplerMemory::ProcessData(u32 data) { ASSERT_MSG(regs.exec.linear, "Non-linear uploads are not supported"); ASSERT(regs.dest.x == 0 && regs.dest.y == 0 && regs.dest.z == 0); - const GPUVAddr address = regs.dest.Address(); - const auto dest_address = - memory_manager.GpuToCpuAddress(address + state.write_offset * sizeof(u32)); - ASSERT_MSG(dest_address, "Invalid GPU address"); - // We have to invalidate the destination region to evict any outdated surfaces from the cache. - // We do this before actually writing the new data because the destination address might contain - // a dirty surface that will have to be written back to memory. - system.Renderer().Rasterizer().InvalidateRegion(ToCacheAddr(Memory::GetPointer(*dest_address)), - sizeof(u32)); + // We do this before actually writing the new data because the destination address might + // contain a dirty surface that will have to be written back to memory. + const GPUVAddr address{regs.dest.Address() + state.write_offset * sizeof(u32)}; + rasterizer.InvalidateRegion(ToCacheAddr(memory_manager.GetPointer(address)), sizeof(u32)); + memory_manager.Write32(address, data); - Memory::Write32(*dest_address, data); system.GPU().Maxwell3D().dirty_flags.OnMemoryWrite(); state.write_offset++; |