diff options
Diffstat (limited to 'source/blender/depsgraph/intern/eval/deg_eval_flush.cc')
-rw-r--r-- | source/blender/depsgraph/intern/eval/deg_eval_flush.cc | 28 |
1 files changed, 19 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 83fcf4c6ea1..2479373b687 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc @@ -29,16 +29,18 @@ #include <deque> #include <cmath> -#include "BKE_object.h" - #include "BLI_utildefines.h" #include "BLI_listbase.h" #include "BLI_math_vector.h" #include "BLI_task.h" #include "BLI_ghash.h" +#include "BKE_object.h" +#include "BKE_scene.h" + extern "C" { #include "DNA_object_types.h" +#include "DNA_scene_types.h" #include "DRW_engine.h" } /* extern "C" */ @@ -53,6 +55,7 @@ extern "C" { #include "intern/node/deg_node_factory.h" #include "intern/node/deg_node_id.h" #include "intern/node/deg_node_operation.h" +#include "intern/node/deg_node_time.h" #include "intern/eval/deg_eval_copy_on_write.h" @@ -86,7 +89,7 @@ namespace { void flush_init_operation_node_func(void *__restrict data_v, const int i, - const ParallelRangeTLS *__restrict /*tls*/) + const TaskParallelTLS *__restrict /*tls*/) { Depsgraph *graph = (Depsgraph *)data_v; OperationNode *node = graph->operations[i]; @@ -95,7 +98,7 @@ void flush_init_operation_node_func(void *__restrict data_v, void flush_init_id_node_func(void *__restrict data_v, const int i, - const ParallelRangeTLS *__restrict /*tls*/) + const TaskParallelTLS *__restrict /*tls*/) { Depsgraph *graph = (Depsgraph *)data_v; IDNode *id_node = graph->id_nodes[i]; @@ -109,14 +112,14 @@ BLI_INLINE void flush_prepare(Depsgraph *graph) { { const int num_operations = graph->operations.size(); - ParallelRangeSettings settings; + TaskParallelSettings settings; BLI_parallel_range_settings_defaults(&settings); settings.min_iter_per_thread = 1024; BLI_task_parallel_range(0, num_operations, graph, flush_init_operation_node_func, &settings); } { const int num_id_nodes = graph->id_nodes.size(); - ParallelRangeSettings settings; + TaskParallelSettings settings; BLI_parallel_range_settings_defaults(&settings); settings.min_iter_per_thread = 1024; BLI_task_parallel_range(0, num_id_nodes, graph, flush_init_id_node_func, &settings); @@ -348,9 +351,16 @@ void deg_graph_flush_updates(Main *bmain, Depsgraph *graph) BLI_assert(bmain != NULL); BLI_assert(graph != NULL); /* Nothing to update, early out. */ - if (BLI_gset_len(graph->entry_tags) == 0) { + if (BLI_gset_len(graph->entry_tags) == 0 && !graph->need_update_time) { return; } + if (graph->need_update_time) { + const Scene *scene_orig = graph->scene; + const float ctime = BKE_scene_frame_get(scene_orig); + DEG::TimeSourceNode *time_source = graph->find_time_source(); + graph->ctime = ctime; + time_source->tag_update(graph, DEG::DEG_UPDATE_SOURCE_TIME); + } /* Reset all flags, get ready for the flush. */ flush_prepare(graph); /* Starting from the tagged "entry" nodes, flush outwards. */ @@ -387,7 +397,7 @@ void deg_graph_flush_updates(Main *bmain, Depsgraph *graph) static void graph_clear_operation_func(void *__restrict data_v, const int i, - const ParallelRangeTLS *__restrict /*tls*/) + const TaskParallelTLS *__restrict /*tls*/) { Depsgraph *graph = (Depsgraph *)data_v; OperationNode *node = graph->operations[i]; @@ -402,7 +412,7 @@ void deg_graph_clear_tags(Depsgraph *graph) /* Go over all operation nodes, clearing tags. */ { const int num_operations = graph->operations.size(); - ParallelRangeSettings settings; + TaskParallelSettings 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); |