Blender V5.3
compositor/intern/context.cc
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#include "DNA_node_types.h"
6
7#include "GPU_shader.hh"
8
9#include "COM_context.hh"
10#include "COM_render_context.hh"
12
13namespace blender::compositor {
14
18
19Result Context::get_pass(const Scene * /*scene*/, int /*view_layer*/, const char * /*name*/)
20{
22 invalid_pass.allocate_invalid();
23 return invalid_pass;
24}
25
27{
28 return this->get_scene().r;
29}
30
32{
33 return "";
34}
35
40
42 int /*view_layer_id*/,
43 const char * /*pass_name*/,
44 MetaData & /*meta_data*/) const
45{
46}
47
49{
50 return nullptr;
51}
52
54{
55 return false;
56}
57
62
64
66{
67 return false;
68}
69
71{
72 return get_render_data().size / 100.0f;
73}
74
76{
77 return get_render_data().cfra;
78}
79
80float Context::get_time() const
81{
82 const float frame_number = float(get_frame_number());
83 const float frame_rate = float(get_render_data().frs_sec) /
84 float(get_render_data().frs_sec_base);
85 return frame_number / frame_rate;
86}
87
98
99gpu::Shader *Context::get_shader(const char *info_name, ResultPrecision precision)
100{
101 return cache_manager().cached_shaders.get(info_name, precision);
102}
103
104gpu::Shader *Context::get_shader(const char *info_name)
105{
106 return get_shader(info_name, get_precision());
107}
108
110{
111 return Result(*this, type, precision);
112}
113
118
120{
121 return cache_manager_;
122}
123
125{
126 return compute_context_cache_;
127}
128
130{
131 return nullptr;
132}
133
134} // namespace blender::compositor
gpu::Shader * get(const char *info_name, ResultPrecision precision)
virtual const Scene & get_scene() const =0
Result create_result(ResultType type, ResultPrecision precision)
eCompositorDenoiseQaulity get_denoise_quality() const
virtual void populate_meta_data_for_pass(const Scene *scene, int view_layer_id, const char *pass_name, MetaData &meta_data) const
virtual StringRef get_view_name() const
bke::ComputeContextCache & compute_context_cache() const
virtual Result get_pass(const Scene *scene, int view_layer, const char *name)
virtual const RenderData & get_render_data() const
gpu::Shader * get_shader(const char *info_name, ResultPrecision precision)
virtual ResultPrecision get_precision() const
virtual RenderContext * render_context() const
virtual nodes::eval_log::NodesEvalLog * nodes_evaluation_log() const
virtual const Strip * get_strip() const
Result(Context &context)
Definition result.cc:39
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
eCompositorDenoiseQaulity compositor_denoise_preview_quality
eCompositorDenoiseQaulity compositor_denoise_final_quality
struct RenderData r