[Bf-blender-cvs] [f84956738ba] blender2.8: Depsgraph: Forbid flush from copy-on-write operations down the road

Sergey Sharybin noreply at git.blender.org
Mon Jul 9 14:53:58 CEST 2018


Commit: f84956738ba4e97f30553a675b643f6648afce1d
Author: Sergey Sharybin
Date:   Fri Jul 6 12:33:12 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBf84956738ba4e97f30553a675b643f6648afce1d

Depsgraph: Forbid flush from copy-on-write operations down the road

Old behavior: tagging ID with DEG_TAG_COPY_ON_WRITE will do copy-on-write
(as requested), but will also flush changes to all operations with depends
on it. This means, for example, tagging object for copy-on-write will force
its modifier stack to be evaluated.

This was needed in the earlier days of copy-on-write when things were not
well defined and when lots of areas were not doing proper tagging.

New behavior: tagging ID with DEG_TAG_COPY_ON_WRITE will only ensure copy
of the dadatblock is up to date, without flushing updates to any dependencies.

This means following things:

- We can update parts of ID without invoking heavy computation of other
  parts of same ID. For example, tagging object for COPY_ON_WRITE update
  on mode change will not force modifiers stack to update.

- If some dependent datablock is dependent on pointers which are invalidated
  by copy-on-write (like, evaluated mesh referencing custom data layers from
  original mesh), this will either require explicit tag or explicit relation
  in the dependency graph.

  Currently can not find a faulty case since tagging of mesh happens with
  either 0 (which means, everything) or with GEOMETRY, which also forces
  all dependent modifier stacks to be re-evaluated.

This fixes missing PBVH when going into sculpt mode (sculpt mode toggle
was tagging object for COPY_ON_WRITE update, which was forcing modifier
stack to be updated, which was freeing PBVH.

Some other operations might also become faster with this change.

===================================================================

M	source/blender/depsgraph/intern/builder/deg_builder_relations.cc

===================================================================

diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 1e0420ef6bc..1eaf53a0afc 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -2209,10 +2209,7 @@ void DepsgraphRelationBuilder::build_copy_on_write_relations(IDDepsNode *id_node
 			/* Component explicitly requests to not add relation. */
 			continue;
 		}
-		int rel_flag = 0;
-		if (comp_node->type == DEG_NODE_TYPE_ANIMATION) {
-			rel_flag |= DEPSREL_FLAG_NO_FLUSH;
-		}
+		int rel_flag = DEPSREL_FLAG_NO_FLUSH;
 		/* All entry operations of each component should wait for a proper
 		 * copy of ID.
 		 */



More information about the Bf-blender-cvs mailing list