diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-07-06 13:33:12 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-07-09 15:42:56 +0300 |
commit | f84956738ba4e97f30553a675b643f6648afce1d (patch) | |
tree | d9a855b075a21b9a761226503673068440b418a5 /source | |
parent | bf02c4ba000485b726c174aca1edb52f3acd3eb4 (diff) |
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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_relations.cc | 5 |
1 files changed, 1 insertions, 4 deletions
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. */ |