diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-02-20 19:16:41 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-02-21 12:11:43 +0300 |
commit | b1946e7f7ad2c9a308060f4f1a06f82cdcb4c8a5 (patch) | |
tree | 043bbca0932a451ba1f7d57ded7249b54b5f31be /source/blender/depsgraph/intern/builder | |
parent | 6535f668b4733e354db7073c4edc82e6e820a678 (diff) |
Depsgraph: Report overall number of cycles detected
Handy to quickly see if a fix fixed any of the cycles in a real rig,
or whether it's introduced new ones.
Diffstat (limited to 'source/blender/depsgraph/intern/builder')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_cycle.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_cycle.cc b/source/blender/depsgraph/intern/builder/deg_builder_cycle.cc index e30b9b44490..c9fa35bd551 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_cycle.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_cycle.cc @@ -87,6 +87,7 @@ void deg_graph_detect_cycles(Depsgraph *graph) BLI_Stack *traversal_stack = BLI_stack_new(sizeof(StackEntry), "DEG detect cycles stack"); + int num_cycles = 0; foreach (OperationDepsNode *node, graph->operations) { bool has_inlinks = false; foreach (DepsRelation *rel, node->inlinks) { @@ -136,6 +137,7 @@ void deg_graph_detect_cycles(Depsgraph *graph) } /* TODO(sergey): So called russian roulette cycle solver. */ rel->flag |= DEPSREL_FLAG_CYCLIC; + ++num_cycles; } else if (to_state == NODE_NOT_VISITED) { StackEntry new_entry; @@ -157,6 +159,10 @@ void deg_graph_detect_cycles(Depsgraph *graph) } BLI_stack_free(traversal_stack); + + if (num_cycles != 0) { + printf("Detected %d dependency cycles\n", num_cycles); + } } } // namespace DEG |