From 8b19ffd810a1471ab870b7229047ad2101341330 Mon Sep 17 00:00:00 2001 From: reduz Date: Tue, 9 Feb 2021 13:19:03 -0300 Subject: Make Servers truly Thread Safe -Rendering server now uses a split RID allocate/initialize internally, this allows generating RIDs immediately but initialization to happen later on the proper thread (as rendering APIs generally requiere to call on the right thread). -RenderingServerWrapMT is no more, multithreading is done in RenderingServerDefault. -Some functions like texture or mesh creation, when renderer supports it, can register and return immediately (so no waiting for server API to flush, and saving staging and command buffer memory). -3D physics server changed to be made multithread friendly. -Added PhysicsServer3DWrapMT to use 3D physics server from multiple threads. -Disablet Bullet (too much effort to make multithread friendly, this needs to be fixed eventually). --- scene/main/viewport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scene/main') diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 6204794288..1d0a6074c1 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -468,7 +468,7 @@ void Viewport::_notification(int p_what) { //3D PhysicsServer3D::get_singleton()->space_set_debug_contacts(find_world_3d()->get_space(), get_tree()->get_collision_debug_contact_count()); contact_3d_debug_multimesh = RenderingServer::get_singleton()->multimesh_create(); - RenderingServer::get_singleton()->multimesh_allocate(contact_3d_debug_multimesh, get_tree()->get_collision_debug_contact_count(), RS::MULTIMESH_TRANSFORM_3D, true); + RenderingServer::get_singleton()->multimesh_allocate_data(contact_3d_debug_multimesh, get_tree()->get_collision_debug_contact_count(), RS::MULTIMESH_TRANSFORM_3D, true); RenderingServer::get_singleton()->multimesh_set_visible_instances(contact_3d_debug_multimesh, 0); RenderingServer::get_singleton()->multimesh_set_mesh(contact_3d_debug_multimesh, get_tree()->get_debug_contact_mesh()->get_rid()); contact_3d_debug_instance = RenderingServer::get_singleton()->instance_create(); -- cgit v1.2.3