[GPU] TextureCache lockless pre-check

lockless accessors for base_outdated/mips_outdated and skip lock
acquisition when textures appear up to date
This commit is contained in:
Herman S.
2025-12-31 14:08:01 +09:00
parent 067641668f
commit 77852914ff
2 changed files with 27 additions and 0 deletions

View File

@@ -276,6 +276,11 @@ class TextureCache {
bool mips_outdated(const global_unique_lock_type& global_lock) const {
return mips_outdated_;
}
// Lockless accessors for pre-check optimization.
// Safe to read without lock - worst case is false positive (outdated when
// not).
bool base_outdated_lockless() const { return base_outdated_; }
bool mips_outdated_lockless() const { return mips_outdated_; }
void MakeUpToDateAndWatch(const global_unique_lock_type& global_lock);
void WatchCallback(const global_unique_lock_type& global_lock, bool is_mip);