bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
36.67k stars 3.61k forks source link

WASM example from the website crashes on Windows machine #9317

Open sdkfile opened 1 year ago

sdkfile commented 1 year ago

Bevy version

0.11, since webgpu has been served from 0.11.

Relevant system information

OS & Browser info: Windows 11 Home, Chrome Version 115.0.5790.110 Processor & GPU info: AMD Ryzen Z1 Extreme (I'm using ROG Ally)

If your bug is rendering-related, copy the adapter info that appears when you run Bevy.

AdapterInfo { name: "", vendor: 0, device: 0, device_type: Other, driver: "", driver_info: "", backend: BrowserWebGpu }

What you did

I loaded Update glTF Scene example from the website, in WebGPU

What went wrong

It is expected to show the usual example that disassembles the model and reassembles again, but the browser froze for a minute and gave the error below

wasm_example.js:852 Uncaught RangeError: Failed to execute 'createBuffer' on 'GPUDevice': createBuffer failed, size is too large for the implementation when mappedAtCreation == true
    at imports.wbg.__wbg_createBuffer_36e159f52cc644a7 (wasm_example.js:852:37)
    at 03e11766:0xa49866
    at 03e11766:0x5320ca
    at 03e11766:0xa3d188
    at 03e11766:0x2e9d37
    at 03e11766:0x535cd0
    at 03e11766:0x3aa435
    at 03e11766:0xa1d23d
    at 03e11766:0x5ff957
    at 03e11766:0x9dbe08

Additional information

Screenshot

image

Theories about what might be going wrong

I think this is due to some bugs from bevy because the examples from webgpu github repo was fine.

Detailed log and screenshot by building the example locally

Uncaught RangeError: Failed to execute 'createBuffer' on 'GPUDevice': createBuffer failed, size is too large for the implementation when mappedAtCreation == true
    at imports.wbg.__wbg_createBuffer_36e159f52cc644a7 (wasm_example.js:742:37)
    at web_sys::features::gen_GpuDevice::GpuDevice::create_buffer::he3f415a7e1a5aed5 (wasm_example_bg.wasm:0x122a853)
    at <T as wgpu::context::DynContext>::device_create_buffer::h81085d0d7ccf61fc (wasm_example_bg.wasm:0x106815b)
    at <wgpu::Device as wgpu::util::device::DeviceExt>::create_buffer_init::hca4d931f8732d83f (wasm_example_bg.wasm:0x74818a)
    at bevy_render::renderer::render_device::RenderDevice::create_buffer_with_data::h646822324f1f3da0 (wasm_example_bg.wasm:0x101b133)
    at bevy_render::render_resource::storage_buffer::StorageBuffer<T>::write_buffer::h028d05298825b440 (wasm_example_bg.wasm:0xea3eb6)
    at bevy_pbr::render::light::prepare_clusters::h8059070cef1d3ed0 (wasm_example_bg.wasm:0x37f755)
    at bevy_ecs::system::system::System::run::h8d898f852405ff18 (wasm_example_bg.wasm:0x6fec75)
    at <bevy_ecs::schedule::executor::single_threaded::SingleThreadedExecutor as bevy_ecs::schedule::executor::SystemExecutor>::run::h358834e4ef55f76c (wasm_example_bg.wasm:0x45a53f)
    at bevy_ecs::schedule::schedule::Schedule::run::hb408ec093979fbcb (wasm_example_bg.wasm:0xfed2a9)

image

sdkfile commented 1 year ago

This also happened on the Windows machines with specs followed

JasonPeng1993 commented 1 year ago

I got a similar issue, although there was no crash, when I opened the webgpu example, the entire browser would get stuck for a while. Here is my environmental information:

Operating system: windows10

CPU: AMD Ryzen 9 7950X

Gpu: nVidia RTX4070

Browser: chrome 115.0.5790.171