Merge branch 'blender-v4.2-release'

This commit is contained in:
Omar Emara 2024-06-13 08:44:40 +03:00
commit 8907b52839
3 changed files with 29 additions and 6 deletions

@ -8,13 +8,24 @@
#include "BLI_timeit.hh"
#include "BLI_utility_mixins.hh"
struct Depsgraph;
namespace blender::bke {
/* Runtime data specific to the compositing trees. */
struct CompositorRuntime {
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 {

@ -107,8 +107,16 @@
#include "bmesh.hh"
using blender::bke::CompositorRuntime;
using blender::bke::SceneRuntime;
CompositorRuntime::~CompositorRuntime()
{
if (preview_depsgraph) {
DEG_graph_free(preview_depsgraph);
}
}
CurveMapping *BKE_sculpt_default_cavity_curve()
{

@ -219,9 +219,6 @@ static void compo_freejob(void *cjv)
bke::ntreeFreeTree(cj->localtree);
MEM_freeN(cj->localtree);
}
if (cj->compositor_depsgraph != nullptr) {
DEG_graph_free(cj->compositor_depsgraph);
}
MEM_delete(cj);
}
@ -235,8 +232,15 @@ static void compo_initjob(void *cjv)
Scene *scene = cj->scene;
ViewLayer *view_layer = cj->view_layer;
cj->compositor_depsgraph = DEG_graph_new(bmain, scene, view_layer, DAG_EVAL_RENDER);
DEG_debug_name_set(cj->compositor_depsgraph, "COMPOSITOR");
bke::CompositorRuntime &compositor_runtime = scene->runtime->compositor;
if (!compositor_runtime.preview_depsgraph) {
compositor_runtime.preview_depsgraph = DEG_graph_new(
bmain, scene, view_layer, DAG_EVAL_RENDER);
DEG_debug_name_set(compositor_runtime.preview_depsgraph, "COMPOSITOR");
}
cj->compositor_depsgraph = compositor_runtime.preview_depsgraph;
DEG_graph_build_for_compositor_preview(cj->compositor_depsgraph, cj->ntree);
/* NOTE: Don't update animation to preserve unkeyed changes, this means can not use