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

Ensure that particles are processed at least once before being used #70418

Merged
merged 1 commit into from
Dec 21, 2022

Conversation

clayjohn
Copy link
Member

Fixes: #56691
Fixes: #59072
Fixes: #65443

The underlying problem in these issues is that the particles were being used for 1 frame before they were ever processed. So for the first frame the particle data came from uninitialized memory. This PR ensures that the particles will be updated at least one before they are drawn.

Oddly enough, these bugs were exposed in #58491. My theory is that prior to #58491 the uninitialized memory looked enough like a normal particle storage buffer that the bug did not surface often.

CC @RandomShaper who helped me debug this earlier today.

@clayjohn clayjohn added this to the 4.0 milestone Dec 21, 2022
@clayjohn clayjohn requested a review from a team as a code owner December 21, 2022 21:18
@akien-mga akien-mga merged commit 29464cb into godotengine:master Dec 21, 2022
@akien-mga
Copy link
Member

Thanks!

@unfa
Copy link

unfa commented Dec 21, 2022

Thank you! This was bugging me for so long :D

@Zireael07
Copy link
Contributor

@unfa: Same here!

@Lippanon
Copy link

Lippanon commented Dec 22, 2022

Thank you for the fixes.

This PR introduced some error spam in my project when loading into a map:
image

I'm not sure yet which scene is causing it, I have some scenes preloaded with GPUParticles but just running them from the editor individually doesn't seem to output errors.

EDIT: Fixed by #70457

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment