Depsgraph: Introduce ID recalc flag for COW component

Currently unused, but will become handy to check whether ID needs
to have COW update to be run.
This commit is contained in:
Sergey Sharybin 2018-04-11 17:29:00 +02:00
parent fac1892e11
commit 18c7575f93
3 changed files with 4 additions and 2 deletions

View File

@ -155,6 +155,7 @@ BLI_INLINE void flush_handle_component_node(Depsgraph *graph,
ComponentDepsNode *cow_comp =
id_node->find_component(DEG_NODE_TYPE_COPY_ON_WRITE);
cow_comp->tag_update(graph);
id_node->id_orig->recalc |= ID_RECALC_COPY_ON_WRITE;
}
/* Tag all required operations in component for update. */
foreach (OperationDepsNode *op, comp_node->operations) {
@ -168,7 +169,7 @@ BLI_INLINE void flush_handle_component_node(Depsgraph *graph,
}
op->flag |= DEPSOP_FLAG_NEEDS_UPDATE;
}
/* When some target changes bone, we might need to re-run the
/* when some target changes bone, we might need to re-run the
* whole IK solver, otherwise result might be unpredictable.
*/
if (comp_node->type == DEG_NODE_TYPE_BONE) {

View File

@ -381,7 +381,7 @@ DEG_COMPONENT_NODE_DEFINE(Animation, ANIMATION, ID_RECALC_ANIMA
DEG_COMPONENT_NODE_DEFINE(BatchCache, BATCH_CACHE, ID_RECALC_DRAW_CACHE);
DEG_COMPONENT_NODE_DEFINE(Bone, BONE, ID_RECALC_GEOMETRY);
DEG_COMPONENT_NODE_DEFINE(Cache, CACHE, ID_RECALC);
DEG_COMPONENT_NODE_DEFINE(CopyOnWrite, COPY_ON_WRITE, ID_RECALC);
DEG_COMPONENT_NODE_DEFINE(CopyOnWrite, COPY_ON_WRITE, ID_RECALC_COPY_ON_WRITE);
DEG_COMPONENT_NODE_DEFINE(Geometry, GEOMETRY, ID_RECALC_GEOMETRY);
DEG_COMPONENT_NODE_DEFINE(LayerCollections, LAYER_COLLECTIONS, ID_RECALC_COLLECTIONS);
DEG_COMPONENT_NODE_DEFINE(Parameters, PARAMETERS, ID_RECALC);

View File

@ -472,6 +472,7 @@ enum {
ID_RECALC_GEOMETRY = 1 << 4,
ID_RECALC_TRANSFORM = 1 << 5,
ID_RECALC_COLLECTIONS = 1 << 6,
ID_RECALC_COPY_ON_WRITE = 1 << 7,
/* Special flag to check if SOMETHING was changed. */
ID_RECALC_ALL = (~(int)0),
};