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