Skip to content
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

WASM WebGL examples crash "wgpu error: Validation Error" #8047

Closed
heinzelotto opened this issue Mar 11, 2023 · 3 comments · Fixed by #8508
Closed

WASM WebGL examples crash "wgpu error: Validation Error" #8047

heinzelotto opened this issue Mar 11, 2023 · 3 comments · Fixed by #8508
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior O-Web Specific to web (WASM) builds P-Regression Functionality that used to work but no longer does. Add a test for this!

Comments

@heinzelotto
Copy link

Bevy version

0.10.0 (or whichever version is currently used in the bevy WASM examples).

Relevant system information

Android 12 Chrome (v110.0) on pixel 3a, and android 13 Firefox (v110.1) on pixel 4a.

`AdapterInfo { name: "Adreno (TM) 615", vendor: 20803, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Gl }`

What you did

Opened the https://bevyengine.org/examples/3d/3d-scene/

What went wrong

The 3d scene does not load.

Additional information

I am not sure whether the error is in gfx-rs/naga or bevy's usage of it (through gfx-rs/wgpu). The string Assertion failed: false && "Unknown named pointer type or missing metadata" also appears in google/filament#6355 .

My own bevy application that uses PbrBundles also had this problem in the WASM build. Then while looking for a cause I noticed that the example also does not run. Removing all PbrBundles or rolling back to bevy 0.9.1 both cause the error to disappear.

chrome on android console log:

2023-03-11-220834_1152x813_scrot

3d_scene.js:368 INFO crates/bevy_winit/src/system.rs:51 Creating new window "Bevy App" (0v0)
3d_scene.js:368 INFO crates/bevy_render/src/renderer/mod.rs:128 AdapterInfo { name: "Adreno (TM) 615", vendor: 20803, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Gl }
3d_scene.js:1069 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu
(anonymous) @ 3d_scene.js:1069
handleError @ 3d_scene.js:238
imports.wbg.__wbg_newwithcontextoptions_6c6a79a71ed7efa3 @ 3d_scene.js:1068
$web_sys::features::gen_AudioContext::AudioContext::new_with_context_options::ha94b89a135bed2d1 @ 0579948a:0xe75281
$<cpal::host::webaudio::Device as cpal::traits::DeviceTrait>::build_output_stream_raw::hcf4f90d02fcc6b21 @ 0579948a:0x2c8e37
$<cpal::platform::platform_impl::Device as rodio::stream::CpalDeviceExt>::new_output_stream_with_format::ha1c184b5890ab365 @ 0579948a:0x284651
$<cpal::platform::platform_impl::Device as rodio::stream::CpalDeviceExt>::try_new_output_stream_config::h7b6caeb12e8a238d @ 0579948a:0x5a73dc
$rodio::stream::OutputStream::try_from_device_config::hcdb3f909034fc80a @ 0579948a:0x76caad
$rodio::stream::OutputStream::try_default::h5128867b7c029c9b @ 0579948a:0x5478d9
$<T as bevy_ecs::world::FromWorld>::from_world::h407da30cb0f34772 @ 0579948a:0xa94164
$bevy_app::app::App::init_resource::h7afb885464a4de8c @ 0579948a:0x6a672f
$<bevy_audio::AudioPlugin as bevy_app::plugin::Plugin>::build::h7b56af866cce7f92 @ 0579948a:0xe71466
$bevy_app::app::App::add_boxed_plugin::h2210e446ce8b74b4 @ 0579948a:0x3a91fc
$bevy_app::plugin_group::PluginGroupBuilder::finish::hc518d27aa582e36e @ 0579948a:0x52fef9
$_3d_scene::main::hac1f03664ce5a2e6 @ 0579948a:0x2ff921
$std::sys_common::backtrace::__rust_begin_short_backtrace::h7d6950ad3cf8e90f @ 0579948a:0xeef88f
$std::rt::lang_start::{{closure}}::hbac199d3774bc2e9 @ 0579948a:0xe93865
$std::rt::lang_start_internal::h47a582f19b98cc9f @ 0579948a:0xc11383
$main @ 0579948a:0xe8c766
$__wbindgen_start @ 0579948a:0xee7564
finalizeInit @ 3d_scene.js:1847
init @ 3d_scene.js:1879
await in init (async)
(anonymous) @ (index):286
3d_scene.js:1085 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu
(anonymous) @ 3d_scene.js:1085
handleError @ 3d_scene.js:238
imports.wbg.__wbg_resume_72fe7cd3e68b861a @ 3d_scene.js:1084
$web_sys::features::gen_AudioContext::AudioContext::resume::h8f55082cd0d59b8d @ 0579948a:0xe75356
$<cpal::host::webaudio::Stream as cpal::traits::StreamTrait>::play::hd14c42327a9fc2bd @ 0579948a:0x7f20c3
$<cpal::platform::platform_impl::Stream as cpal::traits::StreamTrait>::play::h2cf8e833296a4838 @ 0579948a:0xeeda19
$rodio::stream::OutputStream::try_from_device_config::hcdb3f909034fc80a @ 0579948a:0x76cb83
$rodio::stream::OutputStream::try_default::h5128867b7c029c9b @ 0579948a:0x5478d9
$<T as bevy_ecs::world::FromWorld>::from_world::h407da30cb0f34772 @ 0579948a:0xa94164
$bevy_app::app::App::init_resource::h7afb885464a4de8c @ 0579948a:0x6a672f
$<bevy_audio::AudioPlugin as bevy_app::plugin::Plugin>::build::h7b56af866cce7f92 @ 0579948a:0xe71466
$bevy_app::app::App::add_boxed_plugin::h2210e446ce8b74b4 @ 0579948a:0x3a91fc
$bevy_app::plugin_group::PluginGroupBuilder::finish::hc518d27aa582e36e @ 0579948a:0x52fef9
$_3d_scene::main::hac1f03664ce5a2e6 @ 0579948a:0x2ff921
$std::sys_common::backtrace::__rust_begin_short_backtrace::h7d6950ad3cf8e90f @ 0579948a:0xeef88f
$std::rt::lang_start::{{closure}}::hbac199d3774bc2e9 @ 0579948a:0xe93865
$std::rt::lang_start_internal::h47a582f19b98cc9f @ 0579948a:0xc11383
$main @ 0579948a:0xe8c766
$__wbindgen_start @ 0579948a:0xee7564
finalizeInit @ 3d_scene.js:1847
init @ 3d_scene.js:1879
await in init (async)
(anonymous) @ (index):286
3d_scene.js:368 ERROR  Shader translation error for stage VERTEX | FRAGMENT | VERTEX_FRAGMENT: Assertion failed: false && "Unknown named pointer type or missing metadata"
@heinzelotto heinzelotto added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Mar 11, 2023
@konsti219
Copy link
Contributor

