Blender V4.3
COM_symmetric_separable_blur_weights.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 <cstdint>
8#include <memory>
9
10#include "BLI_map.hh"
12
13#include "GPU_shader.hh"
14#include "GPU_texture.hh"
15
17
19
20class Context;
21
22/* -------------------------------------------------------------------- */
27 public:
28 int type;
29 float radius;
30
31 SymmetricSeparableBlurWeightsKey(int type, float radius);
32
33 uint64_t hash() const;
34};
35
38
41/* -------------------------------------------------------------------- */
51 private:
52 GPUTexture *texture_ = nullptr;
53
54 public:
55 SymmetricSeparableBlurWeights(Context &context, int type, float radius);
56
58
59 void bind_as_texture(GPUShader *shader, const char *texture_name) const;
60
61 void unbind_as_texture() const;
62};
63
66/* -------------------------------------------------------------------- */
71 private:
73
74 public:
75 void reset() override;
76
77 /* Check if there is an available SymmetricSeparableBlurWeights cached resource with the given
78 * parameters in the container, if one exists, return it, otherwise, return a newly created one
79 * and add it to the container. In both cases, tag the cached resource as needed to keep it
80 * cached for the next evaluation. */
81 SymmetricSeparableBlurWeights &get(Context &context, int type, float radius);
82};
83
86} // namespace blender::realtime_compositor
struct GPUShader GPUShader
SymmetricSeparableBlurWeights & get(Context &context, int type, float radius)
void bind_as_texture(GPUShader *shader, const char *texture_name) const
local_group_size(16, 16) .push_constant(Type b
bool operator==(const BokehKernelKey &a, const BokehKernelKey &b)
unsigned __int64 uint64_t
Definition stdint.h:90