diff options
author | Sergey Sharybin <sergey@blender.org> | 2022-08-04 16:04:25 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2022-08-10 12:02:38 +0300 |
commit | f12f7800c2965c721a4eb4baeb6b1ab129bfa375 (patch) | |
tree | 53d35435e164f6bd0c1b35fa47a0294dfa299375 /source/blender/depsgraph/intern/node | |
parent | cfbe11563a5dfd39e5b765b986892382f6f4db99 (diff) |
Depsgraph: Optimize evaluation of dependencies of disabled modifiers
Solves long-standing issue when dependencies of disabled modifiers are
evaluated.
Simple test case: no drivers or animation. Manually enabling modifier
is expected to bring FPS up, enabling modifier will bring FPS (sine
evaluation can not be avoided)
F13336690
More complex test case: modifier visibility is driven by an animated
property. In am ideal world FPS during property being zero is fast
and when property is 1 the FPS is low.
F13336691.
Differential Revision: https://developer.blender.org/D15625
Diffstat (limited to 'source/blender/depsgraph/intern/node')
-rw-r--r-- | source/blender/depsgraph/intern/node/deg_node_operation.cc | 10 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/node/deg_node_operation.h | 3 |
2 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/node/deg_node_operation.cc b/source/blender/depsgraph/intern/node/deg_node_operation.cc index 4c8c8089ac1..65adfded6b3 100644 --- a/source/blender/depsgraph/intern/node/deg_node_operation.cc +++ b/source/blender/depsgraph/intern/node/deg_node_operation.cc @@ -227,6 +227,16 @@ void OperationNode::tag_update(Depsgraph *graph, eUpdateSource source) * the evaluated clues that evaluation needs to happen again. */ graph->add_entry_tag(this); + /* Enforce dynamic visibility codepath update. + * This ensures visibility flags are consistently propagated throughout the dependency graph when + * there is no animated visibility in the graph. + * + * For example this ensures that graph is updated properly when manually toggling non-animated + * modifier visibility. */ + if (opcode == OperationCode::VISIBILITY) { + graph->need_update_nodes_visibility = true; + } + /* Tag for update, but also note that this was the source of an update. */ flag |= (DEPSOP_FLAG_NEEDS_UPDATE | DEPSOP_FLAG_DIRECTLY_MODIFIED); switch (source) { diff --git a/source/blender/depsgraph/intern/node/deg_node_operation.h b/source/blender/depsgraph/intern/node/deg_node_operation.h index 317bb4a2a93..cb3beb56556 100644 --- a/source/blender/depsgraph/intern/node/deg_node_operation.h +++ b/source/blender/depsgraph/intern/node/deg_node_operation.h @@ -219,6 +219,9 @@ enum OperationFlag { /* The operation directly or indirectly affects ID node visibility. */ DEPSOP_FLAG_AFFECTS_VISIBILITY = (1 << 4), + /* Evaluation of the node is temporarily disabled. */ + DEPSOP_FLAG_MUTE = (1 << 5), + /* Set of flags which gets flushed along the relations. */ DEPSOP_FLAG_FLUSH = (DEPSOP_FLAG_USER_MODIFIED), }; |