I am also experiencing this issue. I can tell that it was working fine with bevy 0.9.1 but breaks in 0.10.0.

@heinzelotto
Copy link
Author

I just noticed the error tells me to report it to upstream, so I also did that now.

@nicopap nicopap added O-Web Specific to web (WASM) builds P-Regression Functionality that used to work but no longer does. Add a test for this! A-Rendering Drawing game state to the screen and removed S-Needs-Triage This issue needs to be labelled labels Apr 24, 2023
github-merge-queue bot pushed a commit that referenced this issue Jun 29, 2023
# Objective

- This fixes a crash when loading shaders, when running an Adreno GPU
and using WebGL mode.
- Fixes #8506 
- Fixes #8047

## Solution

- The shader pbr_functions.wgsl, will fail in apply_fog function, trying
to access values that are null on Adreno chipsets using WebGL, these
devices are commonly found in android handheld devices.

---------

Co-authored-by: Carter Anderson <[email protected]>
Co-authored-by: François <[email protected]>
@SnowdenWintermute
Copy link

SnowdenWintermute commented Feb 29, 2024

I am getting this now on 0.13.0. In Firefox it works but on Chromium I get:

wgpu error: Validation Error

Caused by:
    In Device::create_render_pipeline
      note: label = `tonemapping pipeline`
    Internal error in ShaderStages(VERTEX) shader: 

I get the error when looking at the examples. When I try to compile my own wasm project it works in 0.12.0 in Chromium but not on 0.13.0.

My CPU:
Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz

My graphics:
NVIDIA NVS 5400M

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-Regression Functionality that used to work but no longer does. Add a test for this!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants