From 00eeb05f4c0bf233dfa80a5c7f9b154046521afc Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 14 Jun 2018 15:33:41 +0200 Subject: 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. --- .../intern/debug/deg_debug_relations_graphviz.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc') 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 -- cgit v1.2.3