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

Avoid allocating instance buffer for PointLight2D shadows when there are no instances #100612

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

clayjohn
Copy link
Member

Fixes: #100609

The problem arises when shadows are enabled, but there are no occluders. The shadow rendering path tries to allocate a zero sized buffer which isn't allowed. The solution is to just not allocate the buffer when there are zero instances. That necessitates also skipping the render loop since we can't bind a buffer that doesn't exist. We still have to create the render pass though to clear the shadow atlas.

…are no instances.

Also avoid the render loop if there are no occluders. We still have to open the render pass to do a clear though.
@Repiteo Repiteo merged commit 9018d4b into godotengine:master Dec 20, 2024
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Dec 20, 2024

Thanks!

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.

PointLight2D shadow buffer error
3 participants