diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-06-14 16:33:41 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-06-14 17:04:09 +0300 |
commit | 00eeb05f4c0bf233dfa80a5c7f9b154046521afc (patch) | |
tree | a99ce285f4a96ec5b235c15703c62e1da79f9314 /source/blender/depsgraph/intern/debug | |
parent | 42d887201465f24a43f320e20c9fba42a6e71b19 (diff) |
Depsgraph: Make certain components NOT tag copy-on-write when they are tagged
Currently done for mesh batch cache update, and for base flags sync.
Those components do not need anything from original object, and hence
can skip CoW tag and have faster update after them used.
Diffstat (limited to 'source/blender/depsgraph/intern/debug')
-rw-r--r-- | source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc b/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc index 72b86f698ef..df6e72f490f 100644 --- a/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc +++ b/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc @@ -271,6 +271,26 @@ static void deg_debug_graphviz_relation_style(const DebugContext &ctx, deg_debug_fprintf(ctx, "%s", style); } +static void deg_debug_graphviz_relation_arrowhead(const DebugContext &ctx, + const DepsRelation *rel) +{ + const char *shape_default = "normal"; + const char *shape_no_cow = "box"; + const char *shape = shape_default; + if (rel->from->get_class() == DEG_NODE_CLASS_OPERATION && + rel->to->get_class() == DEG_NODE_CLASS_OPERATION) + { + OperationDepsNode *op_from = (OperationDepsNode *)rel->from; + OperationDepsNode *op_to = (OperationDepsNode *)rel->to; + if (op_from->owner->type == DEG_NODE_TYPE_COPY_ON_WRITE && + !op_to->owner->need_tag_cow_before_update()) + { + shape = shape_no_cow; + } + } + deg_debug_fprintf(ctx, "%s", shape); +} + static void deg_debug_graphviz_node_style(const DebugContext &ctx, const DepsNode *node) { const char *base_style = "filled"; /* default style */ @@ -485,6 +505,8 @@ static void deg_debug_graphviz_node_relations(const DebugContext &ctx, deg_debug_graphviz_relation_color(ctx, rel); deg_debug_fprintf(ctx, ",style="); deg_debug_graphviz_relation_style(ctx, rel); + deg_debug_fprintf(ctx, ",arrowhead="); + deg_debug_graphviz_relation_arrowhead(ctx, rel); deg_debug_fprintf(ctx, ",penwidth=\"%f\"", penwidth); /* NOTE: edge from node to own cluster is not possible and gives graphviz * warning, avoid this here by just linking directly to the invisible |