[Bf-blender-cvs] [559e87ad08b] master: Fix T81976: Cycles crash after recent geometry sync multithreading change

Olivier Maury noreply at git.blender.org
Fri Oct 23 17:45:30 CEST 2020


Commit: 559e87ad08b7070590228885ef8484af1c850afd
Author: Olivier Maury
Date:   Fri Oct 23 17:13:21 2020 +0200
Branches: master
https://developer.blender.org/rB559e87ad08b7070590228885ef8484af1c850afd

Fix T81976: Cycles crash after recent geometry sync multithreading change

Avoid accessing mesh emitter and hair at the same time. This is not ideal for
performance, but once we have a dedicated hair object this will resolve itself.

Differential Revision: https://developer.blender.org/D9322

===================================================================

M	intern/cycles/blender/blender_object.cpp

===================================================================

diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp
index c3420c24469..23faacc15da 100644
--- a/intern/cycles/blender/blender_object.cpp
+++ b/intern/cycles/blender/blender_object.cpp
@@ -393,6 +393,11 @@ void BlenderSync::sync_objects(BL::Depsgraph &b_depsgraph,
     /* Load per-object culling data. */
     culling.init_object(scene, b_ob);
 
+    /* Ensure the object geom supporting the hair is processed before adding
+     * the hair processing task to the task pool, calling .to_mesh() on the
+     * same object in parallel does not work. */
+    const bool sync_hair = b_instance.show_particles() && object_has_particle_hair(b_ob);
+
     /* Object itself. */
     if (b_instance.show_self()) {
       sync_object(b_depsgraph,
@@ -403,11 +408,11 @@ void BlenderSync::sync_objects(BL::Depsgraph &b_depsgraph,
                   show_lights,
                   culling,
                   &use_portal,
-                  &geom_task_pool);
+                  sync_hair ? NULL : &geom_task_pool);
     }
 
     /* Particle hair as separate object. */
-    if (b_instance.show_particles() && object_has_particle_hair(b_ob)) {
+    if (sync_hair) {
       sync_object(b_depsgraph,
                   b_view_layer,
                   b_instance,



More information about the Bf-blender-cvs mailing list