From 79d8f1e4a5ca824b7c2d8f1f0106818c68cbbfa1 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 27 Dec 2013 02:30:48 +0600 Subject: Fix T37955: Freestyle render misalignment Issue was caused by missing objects update for temporary freestyle objects. This happened because of the fact that such objects doesn't have any relations, as in they're corresponding to root nodes in the DAG. This situation wasn't handled by DAG_threaded_update_begin() which considered there's only one root node in the DAG. --- source/blender/blenkernel/intern/depsgraph.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 8074d6bceec..6376878c664 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -2735,7 +2735,7 @@ void DAG_threaded_update_begin(Scene *scene, void (*func)(void *node, void *user_data), void *user_data) { - DagNode *node, *root_node; + DagNode *node; /* We reset num_pending_parents to zero first and tag node as not scheduled yet... */ for (node = scene->theDag->DagNode.first; node; node = node->next) { @@ -2756,10 +2756,15 @@ void DAG_threaded_update_begin(Scene *scene, } } - /* Add root node to the queue. */ - root_node = scene->theDag->DagNode.first; - root_node->scheduled = true; - func(root_node, user_data); + /* Add root nodes to the queue. */ + BLI_spin_lock(&threaded_update_lock); + for (node = scene->theDag->DagNode.first; node; node = node->next) { + if (node->num_pending_parents == 0) { + node->scheduled = true; + func(node, user_data); + } + } + BLI_spin_unlock(&threaded_update_lock); } /* This function is called when handling node is done. -- cgit v1.2.3