Blender V5.0
render/intern/compositor.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 <cstring>
6#include <string>
7
8#include "BLI_listbase.h"
10#include "BLI_threads.h"
11#include "BLI_vector.hh"
12
13#include "MEM_guardedalloc.h"
14
15#include "BKE_cryptomatte.hh"
16#include "BKE_global.hh"
17#include "BKE_image.hh"
18#include "BKE_node.hh"
19#include "BKE_scene.hh"
20
21#include "DRW_engine.hh"
22#include "DRW_render.hh"
23
24#include "IMB_imbuf.hh"
25
26#include "COM_context.hh"
27#include "COM_domain.hh"
28#include "COM_evaluator.hh"
29#include "COM_render_context.hh"
30
31#include "RE_compositor.hh"
32#include "RE_pipeline.h"
33
34#include "WM_api.hh"
35
36#include "GPU_context.hh"
37#include "GPU_state.hh"
38#include "GPU_texture_pool.hh"
39
40#include "render_types.h"
41
42namespace blender::render {
43
77
78/* Render Context Data */
79
81 private:
82 /* Input data. */
83 ContextInputData input_data_;
84
85 /* Output combined result. */
86 compositor::Result output_result_;
87
88 /* Viewer output result. */
89 compositor::Result viewer_output_result_;
90
91 /* Cached GPU and CPU passes that the compositor took ownership of. Those had their reference
92 * count incremented when accessed and need to be freed/have their reference count decremented
93 * when destroying the context. */
94 Vector<blender::gpu::Texture *> cached_gpu_passes_;
95 Vector<ImBuf *> cached_cpu_passes_;
96
97 public:
98 Context(const ContextInputData &input_data)
100 input_data_(input_data),
101 output_result_(this->create_result(compositor::ResultType::Color)),
102 viewer_output_result_(this->create_result(compositor::ResultType::Color))
103 {
104 }
105
106 virtual ~Context()
107 {
108 output_result_.release();
109 viewer_output_result_.release();
110 for (blender::gpu::Texture *pass : cached_gpu_passes_) {
111 GPU_texture_free(pass);
112 }
113 for (ImBuf *pass : cached_cpu_passes_) {
114 IMB_freeImBuf(pass);
115 }
116 }
117
118 void update_input_data(const ContextInputData &input_data)
119 {
120 input_data_ = input_data;
121 }
122
123 const Scene &get_scene() const override
124 {
125 return *input_data_.scene;
126 }
127
128 const bNodeTree &get_node_tree() const override
129 {
130 return *input_data_.node_tree;
131 }
132
133 bool use_gpu() const override
134 {
136 }
137
139 {
140 return input_data_.needed_outputs;
141 }
142
143 const RenderData &get_render_data() const override
144 {
145 return *(input_data_.render_data);
146 }
147
149 {
150 Render *render = RE_GetSceneRender(input_data_.scene);
151 RenderResult *render_result = RE_AcquireResultRead(render);
152
153 /* If a render result already exist, use its size, since the compositor operates on the render
154 * settings at which the render happened. Otherwise, use the size from the render data. */
155 int2 size;
156 if (render_result) {
157 size = int2(render_result->rectx, render_result->recty);
158 }
159 else {
160 BKE_render_resolution(input_data_.render_data, true, &size.x, &size.y);
161 }
162
164
165 return size;
166 }
167
169 {
170 return Bounds<int2>(int2(0), this->get_render_size());
171 }
172
174 {
175 const int2 render_size = get_render_size();
176 if (output_result_.is_allocated()) {
177 /* If the allocated result have the same size as the render size, return it as is. */
178 if (render_size == output_result_.domain().size) {
179 return output_result_;
180 }
181 /* Otherwise, the size changed, so release its data and reset it, then we reallocate it on
182 * the new render size below. */
183 output_result_.release();
184 output_result_ = this->create_result(compositor::ResultType::Color);
185 }
186
187 output_result_.allocate_texture(render_size, false);
188 return output_result_;
189 }
190
192 const bool is_data,
193 compositor::ResultPrecision precision) override
194 {
195 viewer_output_result_.set_transformation(domain.transformation);
196 viewer_output_result_.meta_data.is_non_color_data = is_data;
197
198 if (viewer_output_result_.is_allocated()) {
199 /* If the allocated result have the same size and precision as requested, return it as is. */
200 if (domain.size == viewer_output_result_.domain().size &&
201 precision == viewer_output_result_.precision())
202 {
203 return viewer_output_result_;
204 }
205
206 /* Otherwise, the size or precision changed, so release its data and reset it, then we
207 * reallocate it on the new domain below. */
208 viewer_output_result_.release();
209 viewer_output_result_ = this->create_result(compositor::ResultType::Color);
210 viewer_output_result_.set_transformation(domain.transformation);
211 viewer_output_result_.meta_data.is_non_color_data = is_data;
212 }
213
214 viewer_output_result_.set_precision(precision);
215 viewer_output_result_.allocate_texture(domain, false);
216 return viewer_output_result_;
217 }
218
219 compositor::Result get_pass(const Scene *scene, int view_layer_id, const char *name) override
220 {
221 /* Blender aliases the Image pass name to be the Combined pass, so we return the combined pass
222 * in that case. */
223 const char *pass_name = StringRef(name) == "Image" ? "Combined" : name;
224
225 if (!scene) {
226 return compositor::Result(*this);
227 }
228
229 ViewLayer *view_layer = static_cast<ViewLayer *>(
230 BLI_findlink(&scene->view_layers, view_layer_id));
231 if (!view_layer) {
232 return compositor::Result(*this);
233 }
234
236 if (!render) {
237 return compositor::Result(*this);
238 }
239
240 RenderResult *render_result = RE_AcquireResultRead(render);
241 if (!render_result) {
243 return compositor::Result(*this);
244 }
245
246 RenderLayer *render_layer = RE_GetRenderLayer(render_result, view_layer->name);
247 if (!render_layer) {
249 return compositor::Result(*this);
250 }
251
252 RenderPass *render_pass = RE_pass_find_by_name(
253 render_layer, pass_name, this->get_view_name().data());
254 if (!render_pass) {
256 return compositor::Result(*this);
257 }
258
259 if (!render_pass || !render_pass->ibuf || !render_pass->ibuf->float_buffer.data) {
261 return compositor::Result(*this);
262 }
263
266
267 if (this->use_gpu()) {
269 /* Don't assume render will keep pass data stored, add our own reference. */
270 GPU_texture_ref(pass_texture);
271 pass.wrap_external(pass_texture);
272 cached_gpu_passes_.append(pass_texture);
273 }
274 else {
275 /* Don't assume render will keep pass data stored, add our own reference. */
276 IMB_refImBuf(render_pass->ibuf);
277 pass.wrap_external(render_pass->ibuf->float_buffer.data,
278 int2(render_pass->ibuf->x, render_pass->ibuf->y));
279 cached_cpu_passes_.append(render_pass->ibuf);
280 }
281
283 return pass;
284 }
285
287 {
288 if (name == "Image") {
289 return this->get_pass(&this->get_scene(), 0, name.data());
290 }
291
293 }
294
296 {
297 switch (pass->channels) {
298 case 1:
300 case 2:
302 case 3:
304 case 4:
305 if (StringRef(pass->chan_id) == "XYZW") {
307 }
308 else {
310 }
311 default:
312 break;
313 }
314
317 }
318
319 StringRef get_view_name() const override
320 {
321 return input_data_.view_name;
322 }
323
325 {
326 switch (input_data_.scene->r.compositor_precision) {
328 /* Auto uses full precision for final renders and half procession otherwise. */
329 if (this->render_context()) {
331 }
332 else {
334 }
337 }
338
341 }
342
344 int view_layer_id,
345 const char *pass_name,
346 compositor::MetaData &meta_data) const override
347 {
348 if (!scene) {
349 return;
350 }
351
352 ViewLayer *view_layer = static_cast<ViewLayer *>(
353 BLI_findlink(&scene->view_layers, view_layer_id));
354 if (!view_layer) {
355 return;
356 }
357
359 if (!render) {
360 return;
361 }
362
363 RenderResult *render_result = RE_AcquireResultRead(render);
364 if (!render_result || !render_result->stamp_data) {
366 return;
367 }
368
369 /* We assume the given pass is a Cryptomatte pass and retrieve its layer name. If it wasn't a
370 * Cryptomatte pass, the checks below will fail anyways. */
371 const std::string combined_pass_name = std::string(view_layer->name) + "." + pass_name;
373 combined_pass_name);
374
375 struct StampCallbackData {
376 std::string cryptomatte_layer_name;
377 compositor::MetaData *meta_data;
378 };
379
380 /* Go over the stamp data and add any Cryptomatte related meta data. */
381 StampCallbackData callback_data = {cryptomatte_layer_name, &meta_data};
383 &callback_data,
384 render_result->stamp_data,
385 [](void *user_data, const char *key, char *value, int /*value_maxncpy*/) {
386 StampCallbackData *data = static_cast<StampCallbackData *>(user_data);
387
388 const std::string manifest_key = bke::cryptomatte::BKE_cryptomatte_meta_data_key(
389 data->cryptomatte_layer_name, "manifest");
390 if (key == manifest_key) {
391 data->meta_data->cryptomatte.manifest = value;
392 }
393
395 data->cryptomatte_layer_name, "hash");
396 if (key == hash_key) {
397 data->meta_data->cryptomatte.hash = value;
398 }
399
400 const std::string conversion_key = bke::cryptomatte::BKE_cryptomatte_meta_data_key(
401 data->cryptomatte_layer_name, "conversion");
402 if (key == conversion_key) {
403 data->meta_data->cryptomatte.conversion = value;
404 }
405 },
406 false);
407
409 }
410
412 {
413 if (!output_result_.is_allocated()) {
414 return;
415 }
416
417 Render *re = RE_GetSceneRender(input_data_.scene);
419
420 if (rr) {
421 RenderView *rv = RE_RenderViewGetByName(rr, input_data_.view_name.c_str());
422 ImBuf *ibuf = RE_RenderViewEnsureImBuf(rr, rv);
423 rr->have_combined = true;
424
425 if (this->use_gpu()) {
427 float *output_buffer = static_cast<float *>(
428 GPU_texture_read(output_result_, GPU_DATA_FLOAT, 0));
429 IMB_assign_float_buffer(ibuf, output_buffer, IB_TAKE_OWNERSHIP);
430 }
431 else {
432 float *data = MEM_malloc_arrayN<float>(4 * size_t(rr->rectx) * size_t(rr->recty),
433 __func__);
435 std::memcpy(
436 data, output_result_.cpu_data().data(), rr->rectx * rr->recty * 4 * sizeof(float));
437 }
438 }
439
440 if (re) {
442 re = nullptr;
443 }
444
445 Image *image = BKE_image_ensure_viewer(G.main, IMA_TYPE_R_RESULT, "Render Result");
448 BKE_image_signal(G.main, image, nullptr, IMA_SIGNAL_FREE);
450 }
451
453 {
454 if (!viewer_output_result_.is_allocated()) {
455 return;
456 }
457
458 Image *image = BKE_image_ensure_viewer(G.main, IMA_TYPE_COMPOSITE, "Viewer Node");
459 const float2 translation = viewer_output_result_.domain().transformation.location();
460 image->runtime->backdrop_offset[0] = translation.x;
461 image->runtime->backdrop_offset[1] = translation.y;
462
463 if (viewer_output_result_.meta_data.is_non_color_data) {
464 image->flag &= ~IMA_VIEW_AS_RENDER;
465 }
466 else {
467 image->flag |= IMA_VIEW_AS_RENDER;
468 }
469
470 ImageUser image_user = {nullptr};
471 image_user.multi_index = BKE_scene_multiview_view_id_get(input_data_.render_data,
472 input_data_.view_name.c_str());
473
474 if (BKE_scene_multiview_is_render_view_first(input_data_.render_data,
475 input_data_.view_name.c_str()))
476 {
477 BKE_image_ensure_viewer_views(input_data_.render_data, image, &image_user);
478 }
479
481
482 void *lock;
483 ImBuf *image_buffer = BKE_image_acquire_ibuf(image, &image_user, &lock);
484
485 const int2 size = viewer_output_result_.domain().size;
486 if (image_buffer->x != size.x || image_buffer->y != size.y) {
487 IMB_free_byte_pixels(image_buffer);
488 IMB_free_float_pixels(image_buffer);
489 image_buffer->x = size.x;
490 image_buffer->y = size.y;
491 IMB_alloc_float_pixels(image_buffer, 4);
492 image_buffer->userflags |= IB_DISPLAY_BUFFER_INVALID;
493 }
494
495 BKE_image_release_ibuf(image, image_buffer, lock);
497
498 if (this->use_gpu()) {
500 float *output_buffer = static_cast<float *>(
501 GPU_texture_read(viewer_output_result_, GPU_DATA_FLOAT, 0));
502
503 std::memcpy(
504 image_buffer->float_buffer.data, output_buffer, size.x * size.y * 4 * sizeof(float));
505 MEM_freeN(output_buffer);
506 }
507 else {
508 std::memcpy(image_buffer->float_buffer.data,
509 viewer_output_result_.cpu_data().data(),
510 size.x * size.y * 4 * sizeof(float));
511 }
512
514 if (input_data_.node_tree->runtime->update_draw) {
515 input_data_.node_tree->runtime->update_draw(input_data_.node_tree->runtime->udh);
516 }
517 }
518
520 {
521 return input_data_.render_context;
522 }
523
525 {
526 return input_data_.profiler;
527 }
528
529 void evaluate_operation_post() const override
530 {
531 /* If no render context exist, that means this is an interactive compositor evaluation due to
532 * the user editing the node tree. In that case, we wait until the operation finishes executing
533 * on the GPU before we continue to improve interactivity. The improvement comes from the fact
534 * that the user might be rapidly changing values, so we need to cancel previous evaluations to
535 * make editing faster, but we can't do that if all operations are submitted to the GPU all at
536 * once, and we can't cancel work that was already submitted to the GPU. This does have a
537 * performance penalty, but in practice, the improved interactivity is worth it according to
538 * user feedback. */
539 if (this->use_gpu() && !this->render_context()) {
540 GPU_finish();
541 }
542 }
543};
544
545/* Render Compositor */
546
548 private:
549 /* Render instance for GPU context to run compositor in. */
550 Render &render_;
551
552 std::unique_ptr<Context> context_;
553
554 /* Stores the execution device and precision used in the last evaluation of the compositor. Those
555 * might be different from the current values returned by the context, since the user might have
556 * changed them since the last evaluation. See the needs_to_be_recreated method for more info on
557 * why those are needed. */
558 bool uses_gpu_;
559 compositor::ResultPrecision used_precision_;
560
561 public:
562 Compositor(Render &render, const ContextInputData &input_data) : render_(render)
563 {
564 context_ = std::make_unique<Context>(input_data);
565
566 uses_gpu_ = context_->use_gpu();
567 used_precision_ = context_->get_precision();
568 }
569
571 {
572 /* Use uses_gpu_ instead of context_->use_gpu() because we are freeing resources from the last
573 * evaluation. See uses_gpu_ for more information. */
574 if (uses_gpu_) {
575 /* Free resources with GPU context enabled. Cleanup may happen from the
576 * main thread, and we must use the main context there. */
577 if (BLI_thread_is_main()) {
579 }
580 else {
582 }
583 }
584
585 context_.reset();
586
587 /* See comment above on context enabling. */
588 if (uses_gpu_) {
589 if (BLI_thread_is_main()) {
591 }
592 else {
594 }
595 }
596 }
597
598 void update_input_data(const ContextInputData &input_data)
599 {
600 context_->update_input_data(input_data);
601 }
602
603 void execute()
604 {
605 if (context_->use_gpu()) {
606 /* For main thread rendering in background mode, blocking rendering, or when we do not have a
607 * render system GPU context, use the DRW context directly, while for threaded rendering when
608 * we have a render system GPU context, use the render's system GPU context to avoid blocking
609 * with the global DST. */
610 void *re_system_gpu_context = RE_system_gpu_context_get(&render_);
611 if (BLI_thread_is_main() || re_system_gpu_context == nullptr) {
613 }
614 else {
615 void *re_system_gpu_context = RE_system_gpu_context_get(&render_);
616 WM_system_gpu_context_activate(re_system_gpu_context);
617
618 void *re_blender_gpu_context = RE_blender_gpu_context_ensure(&render_);
619
621 GPU_context_active_set(static_cast<GPUContext *>(re_blender_gpu_context));
622 }
623 }
624
625 {
626 compositor::Evaluator evaluator(*context_);
627 evaluator.evaluate();
628 }
629
630 context_->output_to_render_result();
631 context_->viewer_output_to_viewer_image();
632
633 if (context_->use_gpu()) {
635
636 void *re_system_gpu_context = RE_system_gpu_context_get(&render_);
637 if (BLI_thread_is_main() || re_system_gpu_context == nullptr) {
639 }
640 else {
642 GPU_context_active_set(nullptr);
643 void *re_system_gpu_context = RE_system_gpu_context_get(&render_);
644 WM_system_gpu_context_release(re_system_gpu_context);
645 }
646 }
647 }
648
649 /* Returns true if the compositor should be freed and reconstructed, which is needed when the
650 * compositor execution device or precision changed, because we either need to update all cached
651 * and pooled resources for the new execution device and precision, or we simply recreate the
652 * entire compositor, since it is much easier and safer. */
654 {
655 /* See uses_gpu_ and used_precision_ for more information what how they are different from the
656 * ones returned from the context. */
657 return context_->use_gpu() != uses_gpu_ || context_->get_precision() != used_precision_;
658 }
659};
660
661} // namespace blender::render
662
664 const RenderData &render_data,
665 const bNodeTree &node_tree,
666 const char *view_name,
670{
671 std::unique_lock lock(this->compositor_mutex);
672
674 scene, render_data, node_tree, view_name, render_context, profiler, needed_outputs);
675
676 if (this->compositor) {
677 this->compositor->update_input_data(input_data);
678
679 if (this->compositor->needs_to_be_recreated()) {
680 /* Free it here and it will be recreated in the check below. */
681 delete this->compositor;
682 this->compositor = nullptr;
683 }
684 }
685
686 if (!this->compositor) {
687 this->compositor = new blender::render::Compositor(*this, input_data);
688 }
689
690 this->compositor->execute();
691}
692
694{
695 std::unique_lock lock(this->compositor_mutex);
696
697 if (this->compositor != nullptr) {
698 delete this->compositor;
699 this->compositor = nullptr;
700 }
701}
702
704 const Scene &scene,
705 const RenderData &render_data,
706 const bNodeTree &node_tree,
707 const char *view_name,
711{
712 render.compositor_execute(
713 scene, render_data, node_tree, view_name, render_context, profiler, needed_outputs);
714}
715
717{
718 render.compositor_free();
719}
ImBuf * BKE_image_acquire_ibuf(Image *ima, ImageUser *iuser, void **r_lock)
void BKE_image_ensure_viewer_views(const RenderData *rd, Image *ima, ImageUser *iuser)
Image * BKE_image_ensure_viewer(Main *bmain, int type, const char *name)
void BKE_image_release_ibuf(Image *ima, ImBuf *ibuf, void *lock)
#define IMA_SIGNAL_FREE
Definition BKE_image.hh:169
void BKE_stamp_info_callback(void *data, StampData *stamp_data, StampCallback callback, bool noskip)
void BKE_image_signal(Main *bmain, Image *ima, ImageUser *iuser, int signal)
void BKE_image_partial_update_mark_full_update(Image *image)
Mark the whole image to be updated.
void BKE_render_resolution(const RenderData *r, const bool use_crop, int *r_width, int *r_height)
Definition scene.cc:2915
bool BKE_scene_multiview_is_render_view_first(const RenderData *rd, const char *viewname)
Definition scene.cc:3014
int BKE_scene_multiview_view_id_get(const RenderData *rd, const char *viewname)
Definition scene.cc:3082
#define BLI_assert_unreachable()
Definition BLI_assert.h:93
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:534
void BLI_thread_unlock(int type)
Definition threads.cc:333
void BLI_thread_lock(int type)
Definition threads.cc:328
int BLI_thread_is_main(void)
Definition threads.cc:179
@ LOCK_DRAW_IMAGE
Definition BLI_threads.h:64
@ IMA_VIEW_AS_RENDER
@ IMA_TYPE_R_RESULT
@ IMA_TYPE_COMPOSITE
@ SCE_COMPOSITOR_PRECISION_FULL
@ SCE_COMPOSITOR_PRECISION_AUTO
@ SCE_COMPOSITOR_DEVICE_GPU
void DRW_gpu_context_disable()
void DRW_gpu_context_enable()
void DRW_render_context_disable(Render *render)
void DRW_render_context_enable(Render *render)
void GPU_render_end()
void GPU_render_begin()
void GPU_context_active_set(GPUContext *)
@ GPU_BARRIER_TEXTURE_UPDATE
Definition GPU_state.hh:39
void GPU_finish()
Definition gpu_state.cc:310
void GPU_memory_barrier(GPUBarrier barrier)
Definition gpu_state.cc:326
@ GPU_DATA_FLOAT
void GPU_texture_ref(blender::gpu::Texture *texture)
void * GPU_texture_read(blender::gpu::Texture *texture, eGPUDataFormat data_format, int mip_level)
void GPU_texture_free(blender::gpu::Texture *texture)
void IMB_assign_float_buffer(ImBuf *ibuf, float *buffer_data, ImBufOwnership ownership)
void IMB_freeImBuf(ImBuf *ibuf)
void IMB_free_float_pixels(ImBuf *ibuf)
void IMB_refImBuf(ImBuf *ibuf)
void IMB_free_byte_pixels(ImBuf *ibuf)
bool IMB_alloc_float_pixels(ImBuf *ibuf, const unsigned int channels, bool initialize_pixels=true)
@ IB_DISPLAY_BUFFER_INVALID
@ IB_TAKE_OWNERSHIP
Read Guarded memory(de)allocation.
uint32_t hash_key
volatile int lock
BMesh const char void * data
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
constexpr const char * data() const
Result create_result(ResultType type, ResultPrecision precision)
void wrap_external(blender::gpu::Texture *texture)
Definition result.cc:584
void set_transformation(const float3x3 &transformation)
Definition result.cc:620
void reset(bool force_free=false)
static TexturePool & get()
Compositor(Render &render, const ContextInputData &input_data)
void update_input_data(const ContextInputData &input_data)
compositor::RenderContext * render_context
ContextInputData(const Scene &scene, const RenderData &render_data, const bNodeTree &node_tree, const char *view_name, compositor::RenderContext *render_context, compositor::Profiler *profiler, compositor::OutputTypes needed_outputs)
const Scene & get_scene() const override
StringRef get_view_name() const override
compositor::RenderContext * render_context() const override
void populate_meta_data_for_pass(const Scene *scene, int view_layer_id, const char *pass_name, compositor::MetaData &meta_data) const override
compositor::Result get_pass(const Scene *scene, int view_layer_id, const char *name) override
compositor::ResultPrecision get_precision() const override
void evaluate_operation_post() const override
compositor::ResultType result_type_from_pass(const RenderPass *pass)
compositor::OutputTypes needed_outputs() const override
Context(const ContextInputData &input_data)
compositor::Profiler * profiler() const override
compositor::Result get_output(compositor::Domain) override
compositor::Result get_viewer_output(compositor::Domain domain, const bool is_data, compositor::ResultPrecision precision) override
void update_input_data(const ContextInputData &input_data)
Bounds< int2 > get_compositing_region() const override
const RenderData & get_render_data() const override
compositor::Result get_input(StringRef name) override
const bNodeTree & get_node_tree() const override
void * MEM_malloc_arrayN(size_t len, size_t size, const char *str)
Definition mallocn.cc:133
void MEM_freeN(void *vmemh)
Definition mallocn.cc:113
#define G(x, y, z)
StringRef BKE_cryptomatte_extract_layer_name(StringRef render_pass_name)
std::string BKE_cryptomatte_meta_data_key(StringRef layer_name, StringRefNull key_name)
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
const char * name
void RE_compositor_free(Render &render)
void RE_compositor_execute(Render &render, const Scene &scene, const RenderData &render_data, const bNodeTree &node_tree, const char *view_name, blender::compositor::RenderContext *render_context, blender::compositor::Profiler *profiler, blender::compositor::OutputTypes needed_outputs)
RenderView * RE_RenderViewGetByName(RenderResult *rr, const char *viewname)
ImBuf * RE_RenderViewEnsureImBuf(const RenderResult *render_result, RenderView *render_view)
blender::gpu::Texture * RE_pass_ensure_gpu_texture_cache(Render *re, RenderPass *rpass)
void * RE_blender_gpu_context_ensure(Render *re)
void * RE_system_gpu_context_get(Render *re)
RenderPass * RE_pass_find_by_name(RenderLayer *rl, const char *name, const char *viewname)
RenderResult * RE_AcquireResultWrite(Render *re)
RenderResult * RE_AcquireResultRead(Render *re)
RenderLayer * RE_GetRenderLayer(RenderResult *rr, const char *name)
void RE_ReleaseResult(Render *re)
Render * RE_GetSceneRender(const Scene *scene)
ImBufFloatBuffer float_buffer
short multi_index
ImageRuntimeHandle * runtime
char chan_id[24]
Definition RE_pipeline.h:56
struct ImBuf * ibuf
Definition RE_pipeline.h:67
struct StampData * stamp_data
void compositor_free() override
blender::render::Compositor * compositor
Scene * scene
blender::Mutex compositor_mutex
void compositor_execute(const Scene &scene, const RenderData &render_data, const bNodeTree &node_tree, const char *view_name, blender::compositor::RenderContext *render_context, blender::compositor::Profiler *profiler, blender::compositor::OutputTypes needed_outputs) override
ListBase view_layers
char name[64]
void WM_system_gpu_context_activate(void *context)
void WM_system_gpu_context_release(void *context)