diff options
author | Michael Kowalski <makowalski@nvidia.com> | 2022-11-08 03:37:51 +0300 |
---|---|---|
committer | Michael Kowalski <makowalski@nvidia.com> | 2022-11-08 03:37:51 +0300 |
commit | a400935d29f54b9bd821d093873eb4643a279e59 (patch) | |
tree | 5dbd37ed111ee47c0dbe5696b834c3a16e96435c /source/blender/compositor/realtime_compositor/cached_resources/COM_cached_resource.hh | |
parent | 036e10e5462b95ec6a12e9dd4a900ba7ff05032c (diff) | |
parent | d8dab1ba978e32af9af581fbd4c4bc0682278703 (diff) |
Merge branch 'tmp-vfx-platform-2023' into tmp-dynamic-usdtmp-dynamic-usd
Diffstat (limited to 'source/blender/compositor/realtime_compositor/cached_resources/COM_cached_resource.hh')
-rw-r--r-- | source/blender/compositor/realtime_compositor/cached_resources/COM_cached_resource.hh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/source/blender/compositor/realtime_compositor/cached_resources/COM_cached_resource.hh b/source/blender/compositor/realtime_compositor/cached_resources/COM_cached_resource.hh new file mode 100644 index 00000000000..fe3158ef52d --- /dev/null +++ b/source/blender/compositor/realtime_compositor/cached_resources/COM_cached_resource.hh @@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#pragma once + +namespace blender::realtime_compositor { + +/* ------------------------------------------------------------------------------------------------- + * Cached Resource. + * + * A cached resource is any resource that can be cached across compositor evaluations and across + * multiple operations. Cached resources are managed by an instance of a StaticCacheManager and are + * freed when they are no longer needed, a state which is represented by the `needed` member in the + * class. For more information on the caching mechanism, see the StaticCacheManager class. + * + * To add a new cached resource: + * + * - Create a derived class from CachedResource to represent the resource. + * - Create a key class that can be used in a Map to identify the resource. + * - Add a new Map to StaticCacheManager mapping the key to the resource. + * - Reset the contents of the added map in StaticCacheManager::reset. + * - Add an appropriate getter method in StaticCacheManager. + * + * See the existing cached resources for reference. */ +class CachedResource { + public: + /* A flag that represents the needed status of the cached resource. See the StaticCacheManager + * class for more information on how this member is utilized in the caching mechanism. */ + bool needed = true; +}; + +} // namespace blender::realtime_compositor |