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/resources/multimesh.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scene/resources') diff --git a/scene/resources/multimesh.cpp b/scene/resources/multimesh.cpp index 050e398ca4..e8e159921c 100644 --- a/scene/resources/multimesh.cpp +++ b/scene/resources/multimesh.cpp @@ -217,7 +217,7 @@ Ref MultiMesh::get_mesh() const { void MultiMesh::set_instance_count(int p_count) { ERR_FAIL_COND(p_count < 0); - RenderingServer::get_singleton()->multimesh_allocate(multimesh, p_count, RS::MultimeshTransformFormat(transform_format), use_colors, use_custom_data); + RenderingServer::get_singleton()->multimesh_allocate_data(multimesh, p_count, RS::MultimeshTransformFormat(transform_format), use_colors, use_custom_data); instance_count = p_count; } -- cgit v1.2.3