Blender
V4.5
source
blender
compositor
COM_static_cache_manager.hh
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2023 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
5
#pragma once
6
7
#include "
COM_bokeh_kernel.hh
"
8
#include "
COM_cached_image.hh
"
9
#include "
COM_cached_mask.hh
"
10
#include "
COM_cached_shader.hh
"
11
#include "
COM_cached_texture.hh
"
12
#include "
COM_deriche_gaussian_coefficients.hh
"
13
#include "
COM_distortion_grid.hh
"
14
#include "
COM_fog_glow_kernel.hh
"
15
#include "
COM_image_coordinates.hh
"
16
#include "
COM_keying_screen.hh
"
17
#include "
COM_morphological_distance_feather_weights.hh
"
18
#include "
COM_ocio_color_space_conversion_shader.hh
"
19
#include "
COM_smaa_precomputed_textures.hh
"
20
#include "
COM_symmetric_blur_weights.hh
"
21
#include "
COM_symmetric_separable_blur_weights.hh
"
22
#include "
COM_van_vliet_gaussian_coefficients.hh
"
23
24
namespace
blender::compositor
{
25
26
/* -------------------------------------------------------------------------------------------------
27
* Static Cache Manager
28
*
29
* A static cache manager is a collection of cached resources that can be retrieved when needed and
30
* created if not already available. In particular, each cached resource type has its own instance
31
* of a container derived from the CachedResourceContainer type in the class. All instances of that
32
* cached resource type are stored and tracked in the container. See the CachedResource and
33
* CachedResourceContainer classes for more information.
34
*
35
* The manager deletes the cached resources that are no longer needed. A cached resource is said to
36
* be not needed when it was not used in the previous evaluation. This is done through the
37
* following mechanism:
38
*
39
* - Before every evaluation, do the following:
40
* 1. All resources whose CachedResource::needed flag is false are deleted.
41
* 2. The CachedResource::needed flag of all remaining resources is set to false.
42
* - During evaluation, when retrieving any cached resource, set its CachedResource::needed flag to
43
* true.
44
*
45
* In effect, any resource that was used in the previous evaluation but was not used in the current
46
* evaluation will be deleted before the next evaluation. This mechanism is implemented in the
47
* reset() method of the class, which should be called before every evaluation. The reset for the
48
* next evaluation can be skipped by calling the skip_next_reset() method, see its description for
49
* more information. */
50
class
StaticCacheManager
{
51
public
:
52
SymmetricBlurWeightsContainer
symmetric_blur_weights
;
53
SymmetricSeparableBlurWeightsContainer
symmetric_separable_blur_weights
;
54
MorphologicalDistanceFeatherWeightsContainer
morphological_distance_feather_weights
;
55
CachedTextureContainer
cached_textures
;
56
CachedMaskContainer
cached_masks
;
57
SMAAPrecomputedTexturesContainer
smaa_precomputed_textures
;
58
OCIOColorSpaceConversionShaderContainer
ocio_color_space_conversion_shaders
;
59
DistortionGridContainer
distortion_grids
;
60
KeyingScreenContainer
keying_screens
;
61
CachedShaderContainer
cached_shaders
;
62
BokehKernelContainer
bokeh_kernels
;
63
CachedImageContainer
cached_images
;
64
DericheGaussianCoefficientsContainer
deriche_gaussian_coefficients
;
65
VanVlietGaussianCoefficientsContainer
van_vliet_gaussian_coefficients
;
66
FogGlowKernelContainer
fog_glow_kernels
;
67
ImageCoordinatesContainer
image_coordinates
;
68
69
private
:
70
/* The cache manager should skip the next reset. See the skip_next_reset() method for more
71
* information. */
72
bool
should_skip_next_reset_ =
false
;
73
74
public
:
75
/* Reset the cache manager by deleting the cached resources that are no longer needed because
76
* they weren't used in the last evaluation and prepare the remaining cached resources to track
77
* their needed status in the next evaluation. See the class description for more information.
78
* This should be called before every evaluation. */
79
void
reset
();
80
81
/* Specifies that the cache manager should skip the next reset. This is useful for instance when
82
* the evaluation gets canceled before it was fully done, in that case, we wouldn't want to
83
* invalidate the cache because not all operations that use cached resources got the chance to
84
* mark their used resources as still in use. So we wait until a full evaluation happen before we
85
* decide that some resources are no longer needed. */
86
void
skip_next_reset
();
87
};
88
89
}
// namespace blender::compositor
COM_bokeh_kernel.hh
COM_cached_image.hh
COM_cached_mask.hh
COM_cached_shader.hh
COM_cached_texture.hh
COM_deriche_gaussian_coefficients.hh
COM_distortion_grid.hh
COM_fog_glow_kernel.hh
COM_image_coordinates.hh
COM_keying_screen.hh
COM_morphological_distance_feather_weights.hh
COM_ocio_color_space_conversion_shader.hh
COM_smaa_precomputed_textures.hh
COM_symmetric_blur_weights.hh
COM_symmetric_separable_blur_weights.hh
COM_van_vliet_gaussian_coefficients.hh
blender::compositor::BokehKernelContainer
Definition
COM_bokeh_kernel.hh:77
blender::compositor::CachedImageContainer
Definition
COM_cached_image.hh:68
blender::compositor::CachedMaskContainer
Definition
COM_cached_mask.hh:72
blender::compositor::CachedShaderContainer
Definition
COM_cached_shader.hh:56
blender::compositor::CachedTextureContainer
Definition
COM_cached_texture.hh:66
blender::compositor::DericheGaussianCoefficientsContainer
Definition
COM_deriche_gaussian_coefficients.hh:73
blender::compositor::DistortionGridContainer
Definition
COM_distortion_grid.hh:75
blender::compositor::FogGlowKernelContainer
Definition
COM_fog_glow_kernel.hh:61
blender::compositor::ImageCoordinatesContainer
Definition
COM_image_coordinates.hh:63
blender::compositor::KeyingScreenContainer
Definition
COM_keying_screen.hh:69
blender::compositor::MorphologicalDistanceFeatherWeightsContainer
Definition
COM_morphological_distance_feather_weights.hh:66
blender::compositor::OCIOColorSpaceConversionShaderContainer
Definition
COM_ocio_color_space_conversion_shader.hh:65
blender::compositor::SMAAPrecomputedTexturesContainer
Definition
COM_smaa_precomputed_textures.hh:58
blender::compositor::StaticCacheManager
Definition
COM_static_cache_manager.hh:50
blender::compositor::StaticCacheManager::smaa_precomputed_textures
SMAAPrecomputedTexturesContainer smaa_precomputed_textures
Definition
COM_static_cache_manager.hh:57
blender::compositor::StaticCacheManager::ocio_color_space_conversion_shaders
OCIOColorSpaceConversionShaderContainer ocio_color_space_conversion_shaders
Definition
COM_static_cache_manager.hh:58
blender::compositor::StaticCacheManager::cached_shaders
CachedShaderContainer cached_shaders
Definition
COM_static_cache_manager.hh:61
blender::compositor::StaticCacheManager::morphological_distance_feather_weights
MorphologicalDistanceFeatherWeightsContainer morphological_distance_feather_weights
Definition
COM_static_cache_manager.hh:54
blender::compositor::StaticCacheManager::cached_images
CachedImageContainer cached_images
Definition
COM_static_cache_manager.hh:63
blender::compositor::StaticCacheManager::keying_screens
KeyingScreenContainer keying_screens
Definition
COM_static_cache_manager.hh:60
blender::compositor::StaticCacheManager::fog_glow_kernels
FogGlowKernelContainer fog_glow_kernels
Definition
COM_static_cache_manager.hh:66
blender::compositor::StaticCacheManager::symmetric_separable_blur_weights
SymmetricSeparableBlurWeightsContainer symmetric_separable_blur_weights
Definition
COM_static_cache_manager.hh:53
blender::compositor::StaticCacheManager::van_vliet_gaussian_coefficients
VanVlietGaussianCoefficientsContainer van_vliet_gaussian_coefficients
Definition
COM_static_cache_manager.hh:65
blender::compositor::StaticCacheManager::distortion_grids
DistortionGridContainer distortion_grids
Definition
COM_static_cache_manager.hh:59
blender::compositor::StaticCacheManager::skip_next_reset
void skip_next_reset()
Definition
static_cache_manager.cc:34
blender::compositor::StaticCacheManager::symmetric_blur_weights
SymmetricBlurWeightsContainer symmetric_blur_weights
Definition
COM_static_cache_manager.hh:52
blender::compositor::StaticCacheManager::bokeh_kernels
BokehKernelContainer bokeh_kernels
Definition
COM_static_cache_manager.hh:62
blender::compositor::StaticCacheManager::cached_textures
CachedTextureContainer cached_textures
Definition
COM_static_cache_manager.hh:55
blender::compositor::StaticCacheManager::deriche_gaussian_coefficients
DericheGaussianCoefficientsContainer deriche_gaussian_coefficients
Definition
COM_static_cache_manager.hh:64
blender::compositor::StaticCacheManager::reset
void reset()
Definition
static_cache_manager.cc:9
blender::compositor::StaticCacheManager::image_coordinates
ImageCoordinatesContainer image_coordinates
Definition
COM_static_cache_manager.hh:67
blender::compositor::StaticCacheManager::cached_masks
CachedMaskContainer cached_masks
Definition
COM_static_cache_manager.hh:56
blender::compositor::SymmetricBlurWeightsContainer
Definition
COM_symmetric_blur_weights.hh:58
blender::compositor::SymmetricSeparableBlurWeightsContainer
Definition
COM_symmetric_separable_blur_weights.hh:66
blender::compositor::VanVlietGaussianCoefficientsContainer
Definition
COM_van_vliet_gaussian_coefficients.hh:92
blender::compositor
Definition
BKE_node.hh:76
Generated on
for Blender by
doxygen
1.15.0