Skip to content

When using 2D and 3D cameras, moving the 2D UI camera to a nondefault render layer causes a crash on Wasm #19167

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

Open
janhohenheim opened this issue May 10, 2025 · 0 comments
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior O-Web Specific to web (WASM) builds P-Crash A sudden unexpected crash

Comments

@janhohenheim
Copy link
Member

janhohenheim commented May 10, 2025

Bevy version

0.16.0

Relevant system information

AdapterInfo { name: "AMD Radeon RX 7900 XTX (RADV NAVI31)", vendor: 4098, device: 29772, device_type: DiscreteGpu, driver: "radv", driver_info: "Mesa 25.0.3", backend: Vulkan }

What you did

See #19166 for the exact setup.

What went wrong

On Wasm, when reloading the game multiple times and running around the spotlights, I sometimes get

panicked at /home/hhh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bevy_render-0.16.0/src/render_phase/mod.rs:779:40:
index out of bounds: the len is 0 but the index is 0

The offending line is https://github.com/bevyengine/bevy/blob/v0.16.0/crates/bevy_render/src/render_phase/mod.rs#L779

UnbatchableBinnedEntityIndexSet::Dense(dynamic_offsets) => {
    dynamic_offsets[entity_index].clone()
}

Additional information

You can see this for yourself by cloning https://github.com/janhohenheim/foxtrot/tree/nondefault-ui-cam (note the branch), running bevy run web, and running a bit around.
If it does not happen, refresh the page or reload the level by pressing Escape and try again.
On my Firefox on Fedora, I get the crash in about 1:8 tries.
Note that the crash is not instant, but happens after walking around the light for about 10 seconds

@janhohenheim janhohenheim added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled A-Rendering Drawing game state to the screen P-Crash A sudden unexpected crash O-Web Specific to web (WASM) builds and removed S-Needs-Triage This issue needs to be labelled labels May 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior O-Web Specific to web (WASM) builds P-Crash A sudden unexpected crash
Projects
None yet
Development

No branches or pull requests

1 participant