diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-02-18 03:29:04 +0100 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-04-22 17:36:12 +0200 |
commit | 165ae823f522aa981129927f42e76763a9fa6006 (patch) | |
tree | 5b20ac78e3946e50aa37f76a1446a42654bf3511 /src/video_core/buffer_cache/buffer_cache.h | |
parent | FenceManager: Implement should wait. (diff) | |
download | yuzu-165ae823f522aa981129927f42e76763a9fa6006.tar yuzu-165ae823f522aa981129927f42e76763a9fa6006.tar.gz yuzu-165ae823f522aa981129927f42e76763a9fa6006.tar.bz2 yuzu-165ae823f522aa981129927f42e76763a9fa6006.tar.lz yuzu-165ae823f522aa981129927f42e76763a9fa6006.tar.xz yuzu-165ae823f522aa981129927f42e76763a9fa6006.tar.zst yuzu-165ae823f522aa981129927f42e76763a9fa6006.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/buffer_cache/buffer_cache.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 5b14d52e2..df4c0211e 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -145,6 +145,18 @@ public: } } + bool MustFlushRegion(VAddr addr, std::size_t size) { + std::lock_guard lock{mutex}; + + std::vector<MapInterval> objects = GetMapsInRange(addr, size); + for (auto& object : objects) { + if (object->IsModified() && object->IsRegistered()) { + return true; + } + } + return false; + } + /// Mark the specified region as being invalidated void InvalidateRegion(VAddr addr, u64 size) { std::lock_guard lock{mutex}; |