-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
webgl2: Mesh without triangles panics #16525
Comments
I ran your code on my Windows computer and a panic also occurred. However, it was due to another reason, which is as follows. thread 'Compute Task Pool (7)' panicked at C:\Users\decli\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bevy_render-0.15.0-rc.3\src\mesh\allocator.rs:656:48:
attempt to divide by zero
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic in system `bevy_render::mesh::allocator::allocate_and_free_meshes`! Besides, this panic only occurs in version 0.15.0-rc.3. |
This new mesh allocator panic seems to be from me minimizing the repro excessively. The initial panic I experienced happens when there are some vertex attributes/indices, but they are empty vecs. This new panic happens when there are no vertex attributes or indices at all. I did some additional testing of both scenarios on mac and windows, and edited the PR description with both code snippets I'm using to create the meshes.
Both of these scenarios did not panic in 0.14.2. |
Is this a regression? Should it block 0.15? |
This is a regression and I don't think we should panic in either case. Some considerations:
IMO, this shouldn't block 0.15. |
Bevy version
0.15.0-rc.3
Relevant system information
AdapterInfo { name: "ANGLE (Apple, ANGLE Metal Renderer: Apple M1 Max, Unspecified Version)", vendor: 4203, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "WebGL 2.0 (OpenGL ES 3.0 Chromium)", backend: Gl }
What you did
I experienced this panic in the wild while migrating an app that uses a lot of
Mesh2d
by way ofbevy_prototype_lyon
. It seems that the root cause is creating aLine
with zero length in that plugin.Minimal repro for Bevy 0.15
Bevy 0.14 code tested
The exact type of mesh generated by a zero-length line w/
bevy_prototype_lyon
(same panic)What went wrong
Additional information
This is a silly thing to be trying to do, but it did not panic in Bevy 0.14.
Possibly related to gfx-rs/wgpu#3170 (comment)
webgpu
and native on m1 mac seem to work okay.The text was updated successfully, but these errors were encountered: