Depsgraph: Perform early exit check prior to time tag

Evaluation is not entirely cheap even in the case when there is nothing tagged
in the scene. This is because of all the calculation of pending operations,
cleating runtime flags and so on.

This commit makes it so time operation is tagged for update prior to early exit
check. Improves playback speed in a scene without anything animated.

Maniphest Tasks: T70463

Differential Revision: https://developer.blender.org/D6002
This commit is contained in:
Sergey Sharybin 2019-10-06 12:19:12 +02:00
parent fda1db5ba4
commit 9d13321831
1 changed files with 3 additions and 3 deletions

View File

@ -351,9 +351,6 @@ 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 && !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);
@ -361,6 +358,9 @@ void deg_graph_flush_updates(Main *bmain, Depsgraph *graph)
graph->ctime = ctime;
time_source->tag_update(graph, DEG::DEG_UPDATE_SOURCE_TIME);
}
if (BLI_gset_len(graph->entry_tags) == 0) {
return;
}
/* Reset all flags, get ready for the flush. */
flush_prepare(graph);
/* Starting from the tagged "entry" nodes, flush outwards. */