SDFGI: fix crash if update_data is nullptr

This commit is contained in:
Garteal 2024-07-19 14:10:10 +02:00
parent 293c0f7646
commit 2606831d71
2 changed files with 8 additions and 0 deletions

View File

@ -1790,6 +1790,10 @@ void GI::SDFGI::debug_probes(RID p_framebuffer, const uint32_t p_view_count, con
} }
void GI::SDFGI::pre_process_gi(const Transform3D &p_transform, RenderDataRD *p_render_data) { void GI::SDFGI::pre_process_gi(const Transform3D &p_transform, RenderDataRD *p_render_data) {
if (p_render_data->sdfgi_update_data == nullptr) {
return;
}
RendererRD::LightStorage *light_storage = RendererRD::LightStorage::get_singleton(); RendererRD::LightStorage *light_storage = RendererRD::LightStorage::get_singleton();
/* Update general SDFGI Buffer */ /* Update general SDFGI Buffer */

View File

@ -1126,6 +1126,10 @@ void RenderForwardClustered::_setup_lightmaps(const RenderDataRD *p_render_data,
/* SDFGI */ /* SDFGI */
void RenderForwardClustered::_update_sdfgi(RenderDataRD *p_render_data) { void RenderForwardClustered::_update_sdfgi(RenderDataRD *p_render_data) {
if (p_render_data->sdfgi_update_data == nullptr) {
return;
}
Ref<RenderSceneBuffersRD> rb; Ref<RenderSceneBuffersRD> rb;
if (p_render_data && p_render_data->render_buffers.is_valid()) { if (p_render_data && p_render_data->render_buffers.is_valid()) {
rb = p_render_data->render_buffers; rb = p_render_data->render_buffers;