Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-11-25 11:46:51 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-11-25 11:46:51 +0300
commit8294452b14fac54443f31fe11950d19370e27b43 (patch)
tree16039d458573de17644224022ab019eaeee16d95 /intern/cycles/render/graph.cpp
parent443b159f023a872472d8e61c7270dab472a3d8ee (diff)
Fix T46782: Updating Shaders very slow with complex nodegraph
The issue was caused by not really optimal graph traversal for gathering nodes dependencies which could have exponential complexity with a long tree branches connected with multiple connections between them. Now we optimize the depth traversal and perform early output if the node was already traversed. Please note that this adds some limitations to the use of SVM compiler's find_dependencies() in the cases when skip_node is not NULL and one wants to perform dependencies find sequentially with the same set. This doesn't happen in the code, but one should be aware of this.
Diffstat (limited to 'intern/cycles/render/graph.cpp')
-rw-r--r--intern/cycles/render/graph.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/intern/cycles/render/graph.cpp b/intern/cycles/render/graph.cpp
index 3e417d13d4d..e888cb37137 100644
--- a/intern/cycles/render/graph.cpp
+++ b/intern/cycles/render/graph.cpp
@@ -306,7 +306,7 @@ void ShaderGraph::find_dependencies(ShaderNodeSet& dependencies, ShaderInput *in
/* find all nodes that this input depends on directly and indirectly */
ShaderNode *node = (input->link)? input->link->parent: NULL;
- if(node) {
+ if(node != NULL && dependencies.find(node) == dependencies.end()) {
foreach(ShaderInput *in, node->inputs)
find_dependencies(dependencies, in);