diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-05-10 12:25:57 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-05-10 12:25:57 +0300 |
commit | ce2c15deafcb8e2d2b5a8f2b46572fb24c439ce9 (patch) | |
tree | fb89a6c546a3cab3e0aeb53f2d132d8d420b51ea /source | |
parent | 12a20b78d3d9b0f3d5ef9cc6a81ae2619c82db88 (diff) |
Depsgraph: Avoid multipel editors update per same ID
Simple thing, and apparently fps goes up to 80 with the demo file from jpbouza.
Not sure why at this point fps is so much higher than the old dependency graph
here now. And it's definitely something what others should verify as well.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_tag.cc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc index 7c660caa2f9..a433c932b3a 100644 --- a/source/blender/depsgraph/intern/depsgraph_tag.cc +++ b/source/blender/depsgraph/intern/depsgraph_tag.cc @@ -282,7 +282,12 @@ void DEG_graph_flush_updates(Main *bmain, Depsgraph *graph) it != graph->operations.end(); ++it) { + /* ID node's done flag is used to avoid multiple editors update + * for the same ID. + */ OperationDepsNode *node = *it; + IDDepsNode *id_node = node->owner->owner; + id_node->done = 0; node->scheduled = false; node->owner->flags &= ~DEPSCOMP_FULLY_SCHEDULED; } @@ -301,7 +306,10 @@ void DEG_graph_flush_updates(Main *bmain, Depsgraph *graph) OperationDepsNode *node = *it; IDDepsNode *id_node = node->owner->owner; queue.push(node); - deg_editors_id_update(bmain, id_node->id); + if (id_node->done == 0) { + deg_editors_id_update(bmain, id_node->id); + id_node->done = 1; + } node->scheduled = true; } @@ -346,7 +354,10 @@ void DEG_graph_flush_updates(Main *bmain, Depsgraph *graph) to_node->flag |= DEPSOP_FLAG_NEEDS_UPDATE; queue.push(to_node); to_node->scheduled = true; - deg_editors_id_update(bmain, id_node->id); + if (id_node->done == 0) { + deg_editors_id_update(bmain, id_node->id); + id_node->done = 1; + } } } |