Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OpenGL _shadow_atlas_find_shadow error when light instance is freed #90233

Merged
merged 1 commit into from
Apr 5, 2024

Conversation

Arthas92t
Copy link
Contributor

@Arthas92t Arthas92t commented Apr 5, 2024

In file light_storage.cpp, when engine free a light instance, it didn't free the shadow atlas and set owner of it to RID().
https://github.com/godotengine/godot/blob/master/drivers/gles3/storage/light_storage.cpp#L366-L384
So the next time engine try to find a useable shadow atlas, it will have this issue
I think we can just ignore the case sli == null and return the shadow atlas when we meet it, since the light instance of that atlas already freed

@Arthas92t Arthas92t requested a review from a team as a code owner April 5, 2024 00:32
Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I left a small comment to clean up a line we don't need. Otherwise this looks great

drivers/gles3/storage/light_storage.cpp Outdated Show resolved Hide resolved
@clayjohn clayjohn added this to the 4.3 milestone Apr 5, 2024
@clayjohn clayjohn added the cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release label Apr 5, 2024
@Arthas92t
Copy link
Contributor Author

Looks great! I left a small comment to clean up a line we don't need. Otherwise this looks great

Thank you, you was right. I removed that line.

Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thank you!

@akien-mga akien-mga changed the title Fix OpenGL: _shadow_atlas_find_shadow: Condition "!sli" is true. Fix OpenGL: _shadow_atlas_find_shadow error when light instance is freed Apr 5, 2024
@akien-mga akien-mga changed the title Fix OpenGL: _shadow_atlas_find_shadow error when light instance is freed Fix OpenGL _shadow_atlas_find_shadow error when light instance is freed Apr 5, 2024
@akien-mga akien-mga merged commit 6a64e5a into godotengine:master Apr 5, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks! And congrats for your first merged Godot contribution 🎉

@akien-mga
Copy link
Member

Cherry-picked for 4.2.2.

@akien-mga akien-mga added topic:rendering and removed cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release topic:3d labels Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenGL: _shadow_atlas_find_shadow: Condition "!sli" is true. Continuing.
3 participants