Merge branch 'master' into blender2.8
[blender.git] / intern / cycles / blender / blender_sync.cpp
index 8a9b881b7d4d344c5956193d99eefc08abc26c66..b023183217e3ea353059de92d322b8e3ac8bcfea 100644 (file)
@@ -830,7 +830,8 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine& b_engine,
        }
 
        /* tiles */
-       if(params.device.type != DEVICE_CPU && !background) {
+       const bool is_cpu = (params.device.type == DEVICE_CPU);
+       if(!is_cpu && !background) {
                /* currently GPU could be much slower than CPU when using tiles,
                 * still need to be investigated, but meanwhile make it possible
                 * to work in viewport smoothly
@@ -907,6 +908,9 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine& b_engine,
                params.progressive_update_timeout = 0.1;
        }
 
+       params.use_profiling = params.device.has_profiling && !b_engine.is_preview() &&
+                              background && BlenderSession::print_render_stats;
+
        return params;
 }