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.
This commit is contained in:
@@ -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);
|
||||
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;
|
||||
if (id_node->done == 0) {
|
||||
deg_editors_id_update(bmain, id_node->id);
|
||||
id_node->done = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user