summaryrefslogtreecommitdiff
path: root/servers/rendering/renderer_rd/renderer_scene_render_rd.h
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2021-02-09 13:19:03 -0300
committerreduz <reduzio@gmail.com>2021-02-10 13:21:46 -0300
commit8b19ffd810a1471ab870b7229047ad2101341330 (patch)
tree19bf66787e48cebd86b494846d147db1f163f87c /servers/rendering/renderer_rd/renderer_scene_render_rd.h
parentf3d15771bf33e68b26058806f9310ac074c56e5c (diff)
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).
Diffstat (limited to 'servers/rendering/renderer_rd/renderer_scene_render_rd.h')
-rw-r--r--servers/rendering/renderer_rd/renderer_scene_render_rd.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/servers/rendering/renderer_rd/renderer_scene_render_rd.h b/servers/rendering/renderer_rd/renderer_scene_render_rd.h
index ac567e9bdc..e4eaa93212 100644
--- a/servers/rendering/renderer_rd/renderer_scene_render_rd.h
+++ b/servers/rendering/renderer_rd/renderer_scene_render_rd.h
@@ -333,7 +333,7 @@ private:
uint32_t sky_ggx_samples_quality;
bool sky_use_cubemap_array;
- mutable RID_Owner<Sky> sky_owner;
+ mutable RID_Owner<Sky, true> sky_owner;
/* REFLECTION ATLAS */
@@ -809,7 +809,7 @@ private:
static uint64_t auto_exposure_counter;
- mutable RID_Owner<Environment> environment_owner;
+ mutable RID_Owner<Environment, true> environment_owner;
/* CAMERA EFFECTS */
@@ -835,7 +835,7 @@ private:
float sss_scale = 0.05;
float sss_depth_scale = 0.01;
- mutable RID_Owner<CameraEffects> camera_effects_owner;
+ mutable RID_Owner<CameraEffects, true> camera_effects_owner;
/* RENDER BUFFERS */
@@ -1654,7 +1654,9 @@ public:
RID sdfgi_get_ubo() const { return gi.sdfgi_ubo; }
/* SKY API */
- RID sky_create();
+ virtual RID sky_allocate();
+ virtual void sky_initialize(RID p_rid);
+
void sky_set_radiance_size(RID p_sky, int p_radiance_size);
void sky_set_mode(RID p_sky, RS::SkyMode p_mode);
void sky_set_material(RID p_sky, RID p_material);
@@ -1666,7 +1668,8 @@ public:
/* ENVIRONMENT API */
- RID environment_create();
+ virtual RID environment_allocate();
+ virtual void environment_initialize(RID p_rid);
void environment_set_background(RID p_env, RS::EnvironmentBG p_bg);
void environment_set_sky(RID p_env, RID p_sky);
@@ -1734,7 +1737,8 @@ public:
virtual Ref<Image> environment_bake_panorama(RID p_env, bool p_bake_irradiance, const Size2i &p_size);
- virtual RID camera_effects_create();
+ virtual RID camera_effects_allocate();
+ virtual void camera_effects_initialize(RID p_rid);
virtual void camera_effects_set_dof_blur_quality(RS::DOFBlurQuality p_quality, bool p_use_jitter);
virtual void camera_effects_set_dof_blur_bokeh_shape(RS::DOFBokehShape p_shape);