summaryrefslogtreecommitdiffstats
path: root/src/video_core/gpu.cpp
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-07-02 17:29:01 +0200
committerGitHub <noreply@github.com>2023-07-02 17:29:01 +0200
commiteaa62aee988454f9cbd58219aa4d82d7e152c61d (patch)
tree8fa1e87467e9e37fce6ca159d8bb99d2ab907628 /src/video_core/gpu.cpp
parentMerge pull request #10710 from liamwhite/romfs2 (diff)
parentMemory Tracker: Use 64 bit atomics instead of 128 bits (diff)
downloadyuzu-eaa62aee988454f9cbd58219aa4d82d7e152c61d.tar
yuzu-eaa62aee988454f9cbd58219aa4d82d7e152c61d.tar.gz
yuzu-eaa62aee988454f9cbd58219aa4d82d7e152c61d.tar.bz2
yuzu-eaa62aee988454f9cbd58219aa4d82d7e152c61d.tar.lz
yuzu-eaa62aee988454f9cbd58219aa4d82d7e152c61d.tar.xz
yuzu-eaa62aee988454f9cbd58219aa4d82d7e152c61d.tar.zst
yuzu-eaa62aee988454f9cbd58219aa4d82d7e152c61d.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/gpu.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp
index db385076d..c192e33b2 100644
--- a/src/video_core/gpu.cpp
+++ b/src/video_core/gpu.cpp
@@ -95,7 +95,9 @@ struct GPU::Impl {
/// Synchronizes CPU writes with Host GPU memory.
void InvalidateGPUCache() {
- rasterizer->InvalidateGPUCache();
+ std::function<void(VAddr, size_t)> callback_writes(
+ [this](VAddr address, size_t size) { rasterizer->OnCacheInvalidation(address, size); });
+ system.GatherGPUDirtyMemory(callback_writes);
}
/// Signal the ending of command list.
@@ -299,6 +301,10 @@ struct GPU::Impl {
gpu_thread.InvalidateRegion(addr, size);
}
+ bool OnCPUWrite(VAddr addr, u64 size) {
+ return rasterizer->OnCPUWrite(addr, size);
+ }
+
/// Notify rasterizer that any caches of the specified region should be flushed and invalidated
void FlushAndInvalidateRegion(VAddr addr, u64 size) {
gpu_thread.FlushAndInvalidateRegion(addr, size);
@@ -561,6 +567,10 @@ void GPU::InvalidateRegion(VAddr addr, u64 size) {
impl->InvalidateRegion(addr, size);
}
+bool GPU::OnCPUWrite(VAddr addr, u64 size) {
+ return impl->OnCPUWrite(addr, size);
+}
+
void GPU::FlushAndInvalidateRegion(VAddr addr, u64 size) {
impl->FlushAndInvalidateRegion(addr, size);
}