summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-10-11 22:51:28 +0200
committerGitHub <noreply@github.com>2018-10-11 22:51:28 +0200
commitbc293e1751f090c46620e13e9d31a06acf9c575d (patch)
treefe855646af959686d7f2689f634bc45c063d07ab
parentMerge pull request #1477 from ReinUsesLisp/vmad (diff)
parentnvhost_as_gpu: Flush CPU VAddr on UnmapBuffer. (diff)
downloadyuzu-bc293e1751f090c46620e13e9d31a06acf9c575d.tar
yuzu-bc293e1751f090c46620e13e9d31a06acf9c575d.tar.gz
yuzu-bc293e1751f090c46620e13e9d31a06acf9c575d.tar.bz2
yuzu-bc293e1751f090c46620e13e9d31a06acf9c575d.tar.lz
yuzu-bc293e1751f090c46620e13e9d31a06acf9c575d.tar.xz
yuzu-bc293e1751f090c46620e13e9d31a06acf9c575d.tar.zst
yuzu-bc293e1751f090c46620e13e9d31a06acf9c575d.zip
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp
index 7555bbe7d..8d194e175 100644
--- a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp
@@ -167,10 +167,11 @@ u32 nvhost_as_gpu::UnmapBuffer(const std::vector<u8>& input, std::vector<u8>& ou
auto& system_instance = Core::System::GetInstance();
// Remove this memory region from the rasterizer cache.
- system_instance.Renderer().Rasterizer().FlushAndInvalidateRegion(params.offset,
- itr->second.size);
-
auto& gpu = system_instance.GPU();
+ auto cpu_addr = gpu.MemoryManager().GpuToCpuAddress(params.offset);
+ ASSERT(cpu_addr);
+ system_instance.Renderer().Rasterizer().FlushAndInvalidateRegion(*cpu_addr, itr->second.size);
+
params.offset = gpu.MemoryManager().UnmapBuffer(params.offset, itr->second.size);
buffer_mappings.erase(itr->second.offset);