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).
This commit is contained in:
parent
f3d15771bf
commit
8b19ffd810
74 changed files with 2844 additions and 2748 deletions
|
|
@ -165,7 +165,7 @@ public:
|
|||
|
||||
uint64_t draw_viewports_pass = 0;
|
||||
|
||||
mutable RID_PtrOwner<Viewport> viewport_owner;
|
||||
mutable RID_PtrOwner<Viewport, true> viewport_owner;
|
||||
|
||||
struct ViewportSort {
|
||||
_FORCE_INLINE_ bool operator()(const Viewport *p_left, const Viewport *p_right) const {
|
||||
|
|
@ -186,7 +186,8 @@ private:
|
|||
void _draw_viewport(Viewport *p_viewport, XRInterface::Eyes p_eye = XRInterface::EYE_MONO);
|
||||
|
||||
public:
|
||||
RID viewport_create();
|
||||
RID viewport_allocate();
|
||||
void viewport_initialize(RID p_rid);
|
||||
|
||||
void viewport_set_use_xr(RID p_viewport, bool p_use_xr);
|
||||
|
||||
|
|
@ -249,6 +250,9 @@ public:
|
|||
|
||||
bool free(RID p_rid);
|
||||
|
||||
//workaround for setting this on thread
|
||||
void call_set_use_vsync(bool p_enable);
|
||||
|
||||
RendererViewport();
|
||||
virtual ~RendererViewport() {}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue