Fix T63346: Cycles OSL shader with closure not working in final render.

This commit is contained in:
Brecht Van Lommel 2019-04-16 03:03:24 +02:00
parent 3d744dff58
commit 6a50a3d140
1 changed files with 6 additions and 0 deletions

View File

@ -1131,6 +1131,12 @@ void Session::collect_statistics(RenderStats *render_stats)
int Session::get_max_closure_count()
{
if (scene->shader_manager->use_osl()) {
/* OSL always needs the maximum as we can't predict the
* number of closures a shader might generate. */
return MAX_CLOSURE;
}
int max_closures = 0;
for(int i = 0; i < scene->shaders.size(); i++) {
int num_closures = scene->shaders[i]->graph->get_num_closures();