Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorOlivier Maury <omaury>2020-10-23 18:13:21 +0300
committerBrecht Van Lommel <brecht@blender.org>2020-10-23 18:45:11 +0300
commit559e87ad08b7070590228885ef8484af1c850afd (patch)
treed4c029b7fce606f7fd6c86500cac012f4132f268 /intern
parent0d1b1c341f4fe386f0818978ff8df1a81e91cd50 (diff)
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
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/blender/blender_object.cpp9
1 files changed, 7 insertions, 2 deletions
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,