diff options
author | Campbell Barton <campbell@blender.org> | 2022-03-31 05:02:33 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-03-31 05:07:14 +0300 |
commit | ae1f8315f77b34c9e658697e4d7083355c216f60 (patch) | |
tree | f3285d9d51e5a5b4e03a1d9923e2d921a5003ace /source/blender/depsgraph | |
parent | 3d132ead502f792fc67117bad5d101c137f33fef (diff) |
Depsgraph: minor optimization in order of checks
Checking BKE_image_user_id_has_animation loops over ID users
which never needs to run for material & world data-blocks.
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_nodes.cc | 2 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_relations.cc | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index 76bfd216c03..4782f1c4a5d 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -1085,7 +1085,7 @@ void DepsgraphNodeBuilder::build_animation_images(ID *id) * tree. */ const bool can_have_gpu_material = ELEM(GS(id->name), ID_MA, ID_WO); - if (BKE_image_user_id_has_animation(id) || can_have_gpu_material) { + if (can_have_gpu_material || BKE_image_user_id_has_animation(id)) { ID *id_cow = get_cow_id(id); add_operation_node( id, diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 04fb14515dc..487f096031e 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -1423,7 +1423,7 @@ void DepsgraphRelationBuilder::build_animation_images(ID *id) const bool can_have_gpu_material = ELEM(GS(id->name), ID_MA, ID_WO); /* TODO: can we check for existence of node for performance? */ - if (BKE_image_user_id_has_animation(id) || can_have_gpu_material) { + if (can_have_gpu_material || BKE_image_user_id_has_animation(id)) { OperationKey image_animation_key( id, NodeType::IMAGE_ANIMATION, OperationCode::IMAGE_ANIMATION); TimeSourceKey time_src_key; |