Open eero-lehtinen opened 1 month ago
With that fix, are all of the meshes ultimately spawned, or are some of them missing? We should be putting them back into a queue if we can't access the slab allocator there.
With that fix, are all of the meshes ultimately spawned, or are some of them missing? We should be putting them back into a queue if we can't access the slab allocator there.
With the fix a new slab is allocated in the failure case later in the function. The whole function: https://github.com/bevyengine/bevy/blob/e579622a658e2e8f7c729e916c00c9142b08af0d/crates/bevy_render/src/mesh/allocator.rs#L657-L731
All meshes show up correctly. Though I'm not sure if it's somehow less efficient compared to what's intended.
The bug seems to be that in some cases the self.slab_layouts
are not reset after freeing a slab, so we hit the unreachable
.
Got it. Can you open a PR with the draft fix? It'll be easier to examine in that form.
Bevy version
Main (ba09f3547)
MeshAllocator
was added recently in #14257.Relevant system information
What you did
Ran into this issue in my game. Was able to reproduce in a fairly minimal example. After running it for a couple of seconds, it panics.
Below are my logs when running the example code and the example code itself.
Panic Logs
Example Code
Additional information
This change to the problem area seems to fix the issue, but I don't really understand the whole system that well so might be wrong.