diff options
author | reduz <reduzio@gmail.com> | 2021-08-16 14:51:29 -0300 |
---|---|---|
committer | reduz <reduzio@gmail.com> | 2021-08-17 13:52:06 -0300 |
commit | 6027cd0a1dc0726b039a96c8d1b811158464540b (patch) | |
tree | eecea01b7a54ba385a06b83b599263a0cc6db5bf /servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp | |
parent | 72cb4529375de4e3c7511cb7be4ffe8e0103d8ca (diff) |
Fixes to mobile renderer
* Make sure shaders are named, to aid in debug in case of failure
* SceneRenderRD was being wrongly initialized (virtual functions being called when derivative class not initialized).
* Fixed some bugs resulting on the above being corrected.
Diffstat (limited to 'servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp')
-rw-r--r-- | servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp b/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp index 98d08f68e8..098e2a5c87 100644 --- a/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp @@ -2812,8 +2812,6 @@ void RendererSceneGIRD::init(RendererStorageRD *p_storage, RendererSceneSkyRD *p { //kinda complicated to compute the amount of slots, we try to use as many as we can - voxel_gi_max_lights = 32; - voxel_gi_lights = memnew_arr(VoxelGILight, voxel_gi_max_lights); voxel_gi_lights_uniform = RD::get_singleton()->uniform_buffer_create(voxel_gi_max_lights * sizeof(VoxelGILight)); voxel_gi_quality = RS::VoxelGIQuality(CLAMP(int(GLOBAL_GET("rendering/global_illumination/voxel_gi/quality")), 0, 1)); @@ -3009,7 +3007,9 @@ void RendererSceneGIRD::free() { sdfgi_shader.integrate.version_free(sdfgi_shader.integrate_shader); sdfgi_shader.preprocess.version_free(sdfgi_shader.preprocess_shader); - memdelete_arr(voxel_gi_lights); + if (voxel_gi_lights) { + memdelete_arr(voxel_gi_lights); + } } RendererSceneGIRD::SDFGI *RendererSceneGIRD::create_sdfgi(RendererSceneEnvironmentRD *p_env, const Vector3 &p_world_position, uint32_t p_requested_history_size) { |