Skip to content

Commit 6a64e5a

Browse files
committed
Merge pull request godotengine#90233 from Arthas92t/master
Fix OpenGL `_shadow_atlas_find_shadow` error when light instance is freed
2 parents 4d20840 + 17e489b commit 6a64e5a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/gles3/storage/light_storage.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,11 @@ bool LightStorage::_shadow_atlas_find_shadow(ShadowAtlas *shadow_atlas, int *p_i
10641064

10651065
for (int j = 0; j < sc; j++) {
10661066
LightInstance *sli = light_instance_owner.get_or_null(sarr[j].owner);
1067-
ERR_CONTINUE(!sli);
1067+
if (!sli) {
1068+
// Found a released light instance.
1069+
found_used_idx = j;
1070+
break;
1071+
}
10681072

10691073
if (sli->last_scene_pass != RasterizerSceneGLES3::get_singleton()->get_scene_pass()) {
10701074
// Was just allocated, don't kill it so soon, wait a bit.

0 commit comments

Comments
 (0)