summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-04-16 04:42:34 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2019-04-16 04:42:34 +0200
commit3e96c367bd1729d1a6c8bfd8b532301da85d4b5a (patch)
treefc6d89a805631f36bbe1de700fc9130745291b0a
parentImplement Block Linear copies in Kepler Memory. (diff)
downloadyuzu-3e96c367bd1729d1a6c8bfd8b532301da85d4b5a.tar
yuzu-3e96c367bd1729d1a6c8bfd8b532301da85d4b5a.tar.gz
yuzu-3e96c367bd1729d1a6c8bfd8b532301da85d4b5a.tar.bz2
yuzu-3e96c367bd1729d1a6c8bfd8b532301da85d4b5a.tar.lz
yuzu-3e96c367bd1729d1a6c8bfd8b532301da85d4b5a.tar.xz
yuzu-3e96c367bd1729d1a6c8bfd8b532301da85d4b5a.tar.zst
yuzu-3e96c367bd1729d1a6c8bfd8b532301da85d4b5a.zip
-rw-r--r--src/video_core/engines/kepler_memory.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/video_core/engines/kepler_memory.cpp b/src/video_core/engines/kepler_memory.cpp
index 4df19c1f5..7387886a3 100644
--- a/src/video_core/engines/kepler_memory.cpp
+++ b/src/video_core/engines/kepler_memory.cpp
@@ -50,15 +50,8 @@ void KeplerMemory::ProcessData(u32 data, bool is_last_call) {
state.write_offset += sub_copy_size;
if (is_last_call) {
const GPUVAddr address{regs.dest.Address()};
- const auto host_ptr = memory_manager.GetPointer(address);
if (regs.exec.linear != 0) {
- // 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(ToCacheAddr(host_ptr), state.copy_size);
- std::memcpy(host_ptr, state.inner_buffer.data(), state.copy_size);
- system.GPU().Maxwell3D().dirty_flags.OnMemoryWrite();
+ memory_manager.WriteBlock(address, state.inner_buffer.data(), state.copy_size);
} else {
UNIMPLEMENTED_IF(regs.dest.z != 0);
UNIMPLEMENTED_IF(regs.dest.depth != 1);
@@ -66,11 +59,14 @@ void KeplerMemory::ProcessData(u32 data, bool is_last_call) {
UNIMPLEMENTED_IF(regs.dest.BlockDepth() != 1);
const std::size_t dst_size = Tegra::Texture::CalculateSize(
true, 1, regs.dest.width, regs.dest.height, 1, regs.dest.BlockHeight(), 1);
- rasterizer.InvalidateRegion(ToCacheAddr(host_ptr), dst_size);
+ std::vector<u8> tmp_buffer(dst_size);
+ memory_manager.ReadBlock(address, tmp_buffer.data(), dst_size);
Tegra::Texture::SwizzleKepler(regs.dest.width, regs.dest.height, regs.dest.x,
regs.dest.y, regs.dest.BlockHeight(), state.copy_size,
- state.inner_buffer.data(), host_ptr);
+ state.inner_buffer.data(), tmp_buffer.data());
+ memory_manager.WriteBlock(address, tmp_buffer.data(), dst_size);
}
+ system.GPU().Maxwell3D().dirty_flags.OnMemoryWrite();
}
}