File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,10 @@ void GodotSoftBody3D::set_mesh(RID p_mesh) {
136136 return ;
137137 }
138138
139+ // TODO: calling RenderingServer::mesh_surface_get_arrays() from the physics thread
140+ // is not safe and can deadlock when physics/3d/run_on_separate_thread is enabled.
141+ // This method blocks on the main thread to return data, but the main thread may be
142+ // blocked waiting on us in PhysicsServer3D::sync().
139143 Array arrays = RenderingServer::get_singleton ()->mesh_surface_get_arrays (soft_mesh, 0 );
140144 ERR_FAIL_COND (arrays.is_empty ());
141145
Original file line number Diff line number Diff line change @@ -128,6 +128,10 @@ bool JoltSoftBody3D::_ref_shared_data() {
128128 if (iter_shared_data == mesh_to_shared.end ()) {
129129 RenderingServer *rendering = RenderingServer::get_singleton ();
130130
131+ // TODO: calling RenderingServer::mesh_surface_get_arrays() from the physics thread
132+ // is not safe and can deadlock when physics/3d/run_on_separate_thread is enabled.
133+ // This method blocks on the main thread to return data, but the main thread may be
134+ // blocked waiting on us in PhysicsServer3D::sync().
131135 const Array mesh_data = rendering->mesh_surface_get_arrays (mesh, 0 );
132136 ERR_FAIL_COND_V (mesh_data.is_empty (), false );
133137
You can’t perform that action at this time.
0 commit comments