Blender
V4.3
source
blender
compositor
realtime_compositor
cached_resources
COM_smaa_precomputed_textures.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 <memory>
8
9
#include "
GPU_shader.hh
"
10
#include "
GPU_texture.hh
"
11
12
#include "
COM_cached_resource.hh
"
13
14
namespace
blender::realtime_compositor
{
15
16
/* -------------------------------------------------------------------------------------------------
17
* SMAA Precomputed Textures.
18
*
19
* A cached resource that caches the precomputed textures needed by the SMAA algorithm. The
20
* precomputed textures are constants, so this is a parameterless cached resource. */
21
class
SMAAPrecomputedTextures
:
public
CachedResource
{
22
private
:
23
GPUTexture *search_texture_ =
nullptr
;
24
GPUTexture *area_texture_ =
nullptr
;
25
26
public
:
27
SMAAPrecomputedTextures
();
28
29
~SMAAPrecomputedTextures
();
30
31
void
bind_search_texture
(
GPUShader
*shader,
const
char
*sampler_name)
const
;
32
33
void
unbind_search_texture
()
const
;
34
35
void
bind_area_texture
(
GPUShader
*shader,
const
char
*sampler_name)
const
;
36
37
void
unbind_area_texture
()
const
;
38
};
39
40
/* ------------------------------------------------------------------------------------------------
41
* SMAA Precomputed Textures Container.
42
*/
43
class
SMAAPrecomputedTexturesContainer
:
public
CachedResourceContainer
{
44
private
:
45
std::unique_ptr<SMAAPrecomputedTextures> textures_;
46
47
public
:
48
void
reset
()
override
;
49
50
/* Check if a cached SMAA precomputed texture exists, if it does, return it, otherwise, return
51
* a newly created one and store it in the container. In both cases, tag the cached resource as
52
* needed to keep it cached for the next evaluation. */
53
SMAAPrecomputedTextures
&
get
();
54
};
55
56
}
// namespace blender::realtime_compositor
COM_cached_resource.hh
GPU_shader.hh
GPU_texture.hh
GPUShader
struct GPUShader GPUShader
Definition
blender/display_driver.h:21
blender::realtime_compositor::CachedResourceContainer
Definition
COM_cached_resource.hh:43
blender::realtime_compositor::CachedResource
Definition
COM_cached_resource.hh:26
blender::realtime_compositor::SMAAPrecomputedTexturesContainer
Definition
COM_smaa_precomputed_textures.hh:43
blender::realtime_compositor::SMAAPrecomputedTexturesContainer::reset
void reset() override
Definition
smaa_precomputed_textures.cc:76
blender::realtime_compositor::SMAAPrecomputedTexturesContainer::get
SMAAPrecomputedTextures & get()
Definition
smaa_precomputed_textures.cc:90
blender::realtime_compositor::SMAAPrecomputedTextures
Definition
COM_smaa_precomputed_textures.hh:21
blender::realtime_compositor::SMAAPrecomputedTextures::~SMAAPrecomputedTextures
~SMAAPrecomputedTextures()
Definition
smaa_precomputed_textures.cc:43
blender::realtime_compositor::SMAAPrecomputedTextures::bind_search_texture
void bind_search_texture(GPUShader *shader, const char *sampler_name) const
Definition
smaa_precomputed_textures.cc:49
blender::realtime_compositor::SMAAPrecomputedTextures::bind_area_texture
void bind_area_texture(GPUShader *shader, const char *sampler_name) const
Definition
smaa_precomputed_textures.cc:61
blender::realtime_compositor::SMAAPrecomputedTextures::unbind_search_texture
void unbind_search_texture() const
Definition
smaa_precomputed_textures.cc:56
blender::realtime_compositor::SMAAPrecomputedTextures::unbind_area_texture
void unbind_area_texture() const
Definition
smaa_precomputed_textures.cc:67
blender::realtime_compositor::SMAAPrecomputedTextures::SMAAPrecomputedTextures
SMAAPrecomputedTextures()
Definition
smaa_precomputed_textures.cc:20
blender::realtime_compositor
Definition
BKE_node.hh:80
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0