diff --git a/source/blender/blenlib/BLI_shared_cache.hh b/source/blender/blenlib/BLI_shared_cache.hh index 2f95c97d50c..ebb1c81cfc3 100644 --- a/source/blender/blenlib/BLI_shared_cache.hh +++ b/source/blender/blenlib/BLI_shared_cache.hh @@ -64,6 +64,22 @@ template class SharedCache { BLI_assert(cache_->mutex.is_cached()); return cache_->data; } + + /** + * Return true if the cache currently does not exist or has been invalidated. + */ + bool is_dirty() const + { + return cache_->mutex.is_dirty(); + } + + /** + * Return true if the cache exists and is valid. + */ + bool is_cached() const + { + return cache_->mutex.is_cached(); + } }; } // namespace blender