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

Pipeline/shader race-condition-during-shutdown crash fix #18183

Merged
merged 3 commits into from Sep 20, 2023

Conversation

hrydgard
Copy link
Owner

If you exit the game while shaders are still compiling, we could end up in a situation where we cleared the shader cache while pipeline creation (using said shaders) was still going on on the worker pool, especially on Android where pipeline creation can be notoriously slow.

Now, kill the pipeline cache first, and while doing so, block the shutdown process until all pending shaders are finished compiling.

Potentially if many are queued we could add a cancelling facility, but likely not worth the trouble.

These crashes weren't too damaging to the play experience since they don't happen while you're actually playing, only when leaving the game, but this pollutes the Google Play crash logs, and the app exiting when you exit a game is a bit unexpected.

Also, sneak in a leak fix on image view creation failure, although very likely very obscure. I have seen a crash that seems connected though.

@hrydgard hrydgard added this to the v1.16.3 milestone Sep 20, 2023
@hrydgard hrydgard merged commit 01c3c36 into master Sep 20, 2023
18 checks passed
@hrydgard hrydgard deleted the shader-race-condition-fix branch September 20, 2023 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant