Fix T63796: Cycles OSL shader with closure not working in final render.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Tue, 16 Apr 2019 01:03:24 +0000 (03:03 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Tue, 23 Apr 2019 16:53:37 +0000 (18:53 +0200)
intern/cycles/render/session.cpp

index d4b1a5e..beb82f2 100644 (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();