Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/render/scene.cpp
| Show First 20 Lines • Show All 564 Lines • ▼ Show 20 Lines | if (shader_manager->use_osl()) { | ||||
| /* OSL always needs the maximum as we can't predict the | /* OSL always needs the maximum as we can't predict the | ||||
| * number of closures a shader might generate. */ | * number of closures a shader might generate. */ | ||||
| return MAX_CLOSURE; | return MAX_CLOSURE; | ||||
| } | } | ||||
| int max_closures = 0; | int max_closures = 0; | ||||
| for (int i = 0; i < shaders.size(); i++) { | for (int i = 0; i < shaders.size(); i++) { | ||||
| Shader *shader = shaders[i]; | Shader *shader = shaders[i]; | ||||
| if (shader->used) { | if (shader->get_used()) { | ||||
| int num_closures = shader->graph->get_num_closures(); | int num_closures = shader->get_graph()->get_num_closures(); | ||||
| max_closures = max(max_closures, num_closures); | max_closures = max(max_closures, num_closures); | ||||
| } | } | ||||
| } | } | ||||
| max_closure_global = max(max_closure_global, max_closures); | max_closure_global = max(max_closure_global, max_closures); | ||||
| if (max_closure_global > MAX_CLOSURE) { | if (max_closure_global > MAX_CLOSURE) { | ||||
| /* This is usually harmless as more complex shader tend to get many | /* This is usually harmless as more complex shader tend to get many | ||||
| * closures discarded due to mixing or low weights. We need to limit | * closures discarded due to mixing or low weights. We need to limit | ||||
| ▲ Show 20 Lines • Show All 189 Lines • Show Last 20 Lines | |||||