[Bf-blender-cvs] [d6100f8d48c] temp-fracture-modifier-2.8: dynamic fracture: fix for depsgraph thread jamming / crashes

Martin Felke noreply at git.blender.org
Tue Nov 27 20:48:29 CET 2018


Commit: d6100f8d48cf588971d91277af7db08b8bca5c23
Author: Martin Felke
Date:   Tue Nov 27 20:48:13 2018 +0100
Branches: temp-fracture-modifier-2.8
https://developer.blender.org/rBd6100f8d48cf588971d91277af7db08b8bca5c23

dynamic fracture: fix for depsgraph thread jamming / crashes

the modifier eval thread made calls (validate shard) which changed the rigidbody thread's data from outside, before control is passed to rigidbody thread again (both tasks / threads follow each other alternatingly, first rigidbody, then modifier, then again rigidbody and so on after frames do change. Solution was to delay validation and let the rigidbody thread do it, instead of forcing it from the modifier thread.

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

M	source/blender/blenkernel/intern/fracture.c

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

diff --git a/source/blender/blenkernel/intern/fracture.c b/source/blender/blenkernel/intern/fracture.c
index a707c4569b2..d8e946e8269 100644
--- a/source/blender/blenkernel/intern/fracture.c
+++ b/source/blender/blenkernel/intern/fracture.c
@@ -955,8 +955,15 @@ void BKE_fracture_postprocess_meshisland(FractureModifierData *fmd, Object* ob,
 				copy_v3_v3(result->rigidbody->ang_vel, mi->rigidbody->ang_vel);
 
 				//validate already here at once... dynamic somehow doesnt get updated else
-				BKE_rigidbody_shard_validate(scene->rigidbody_world, result, ob, fmd, true,
-											 true, size, frame);
+				//BKE_rigidbody_shard_validate(scene->rigidbody_world, result, ob, fmd, true,
+				//							 true, size, frame);
+
+				// try with delayed validation; next frame before next bullet step from rigidbody depsgraph eval thread
+				if (!(result->rigidbody->flag & RBO_FLAG_KINEMATIC))
+				{
+					result->rigidbody->flag |= RBO_FLAG_NEEDS_VALIDATE;
+					result->rigidbody->flag |= RBO_FLAG_NEEDS_RESHAPE;
+				}
 
 				result->constraint_index = result->id;



More information about the Bf-blender-cvs mailing list