Files
test/source/blender/blenkernel/BKE_scene_runtime.hh
Omar Emara 95eb3e13bf Fix #119211: Masks do not update in GPU compositor
Masks are not updated when edited when using the GPU compositor. That's
because the GPU compositor caches static resources and invalidates them
according to the recalculate flags that the depsgraph flushes to IDs.
The issue is that the flags are not flushed to the evaluated IDs of the
compositor depsgraph, but rather to some other evaluated versions of the
IDs.

To fix this, we make the compositor depsgraph persistent and store it in
the scene runtime. This allows us to reliably track changes to resources
used by the compositor and also reduces the overhead of depsgraph
creation in the compositor job.

Patch originally provided by Sergey.

Fixes #121188.

Pull Request: https://projects.blender.org/blender/blender/pulls/123085
2024-06-13 07:43:11 +02:00

37 lines
1.0 KiB
C++

/* SPDX-FileCopyrightText: 2024 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
#include "BLI_map.hh"
#include "BLI_timeit.hh"
#include "BLI_utility_mixins.hh"
struct Depsgraph;
namespace blender::bke {
/* Runtime data specific to the compositing trees. */
class CompositorRuntime {
public:
/* Per-node instance total execution time for the corresponding node, during the last tree
* evaluation. */
Map<bNodeInstanceKey, timeit::Nanoseconds> per_node_execution_time;
/* A dependency graph used for interactive compositing. This is initialized the first time it is
* needed, and then kept persistent for the lifetime of the scene. This is done to allow the
* compositor to track changes to resources its uses as well as reduce the overhead of creating
* the dependency graph every time it executes. */
Depsgraph *preview_depsgraph = nullptr;
~CompositorRuntime();
};
class SceneRuntime : NonCopyable, NonMovable {
public:
CompositorRuntime compositor;
};
} // namespace blender::bke