Commit: cb8766e9b2425c762d9eef537dc4987d13eeae1f Author: Kévin Dietrich Date: Fri Nov 6 16:49:17 2020 +0100 Branches: cycles_procedural_api https://developer.blender.org/rBcb8766e9b2425c762d9eef537dc4987d13eeae1f
avoid updating bvh data if no geometry has changed =================================================================== M intern/cycles/render/geometry.cpp =================================================================== diff --git a/intern/cycles/render/geometry.cpp b/intern/cycles/render/geometry.cpp index 85ca08be9a3..589392dca53 100644 --- a/intern/cycles/render/geometry.cpp +++ b/intern/cycles/render/geometry.cpp @@ -1714,6 +1714,7 @@ void GeometryManager::device_update(Device *device, return; } + bool need_update_scene_bvh = false; { scoped_callback_timer timer([scene](double time) { if (scene->update_stats) { @@ -1725,6 +1726,7 @@ void GeometryManager::device_update(Device *device, size_t i = 0; foreach (Geometry *geom, scene->geometry) { if (geom->is_modified()) { + need_update_scene_bvh = true; pool.push(function_bind( &Geometry::compute_bvh, geom, device, dscene, &scene->params, &progress, i, num_bvh)); if (geom->need_build_bvh(bvh_layout)) { @@ -1763,7 +1765,7 @@ void GeometryManager::device_update(Device *device, if (progress.get_cancel()) return; - { + if (need_update_scene_bvh) { device_update_bvh(device, dscene, scene, progress); if (progress.get_cancel()) return; _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs