Depsgraph: avoid unnecessary image updates, for compositor caching

For non-COW datablocks like images, there is no need to update when
they just got added to the depsgraph and there is no flag indicating
a specific change that was made to them. Avoiding this helps preserve
the cached image draw data used by the compositor.

Co-authored-by: Sergey Sharybin <sergey@blender.org>

Ref #115511
This commit is contained in:
Brecht Van Lommel
2023-12-12 20:21:20 +01:00
parent 75f160ee96
commit cd61a140fa

View File

@@ -557,7 +557,14 @@ void graph_tag_ids_for_visible_update(Depsgraph *graph)
if (id_type == ID_OB) {
flags |= ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY;
}
graph_id_tag_update(bmain, graph, id_node->id_orig, flags, DEG_UPDATE_SOURCE_VISIBILITY);
/* For non-COW datablocks like images, there is no need to update when
* they just got added to the depsgraph and there is no flag indicating
* a specific change that was made to them. Unlike COW datablocks which
* have just been copied.
* This helps preserve cached image draw data for the compositor. */
if (ID_TYPE_IS_COW(id_type) || flags != 0) {
graph_id_tag_update(bmain, graph, id_node->id_orig, flags, DEG_UPDATE_SOURCE_VISIBILITY);
}
if (id_type == ID_SCE) {
/* Make sure collection properties are up to date. */
id_node->tag_update(graph, DEG_UPDATE_SOURCE_VISIBILITY);