diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-04-25 16:04:25 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-04-25 17:34:55 +0300 |
commit | e5633114cd2c8d4aff8cea061d1fa5f144fb2a69 (patch) | |
tree | ae8478cb3bd78ec64c5ce542e4eba86c7518e6a3 /source/blender/depsgraph/intern/eval/deg_eval_flush.cc | |
parent | 29631ff0136a89a0114e097b12d4de87f22e577c (diff) |
Depsgraph: Preserve CoW ID recalc flags
Previously they would have been replaced with flag from original
datablock, which is not what we want.
Diffstat (limited to 'source/blender/depsgraph/intern/eval/deg_eval_flush.cc')
-rw-r--r-- | source/blender/depsgraph/intern/eval/deg_eval_flush.cc | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc index 864d9d9e1ff..2778dadcb6e 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc @@ -301,7 +301,7 @@ void deg_graph_flush_updates(Main *bmain, Depsgraph *graph) flush_editors_id_update(bmain, graph, &update_ctx); } -static void graph_clear_func( +static void graph_clear_operation_func( void *__restrict data_v, const int i, const ParallelRangeTLS *__restrict /*tls*/) @@ -312,18 +312,41 @@ static void graph_clear_func( node->flag &= ~(DEPSOP_FLAG_DIRECTLY_MODIFIED | DEPSOP_FLAG_NEEDS_UPDATE); } +static void graph_clear_id_node_func( + void *__restrict data_v, + const int i, + const ParallelRangeTLS *__restrict /*tls*/) +{ + Depsgraph *graph = (Depsgraph *)data_v; + IDDepsNode *id_node = graph->id_nodes[i]; + id_node->id_cow->recalc &= ~ID_RECALC_ALL; +} + /* Clear tags from all operation nodes. */ void deg_graph_clear_tags(Depsgraph *graph) { /* Go over all operation nodes, clearing tags. */ - const int num_operations = graph->operations.size(); - ParallelRangeSettings settings; - BLI_parallel_range_settings_defaults(&settings); - settings.min_iter_per_thread = 1024; - BLI_task_parallel_range(0, num_operations, - graph, - graph_clear_func, - &settings); + { + const int num_operations = graph->operations.size(); + ParallelRangeSettings settings; + BLI_parallel_range_settings_defaults(&settings); + settings.min_iter_per_thread = 1024; + BLI_task_parallel_range(0, num_operations, + graph, + graph_clear_operation_func, + &settings); + } + /* Go over all ID nodes nodes, clearing tags. */ + { + const int num_id_nodes = graph->id_nodes.size(); + ParallelRangeSettings settings; + BLI_parallel_range_settings_defaults(&settings); + settings.min_iter_per_thread = 1024; + BLI_task_parallel_range(0, num_id_nodes, + graph, + graph_clear_id_node_func, + &settings); + } /* Clear any entry tags which haven't been flushed. */ BLI_gset_clear(graph->entry_tags, NULL); } |