Cleanup: Remove node recalculate flags code

This patch removes the compositor node recalculate flags and their
corresponding code, they do not have any effect, as the flag is not
used.

Pull Request: https://projects.blender.org/blender/blender/pulls/142343
This commit is contained in:
Omar Emara
2025-07-18 15:39:45 +02:00
committed by Omar Emara
parent f62bc68a69
commit 6aa9cc56a0
2 changed files with 0 additions and 69 deletions

View File

@@ -89,18 +89,12 @@ namespace blender::ed::space_node {
/** \name Composite Job Manager
* \{ */
enum {
COM_RECALC_COMPOSITE = 1,
COM_RECALC_VIEWER = 2,
};
struct CompoJob {
/* Input parameters. */
Main *bmain;
Scene *scene;
ViewLayer *view_layer;
bNodeTree *ntree;
int recalc_flags;
/* Evaluated state/ */
Depsgraph *compositor_depsgraph;
bNodeTree *localtree;
@@ -135,59 +129,6 @@ float2 node_link_calculate_multi_input_position(const float2 &socket_position,
return {socket_position.x, socket_position.y - offset + index * NODE_MULTI_INPUT_LINK_GAP};
}
static void compo_tag_output_nodes(bNodeTree *nodetree, int recalc_flags)
{
for (bNode *node : nodetree->all_nodes()) {
if (node->type_legacy == CMP_NODE_COMPOSITE) {
if (recalc_flags & COM_RECALC_COMPOSITE) {
node->flag |= NODE_DO_OUTPUT_RECALC;
}
}
else if (node->type_legacy == CMP_NODE_VIEWER) {
if (recalc_flags & COM_RECALC_VIEWER) {
node->flag |= NODE_DO_OUTPUT_RECALC;
}
}
else if (node->type_legacy == NODE_GROUP) {
if (node->id) {
compo_tag_output_nodes((bNodeTree *)node->id, recalc_flags);
}
}
}
}
static int compo_get_recalc_flags(const bContext *C)
{
wmWindowManager *wm = CTX_wm_manager(C);
int recalc_flags = 0;
LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
const bScreen *screen = WM_window_get_active_screen(win);
LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
if (area->spacetype == SPACE_IMAGE) {
SpaceImage *sima = (SpaceImage *)area->spacedata.first;
if (sima->image) {
if (sima->image->type == IMA_TYPE_R_RESULT) {
recalc_flags |= COM_RECALC_COMPOSITE;
}
else if (sima->image->type == IMA_TYPE_COMPOSITE) {
recalc_flags |= COM_RECALC_VIEWER;
}
}
}
else if (area->spacetype == SPACE_NODE) {
SpaceNode *snode = (SpaceNode *)area->spacedata.first;
if (snode->flag & SNODE_BACKDRAW) {
recalc_flags |= COM_RECALC_VIEWER;
}
}
}
}
return recalc_flags;
}
/* Called by compositor, only to check job 'stop' value. */
static bool compo_breakjob(void *cjv)
{
@@ -268,10 +209,6 @@ static void compo_initjob(void *cjv)
cj->localtree = bke::node_tree_localize(ntree_eval, nullptr);
if (cj->recalc_flags) {
compo_tag_output_nodes(cj->localtree, cj->recalc_flags);
}
cj->re = RE_NewInteractiveCompositorRender(scene);
if (scene->r.compositor_device == SCE_COMPOSITOR_DEVICE_GPU) {
RE_system_gpu_context_ensure(cj->re);
@@ -483,7 +420,6 @@ void ED_node_composite_job(const bContext *C, bNodeTree *nodetree, Scene *scene_
cj->scene = scene;
cj->view_layer = view_layer;
cj->ntree = nodetree;
cj->recalc_flags = compo_get_recalc_flags(C);
cj->needed_outputs = needed_outputs;
/* Set up job. */

View File

@@ -629,11 +629,6 @@ enum {
* until the node type is registered.
*/
NODE_INIT = 1 << 16,
/**
* Do recalculation of output, used to skip recalculation of unwanted
* composite out nodes when editing tree
*/
NODE_DO_OUTPUT_RECALC = 1 << 17,
/** A preview for the data in this node can be displayed in the spreadsheet editor. */
// NODE_ACTIVE_PREVIEW = 1 << 18, /* deprecated */
/** Active node that is used to paint on. */