diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-02-09 00:24:04 +0100 |
---|---|---|
committer | FernandoS27 <fsahmkow27@gmail.com> | 2019-02-28 02:57:33 +0100 |
commit | 45b6d2d349b35bd056dcb95a252da27a57c04c5f (patch) | |
tree | b3dd91ca9da7cf80083d75159a333d7d066b8d34 | |
parent | Merge pull request #2163 from ReinUsesLisp/bitset-dirty (diff) | |
download | yuzu-45b6d2d349b35bd056dcb95a252da27a57c04c5f.tar yuzu-45b6d2d349b35bd056dcb95a252da27a57c04c5f.tar.gz yuzu-45b6d2d349b35bd056dcb95a252da27a57c04c5f.tar.bz2 yuzu-45b6d2d349b35bd056dcb95a252da27a57c04c5f.tar.lz yuzu-45b6d2d349b35bd056dcb95a252da27a57c04c5f.tar.xz yuzu-45b6d2d349b35bd056dcb95a252da27a57c04c5f.tar.zst yuzu-45b6d2d349b35bd056dcb95a252da27a57c04c5f.zip |
-rw-r--r-- | src/video_core/rasterizer_cache.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/video_core/rasterizer_cache.h b/src/video_core/rasterizer_cache.h index bcf0c15a4..b239dff84 100644 --- a/src/video_core/rasterizer_cache.h +++ b/src/video_core/rasterizer_cache.h @@ -104,7 +104,7 @@ protected: } /// Register an object into the cache - void Register(const T& object) { + virtual void Register(const T& object) { object->SetIsRegistered(true); interval_cache.add({GetInterval(object), ObjectSet{object}}); map_cache.insert({object->GetAddr(), object}); @@ -112,7 +112,7 @@ protected: } /// Unregisters an object from the cache - void Unregister(const T& object) { + virtual void Unregister(const T& object) { object->SetIsRegistered(false); rasterizer.UpdatePagesCachedCount(object->GetAddr(), object->GetSizeInBytes(), -1); // Only flush if use_accurate_gpu_emulation is enabled, as it incurs a performance hit @@ -129,6 +129,15 @@ protected: return ++modified_ticks; } + /// Flushes the specified object, updating appropriate cache state as needed + void FlushObject(const T& object) { + if (!object->IsDirty()) { + return; + } + object->Flush(); + object->MarkAsModified(false, *this); + } + private: /// Returns a list of cached objects from the specified memory region, ordered by access time std::vector<T> GetSortedObjectsFromRegion(VAddr addr, u64 size) { @@ -154,15 +163,6 @@ private: return objects; } - /// Flushes the specified object, updating appropriate cache state as needed - void FlushObject(const T& object) { - if (!object->IsDirty()) { - return; - } - object->Flush(); - object->MarkAsModified(false, *this); - } - using ObjectSet = std::set<T>; using ObjectCache = std::unordered_map<VAddr, T>; using IntervalCache = boost::icl::interval_map<VAddr, ObjectSet>; |