gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.
https://wgpu.rs
Apache License 2.0
12.79k stars 938 forks source link

Assertion failed: false && "Unknown named pointer type or missing metadata" #4487

Open heinzelotto opened 1 year ago

heinzelotto commented 1 year ago

Hi, this is an error I received while trying to run the bevy 0.10.0 WASM examples on a pixel 4a as well as a pixel 3a (both with firefox mobile and chrome). See also the downstream issue I created first: https://github.com/bevyengine/bevy/issues/8047

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, the error reported seems to be related to shader translation

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"
teoxoy commented 1 year ago

Looks like a shader compiler bug that could be worked around.

At least some adreno compilers don't like returning an element of a UBO array that is a structure in the vertex shader. To work this around we have to copy the each of the structure fields.

from https://github.com/google/filament/pull/6383