diff options
author | bunnei <bunneidev@gmail.com> | 2018-10-18 02:44:07 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-10-19 04:41:13 +0200 |
commit | a5d853a9f8a19dedbc6cb77e8ca714f65819ad1d (patch) | |
tree | 22c956e71c5fb69d5101bb4908a99188bfc174e2 /src/video_core/engines/kepler_memory.cpp | |
parent | fermi_2d: Add support for more accurate surface copies. (diff) | |
download | yuzu-a5d853a9f8a19dedbc6cb77e8ca714f65819ad1d.tar yuzu-a5d853a9f8a19dedbc6cb77e8ca714f65819ad1d.tar.gz yuzu-a5d853a9f8a19dedbc6cb77e8ca714f65819ad1d.tar.bz2 yuzu-a5d853a9f8a19dedbc6cb77e8ca714f65819ad1d.tar.lz yuzu-a5d853a9f8a19dedbc6cb77e8ca714f65819ad1d.tar.xz yuzu-a5d853a9f8a19dedbc6cb77e8ca714f65819ad1d.tar.zst yuzu-a5d853a9f8a19dedbc6cb77e8ca714f65819ad1d.zip |
Diffstat (limited to 'src/video_core/engines/kepler_memory.cpp')
-rw-r--r-- | src/video_core/engines/kepler_memory.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/video_core/engines/kepler_memory.cpp b/src/video_core/engines/kepler_memory.cpp index 66ae6332d..585290d9f 100644 --- a/src/video_core/engines/kepler_memory.cpp +++ b/src/video_core/engines/kepler_memory.cpp @@ -5,10 +5,14 @@ #include "common/logging/log.h" #include "core/memory.h" #include "video_core/engines/kepler_memory.h" +#include "video_core/rasterizer_interface.h" namespace Tegra::Engines { -KeplerMemory::KeplerMemory(MemoryManager& memory_manager) : memory_manager(memory_manager) {} +KeplerMemory::KeplerMemory(VideoCore::RasterizerInterface& rasterizer, + MemoryManager& memory_manager) + : memory_manager(memory_manager), rasterizer{rasterizer} {} + KeplerMemory::~KeplerMemory() = default; void KeplerMemory::WriteReg(u32 method, u32 value) { @@ -37,6 +41,11 @@ void KeplerMemory::ProcessData(u32 data) { VAddr dest_address = *memory_manager.GpuToCpuAddress(address + state.write_offset * sizeof(u32)); + // 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. + rasterizer.InvalidateRegion(dest_address, sizeof(u32)); + Memory::Write32(dest_address, data); state.write_offset++; |