Fix OpenGL: _shadow_atlas_find_shadow: Condition "!sli" is true.

(cherry picked from commit 17e489b93d)
This commit is contained in:
ArthasMenethil 2024-04-05 07:19:17 +07:00 committed by Rémi Verschelde
parent 96303ab81e
commit 28abd259f7
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 5 additions and 1 deletions

View File

@ -951,7 +951,11 @@ bool LightStorage::_shadow_atlas_find_shadow(ShadowAtlas *shadow_atlas, int *p_i
for (int j = 0; j < sc; j++) {
LightInstance *sli = light_instance_owner.get_or_null(sarr[j].owner);
ERR_CONTINUE(!sli);
if (!sli) {
// Found a released light instance.
found_used_idx = j;
break;
}
if (sli->last_scene_pass != RasterizerSceneGLES3::get_singleton()->get_scene_pass()) {
// Was just allocated, don't kill it so soon, wait a bit.