aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/video_core/gpu.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <[email protected]>2023-06-28 19:32:50 +0200
committerFernando Sahmkow <[email protected]>2023-06-28 21:32:45 +0200
commitda440da9f54cc860f3c69da685a415d5ec9d7b64 (patch)
tree5a7a4a56462244970e1356a723e6a8a77477f820 /src/video_core/gpu.cpp
parent47d0d292d5cc5f0404e126023279db7decd532ac (diff)
downloadyuzu-android-da440da9f54cc860f3c69da685a415d5ec9d7b64.tar.gz
yuzu-android-da440da9f54cc860f3c69da685a415d5ec9d7b64.zip
Memory Tracking: Optimize tracking to only use atomic writes when contested with the host GPU
Diffstat (limited to 'src/video_core/gpu.cpp')
-rw-r--r--src/video_core/gpu.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp
index f823a1e2b..c192e33b2 100644
--- a/src/video_core/gpu.cpp
+++ b/src/video_core/gpu.cpp
@@ -96,7 +96,7 @@ struct GPU::Impl {
/// Synchronizes CPU writes with Host GPU memory.
void InvalidateGPUCache() {
std::function<void(VAddr, size_t)> callback_writes(
- [this](VAddr address, size_t size) { rasterizer->OnCPUWrite(address, size); });
+ [this](VAddr address, size_t size) { rasterizer->OnCacheInvalidation(address, size); });
system.GatherGPUDirtyMemory(callback_writes);
}
@@ -301,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);
@@ -563,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);
}