diff options
Diffstat (limited to 'src/video_core/buffer_cache')
| -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: | |||
| 145 | } | 145 | } |
| 146 | } | 146 | } |
| 147 | 147 | ||
| 148 | bool MustFlushRegion(VAddr addr, std::size_t size) { | ||
| 149 | std::lock_guard lock{mutex}; | ||
| 150 | |||
| 151 | std::vector<MapInterval> objects = GetMapsInRange(addr, size); | ||
| 152 | for (auto& object : objects) { | ||
| 153 | if (object->IsModified() && object->IsRegistered()) { | ||
| 154 | return true; | ||
| 155 | } | ||
| 156 | } | ||
| 157 | return false; | ||
| 158 | } | ||
| 159 | |||
| 148 | /// Mark the specified region as being invalidated | 160 | /// Mark the specified region as being invalidated |
| 149 | void InvalidateRegion(VAddr addr, u64 size) { | 161 | void InvalidateRegion(VAddr addr, u64 size) { |
| 150 | std::lock_guard lock{mutex}; | 162 | std::lock_guard lock{mutex}; |