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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user