Cycles: Add bump feature for selective nodes compilation

For now it is unused in the kernel, actual usage will come with
the next commits.
This commit is contained in:
Sergey Sharybin
2015-06-01 15:26:36 +05:00
parent 36ef6d1532
commit 4d8cf1329d
3 changed files with 13 additions and 2 deletions

View File

@@ -487,6 +487,7 @@ void ShaderManager::get_requested_features(Scene *scene, int& max_group, int& fe
features = 0;
for(int i = 0; i < scene->shaders.size(); i++) {
Shader *shader = scene->shaders[i];
/* Gather requested features from all the nodes from the graph nodes. */
foreach(ShaderNode *node, shader->graph->nodes) {
max_group = min(max_group, node->get_group());
features |= node->get_feature();
@@ -497,6 +498,11 @@ void ShaderManager::get_requested_features(Scene *scene, int& max_group, int& fe
}
}
}
/* Gather requested features from the graph itself. */
ShaderNode *output_node = shader->graph->output();
if(output_node->input("Displacement")->link != NULL) {
features |= NODE_FEATURE_BUMP;
}
}
}