diff options
| author | 2019-04-15 22:42:34 -0400 | |
|---|---|---|
| committer | 2019-04-15 22:42:34 -0400 | |
| commit | 3e96c367bd1729d1a6c8bfd8b532301da85d4b5a (patch) | |
| tree | fc6d89a805631f36bbe1de700fc9130745291b0a /src | |
| parent | Implement Block Linear copies in Kepler Memory. (diff) | |
| download | yuzu-3e96c367bd1729d1a6c8bfd8b532301da85d4b5a.tar.gz yuzu-3e96c367bd1729d1a6c8bfd8b532301da85d4b5a.tar.xz yuzu-3e96c367bd1729d1a6c8bfd8b532301da85d4b5a.zip | |
Use WriteBlock and ReadBlock.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/engines/kepler_memory.cpp | 16 |
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) { | |||
| 50 | state.write_offset += sub_copy_size; | 50 | state.write_offset += sub_copy_size; |
| 51 | if (is_last_call) { | 51 | if (is_last_call) { |
| 52 | const GPUVAddr address{regs.dest.Address()}; | 52 | const GPUVAddr address{regs.dest.Address()}; |
| 53 | const auto host_ptr = memory_manager.GetPointer(address); | ||
| 54 | if (regs.exec.linear != 0) { | 53 | if (regs.exec.linear != 0) { |
| 55 | // We have to invalidate the destination region to evict any outdated surfaces from the | 54 | memory_manager.WriteBlock(address, state.inner_buffer.data(), state.copy_size); |
| 56 | // cache. We do this before actually writing the new data because the destination | ||
| 57 | // address might contain a dirty surface that will have to be written back to memory. | ||
| 58 | |||
| 59 | rasterizer.InvalidateRegion(ToCacheAddr(host_ptr), state.copy_size); | ||
| 60 | std::memcpy(host_ptr, state.inner_buffer.data(), state.copy_size); | ||
| 61 | system.GPU().Maxwell3D().dirty_flags.OnMemoryWrite(); | ||
| 62 | } else { | 55 | } else { |
| 63 | UNIMPLEMENTED_IF(regs.dest.z != 0); | 56 | UNIMPLEMENTED_IF(regs.dest.z != 0); |
| 64 | UNIMPLEMENTED_IF(regs.dest.depth != 1); | 57 | UNIMPLEMENTED_IF(regs.dest.depth != 1); |
| @@ -66,11 +59,14 @@ void KeplerMemory::ProcessData(u32 data, bool is_last_call) { | |||
| 66 | UNIMPLEMENTED_IF(regs.dest.BlockDepth() != 1); | 59 | UNIMPLEMENTED_IF(regs.dest.BlockDepth() != 1); |
| 67 | const std::size_t dst_size = Tegra::Texture::CalculateSize( | 60 | const std::size_t dst_size = Tegra::Texture::CalculateSize( |
| 68 | true, 1, regs.dest.width, regs.dest.height, 1, regs.dest.BlockHeight(), 1); | 61 | true, 1, regs.dest.width, regs.dest.height, 1, regs.dest.BlockHeight(), 1); |
| 69 | rasterizer.InvalidateRegion(ToCacheAddr(host_ptr), dst_size); | 62 | std::vector<u8> tmp_buffer(dst_size); |
| 63 | memory_manager.ReadBlock(address, tmp_buffer.data(), dst_size); | ||
| 70 | Tegra::Texture::SwizzleKepler(regs.dest.width, regs.dest.height, regs.dest.x, | 64 | Tegra::Texture::SwizzleKepler(regs.dest.width, regs.dest.height, regs.dest.x, |
| 71 | regs.dest.y, regs.dest.BlockHeight(), state.copy_size, | 65 | regs.dest.y, regs.dest.BlockHeight(), state.copy_size, |
| 72 | state.inner_buffer.data(), host_ptr); | 66 | state.inner_buffer.data(), tmp_buffer.data()); |
| 67 | memory_manager.WriteBlock(address, tmp_buffer.data(), dst_size); | ||
| 73 | } | 68 | } |
| 69 | system.GPU().Maxwell3D().dirty_flags.OnMemoryWrite(); | ||
| 74 | } | 70 | } |
| 75 | } | 71 | } |
| 76 | 72 | ||