bytestring-net / bevy_lunex

Blazingly fast path based retained layout engine for Bevy entities, built around vanilla Bevy ECS.
https://bytestring-net.github.io/bevy_lunex/
Apache License 2.0
597 stars 24 forks source link

Worldspace example in wasm leads to https://github.com/gfx-rs/wgpu/issues/4430 #68

Closed feefladder closed 2 months ago

feefladder commented 2 months ago

So running the worldspace example leads to an in gfx-rs/wgpu#4430: ERROR app: Shader compilation failed: ERROR: 0:? : '' : Total size of declared private variables exceeds implementation-defined limit

Now, I'm pretty new to bevy, so couldn't dig that deep into the error. Still posting here, since I think it could be worked around using the same techniques as used in that issue?

``` ERROR app: Shader compilation failed: ERROR: 0:? : '' : Total size of declared private variables exceeds implementation-defined limit log.target = "wgpu_hal::gles::device"; log.module_path = "wgpu_hal::gles::device"; log.file = "/home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.21.1/src/gles/device.rs"; log.line = 200; ERROR app: Device::create_render_pipeline error: Internal error in ShaderStages(VERTEX) shader: ERROR: 0:? : '' : Total size of declared private variables exceeds implementation-defined limit log.target = "wgpu_core::device::global"; log.module_path = "wgpu_core::device::global"; log.file = "/home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-0.21.1/src/device/global.rs"; log.line = 1636; ERROR app: Shader translation error for stage ShaderStages(VERTEX): ERROR: 0:? : '' : Total size of declared private variables exceeds implementation-defined limit log.target = "wgpu::backend::wgpu_core"; log.module_path = "wgpu::backend::wgpu_core"; log.file = "/home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.20.1/src/backend/wgpu_core.rs"; log.line = 1179; ERROR app: Please report it to https://github.com/gfx-rs/wgpu log.target = "wgpu::backend::wgpu_core"; log.module_path = "wgpu::backend::wgpu_core"; log.file = "/home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.20.1/src/backend/wgpu_core.rs"; log.line = 1180; ERROR app: Handling wgpu errors as fatal by default log.target = "wgpu::backend::wgpu_core"; log.module_path = "wgpu::backend::wgpu_core"; log.file = "/home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.20.1/src/backend/wgpu_core.rs"; log.line = 2995; ERROR app: panicked at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.20.1/src/backend/wgpu_core.rs:2996:5: wgpu error: Validation Error Caused by: In Device::create_render_pipeline note: label = `pbr_opaque_mesh_pipeline` Internal error in ShaderStages(VERTEX) shader: ERROR: 0:? : '' : Total size of declared private variables exceeds implementation-defined limit Stack: __wbg_get_imports/imports.wbg.__wbg_new_abda76e883ba8a5f@http://localhost:1334/api/wasm.js:1838:13 worldspace-bd0835878d81e267.wasm.__wbg_new_abda76e883ba8a5f externref shim@http://localhost:1334/api/wasm.wasm:wasm-function[77225]:0x2483167 worldspace-bd0835878d81e267.wasm.console_error_panic_hook::hook::hbf518fbec45f29e5@http://localhost:1334/api/wasm.wasm:wasm-function[11700]:0x169413c worldspace-bd0835878d81e267.wasm.core::ops::function::Fn::call::hc61125be7e31a56d@http://localhost:1334/api/wasm.wasm:wasm-function[112509]:0x2528475 worldspace-bd0835878d81e267.wasm.std::panicking::rust_panic_with_hook::h47bd3d747ed79dc3@http://localhost:1334/api/wasm.wasm:wasm-function[36061]:0x20c3abe worldspace-bd0835878d81e267.wasm.std::panicking::begin_panic_handler::{{closure}}::hec06b0d4affd51e6@http://localhost:1334/api/wasm.wasm:wasm-function[42911]:0x2225ae9 worldspace-bd0835878d81e267.wasm.std::sys_common::backtrace::__rust_end_short_backtrace::h36214b32c979e4c1@http://localhost:1334/api/wasm.wasm:wasm-function[110114]:0x2523307 worldspace-bd0835878d81e267.wasm.rust_begin_unwind@http://localhost:1334/api/wasm.wasm:wasm-function[57429]:0x23c21c1 worldspace-bd0835878d81e267.wasm.core::panicking::panic_fmt::hb859252f4b513814@http://localhost:1334/api/wasm.wasm:wasm-function[59017]:0x23dbead worldspace-bd0835878d81e267.wasm.core::ops::function::Fn::call::h4381d3db4867d47f@http://localhost:1334/api/wasm.wasm:wasm-function[35489]:0x20a0977 worldspace-bd0835878d81e267.wasm.::device_create_render_pipeline::h4f158307dc25312a@http://localhost:1334/api/wasm.wasm:wasm-function[1160]:0x5da9fd worldspace-bd0835878d81e267.wasm.::device_create_render_pipeline::h39adcf4893fca0bc@http://localhost:1334/api/wasm.wasm:wasm-function[44409]:0x2262b66 worldspace-bd0835878d81e267.wasm.wgpu::Device::create_render_pipeline::h0ce8813d2d0c2cdf@http://localhost:1334/api/wasm.wasm:wasm-function[42450]:0x2210a20 worldspace-bd0835878d81e267.wasm.futures_lite::future::block_on::h18f98d991c31a724@http://localhost:1334/api/wasm.wasm:wasm-function[715]:0x34f0f8 worldspace-bd0835878d81e267.wasm.bevy_render::render_resource::pipeline_cache::PipelineCache::process_queue::h9bfff09ab1b29236@http://localhost:1334/api/wasm.wasm:wasm-function[674]:0x3060f1 worldspace-bd0835878d81e267.wasm. as bevy_ecs::system::system::System>::run_unsafe::h7f88ab2ca7411184@http://localhost:1334/api/wasm.wasm:wasm-function[49251]:0x2304d37 worldspace-bd0835878d81e267.wasm.bevy_ecs::schedule::executor::__rust_begin_short_backtrace::run_unsafe::h87a29d5bf206f6a6@http://localhost:1334/api/wasm.wasm:wasm-function[104505]:0x2512a7e worldspace-bd0835878d81e267.wasm.::run::hef1553f49be40b72@http://localhost:1334/api/wasm.wasm:wasm-function[3411]:0xce9855 worldspace-bd0835878d81e267.wasm.bevy_ecs::schedule::schedule::Schedule::run::hdfcd0e56e707ac9a@http://localhost:1334/api/wasm.wasm:wasm-function[32502]:0x1fe77a9 worldspace-bd0835878d81e267.wasm.bevy_ecs::world::World::schedule_scope::hd413fcf7247a320a@http://localhost:1334/api/wasm.wasm:wasm-function[5032]:0xfa28b5 worldspace-bd0835878d81e267.wasm.bevy_app::sub_app::SubApps::update::h6b87a07e33f70d4b@http://localhost:1334/api/wasm.wasm:wasm-function[17811]:0x1a75c23 worldspace-bd0835878d81e267.wasm.bevy_app::app::App::update::h067d7a44f42481da@http://localhost:1334/api/wasm.wasm:wasm-function[24480]:0x1d5c92a worldspace-bd0835878d81e267.wasm. as winit::application::ApplicationHandler>::about_to_wait::hfdea16164f1ca510@http://localhost:1334/api/wasm.wasm:wasm-function[655]:0x2dfe88 worldspace-bd0835878d81e267.wasm.winit::platform_impl::web::event_loop::EventLoop::run::{{closure}}::hab029b0da517473f@http://localhost:1334/api/wasm.wasm:wasm-function[15494]:0x193425b worldspace-bd0835878d81e267.wasm.winit::platform_impl::web::event_loop::runner::Shared::handle_event::h9878f3077d1a51e9@http://localhost:1334/api/wasm.wasm:wasm-function[5635]:0x10756e4 worldspace-bd0835878d81e267.wasm.winit::platform_impl::web::event_loop::runner::Shared::request_redraw::hcb5c7e0e7d70a6c0@http://localhost:1334/api/wasm.wasm:wasm-function[9587]:0x14cbc0f worldspace-bd0835878d81e267.wasm.winit::platform_impl::web::web_sys::animation_frame::AnimationFrameHandler::on_animation_frame::{{closure}}::hdda0f970964498db@http://localhost:1334/api/wasm.wasm:wasm-function[67356]:0x24400f1 worldspace-bd0835878d81e267.wasm.+Output = R as wasm_bindgen::closure::WasmClosure>::describe::invoke::hf8bd0ec7b73d710d@http://localhost:1334/api/wasm.wasm:wasm-function[66691]:0x243ac63 __wbg_adapter_43@http://localhost:1334/api/wasm.js:191:6 real@http://localhost:1334/api/wasm.js:172:32 ```
IDEDARY commented 2 months ago

Unfortunately, this has nothing to do with the library. Lunex does not touch any rendering code, it just works with everyday Bevy components. Nothing fancy. It just so happens that the example triggers Bevy rendering/WGPU bug on your machine.