From 7a9783737abb3d536f02c997821d64fd2dc16555 Mon Sep 17 00:00:00 2001 From: bitsawer Date: Tue, 18 Jul 2023 12:19:15 +0300 Subject: [PATCH] Fix instance uniform data buffer update delay --- servers/rendering/renderer_scene_cull.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/servers/rendering/renderer_scene_cull.cpp b/servers/rendering/renderer_scene_cull.cpp index c5eabba326c..44b15ee91d3 100644 --- a/servers/rendering/renderer_scene_cull.cpp +++ b/servers/rendering/renderer_scene_cull.cpp @@ -3994,11 +3994,12 @@ void RendererSceneCull::_update_dirty_instance(Instance *p_instance) { } void RendererSceneCull::update_dirty_instances() { - RSG::utilities->update_dirty_resources(); - while (_instance_update_list.first()) { _update_dirty_instance(_instance_update_list.first()->self()); } + + // Update dirty resources after dirty instances as instance updates may affect resources. + RSG::utilities->update_dirty_resources(); } void RendererSceneCull::update() {