Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-10-29 12:14:09 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-10-29 12:19:25 +0300
commit0e80d0893fac47f04f2a06e6d484bddad87ae5d3 (patch)
tree319cda3a56440a2ca9f663d0d5e707ebfc1ad9cf /source/blender/depsgraph
parenta15a3952f4270bb0ddb28d8118fc63707e065bde (diff)
New depsgraph: Optimize updates flush
Previously it was possible that same component will be tagged for update again and again, making update flushing really slow. Now we'll store flag whether component was fully tagged. This is still temporary solution because ideally we should just support partial updates, but that's for the future. Gives around 10% speedup on file from jpbouza.
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r--source/blender/depsgraph/intern/depsgraph_tag.cc17
-rw-r--r--source/blender/depsgraph/intern/depsnode_component.cc3
-rw-r--r--source/blender/depsgraph/intern/depsnode_component.h8
3 files changed, 21 insertions, 7 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc
index 65d75fccad3..a635cb670c7 100644
--- a/source/blender/depsgraph/intern/depsgraph_tag.cc
+++ b/source/blender/depsgraph/intern/depsgraph_tag.cc
@@ -284,6 +284,7 @@ void DEG_graph_flush_updates(Main *bmain, Depsgraph *graph)
{
OperationDepsNode *node = *it;
node->scheduled = false;
+ node->owner->flags &= ~DEPSCOMP_FULLY_SCHEDULED;
}
FlushQueue queue;
@@ -353,12 +354,16 @@ void DEG_graph_flush_updates(Main *bmain, Depsgraph *graph)
* witin a component at least we tag the whole component
* for update.
*/
- for (ComponentDepsNode::OperationMap::iterator it = node->owner->operations.begin();
- it != node->owner->operations.end();
- ++it)
- {
- OperationDepsNode *op = it->second;
- op->flag |= DEPSOP_FLAG_NEEDS_UPDATE;
+ ComponentDepsNode *component = node->owner;
+ if ((component->flags & DEPSCOMP_FULLY_SCHEDULED) == 0) {
+ for (ComponentDepsNode::OperationMap::iterator it = component->operations.begin();
+ it != node->owner->operations.end();
+ ++it)
+ {
+ OperationDepsNode *op = it->second;
+ op->flag |= DEPSOP_FLAG_NEEDS_UPDATE;
+ }
+ component->flags |= DEPSCOMP_FULLY_SCHEDULED;
}
}
}
diff --git a/source/blender/depsgraph/intern/depsnode_component.cc b/source/blender/depsgraph/intern/depsnode_component.cc
index 1d939c6580d..a47a0d29228 100644
--- a/source/blender/depsgraph/intern/depsnode_component.cc
+++ b/source/blender/depsgraph/intern/depsnode_component.cc
@@ -50,7 +50,8 @@ extern "C" {
ComponentDepsNode::ComponentDepsNode() :
entry_operation(NULL),
- exit_operation(NULL)
+ exit_operation(NULL),
+ flags(0)
{
}
diff --git a/source/blender/depsgraph/intern/depsnode_component.h b/source/blender/depsgraph/intern/depsnode_component.h
index e3550bb2371..7f44c0ed03f 100644
--- a/source/blender/depsgraph/intern/depsnode_component.h
+++ b/source/blender/depsgraph/intern/depsnode_component.h
@@ -46,6 +46,12 @@ struct EvaluationContext;
struct OperationDepsNode;
struct BoneComponentDepsNode;
+typedef enum eDepsComponent_Flag {
+ /* Temporary flags, meaning all the component's operations has been
+ * scheduled for update.
+ */
+ DEPSCOMP_FULLY_SCHEDULED = 1,
+} eDepsComponent_Flag;
/* ID Component - Base type for all components */
struct ComponentDepsNode : public DepsNode {
@@ -146,6 +152,8 @@ struct ComponentDepsNode : public DepsNode {
OperationDepsNode *exit_operation;
// XXX: a poll() callback to check if component's first node can be started?
+
+ int flags;
};
/* ---------------------------------------- */