mrk-its / bevy_webgl2

WebGL2 renderer plugin for Bevy game engine
MIT License
172 stars 46 forks source link

White Screen Panic on Safari 14.0.1 iOS 14.2.1 #14

Closed indiv0 closed 3 years ago

indiv0 commented 3 years ago

User-agent: Mozilla/5.0 (iPhone; CPU iPhone OS 14_2_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Mobile/15E148 Safari/604.1 bevy_webgl2 version: https://github.com/indiv0/bevy_webgl2/tree/a53c9ca296a46019d833da9be6f69f099ac63159 bevy version: https://github.com/bevyengine/bevy/tree/2e2423139e0cd8efda3aa0d474d3eb231dad566b Example source: https://github.com/indiv0/colonize/tree/75ee66f710a4b9444a4b2119f27422e6fdeb3723 Example compilation args:

cargo build --target wasm32-unknown-unknown --no-default-features --features wasm
wasm-bindgen --out-dir target --target web target/wasm32-unknown-unknown/debug/colonize.wasm
wasm-opt --debuginfo -Oz target/colonize_bg.wasm -o target/colonize_bg_opt.wasm
sed -i 's/_bg\.wasm/_bg_opt\.wasm/g' target/colonize.js

Example demo: https://dev.colonize.rs/ rustc version: rustc 1.50.0-nightly (f0f68778f 2020-12-09)

Hello! I'm trying to get my little voxel demo running on Safari on my iPhone, but all I'm seeing is a white screen. These are the two error logs I'm seeing in the console:

colonize.js:353 panicked at 'called `Option::unwrap()` on a `None` value', /home/indiv0/.cargo/git/checkouts/bevy_webgl2-35250a857a3fcf31/a53c9ca/src/renderer/webgl2_render_resource_context.rs:97:14

Stack:

https://dev.colonize.rs/target/colonize.js:340:28
wasm-stub@[wasm code]
<?>.wasm-function[console_error_panic_hook::hook::hc8d5a98bcd201a39]@[wasm code]
<?>.wasm-function[core::ops::function::Fn::call::h3a520772681b692a]@[wasm code]
<?>.wasm-function[std::panicking::rust_panic_with_hook::h7ba07724d623fbd6]@[wasm code]
<?>.wasm-function[std::panicking::begin_panic_handler::{{closure}}::hf841a66ae6cb12c2]@[wasm code]
<?>.wasm-function[std::sys_common::backtrace::__rust_end_short_backtrace::h1aceb706833fcda2]@[wasm code]
<?>.wasm-function[rust_begin_unwind]@[wasm code]
<?>.wasm-function[core::panicking::panic_fmt::h125c8438143be5c3]@[wasm code]
<?>.wasm-function[core::panicking::panic::heade1ff345fea9ee]@[wasm code]
<?>.wasm-function[bevy_webgl2::renderer::webgl2_render_resource_context::WebGL2RenderResourceContext::initialize::ha3ac448d6c7c24b1]@[wasm code]
<?>.wasm-function[bevy_ecs::system::into_thread_local::<impl bevy_ecs::system::into_system::IntoSystem<(&mut bevy_ecs::core::world::World,&mut bevy_ecs::resource::resources::Resources),bevy_ecs::system::into_thread_local::ThreadLocalSystemFn> for F>::system::{{closure}}::h1409f7ef8aeb77d5]@[wasm code]
<?>.wasm-function[<bevy_ecs::system::into_thread_local::ThreadLocalSystemFn as bevy_ecs::system::system::System>::run_thread_local::h66d19defcf4ac825]@[wasm code]
<?>.wasm-function[<bevy_ecs::schedule::stage_executor::ParallelSystemStageExecutor as bevy_ecs::schedule::stage_executor::SystemStageExecutor>::execute_stage::h19c518754b474e51]@[wasm code]
<?>.wasm-function[<bevy_ecs::schedule::stage::SystemStage as bevy_ecs::schedule::stage::Stage>::run::ha482b36f9d8fd659]@[wasm code]
<?>.wasm-function[<bevy_ecs::schedule::Schedule as bevy_ecs::schedule::stage::Stage>::run::h46d0126e783dceb8]@[wasm code]
<?>.wasm-function[bevy_ecs::schedule::Schedule::initialize_and_run::h640e873cc53daab8]@[wasm code]
<?>.wasm-function[winit::platform_impl::platform::event_loop::EventLoop<T>::run::{{closure}}::h9c6289f041abba57]@[wasm code]
<?>.wasm-function[winit::platform_impl::platform::event_loop::runner::Shared<T>::handle_event::he1ae5c97e87f3cc2]@[wasm code]
<?>.wasm-function[winit::platform_impl::platform::event_loop::runner::Shared<T>::run_until_cleared::hdf6a9e2c1eddd23a]@[wasm code]
<?>.wasm-function[winit::platform_impl::platform::event_loop::runner::Shared<T>::set_listener::h68fd5ec39c25b8cb]@[wasm code]
<?>.wasm-function[winit::platform_impl::platform::event_loop::window_target::WindowTarget<T>::run::h3ecec7a408ed3963]@[wasm code]
<?>.wasm-function[winit::platform_impl::platform::event_loop::EventLoop<T>::run::hfae39a3100b437f3]@[wasm code]
<?>.wasm-function[bevy_winit::winit_runner::h0bcb21bb1ddfac59]@[wasm code]
<?>.wasm-function[core::ops::function::Fn::call::h1b29df3455b46949]@[wasm code]
<?>.wasm-function[bevy_app::app_builder::AppBuilder::run::h37e056c5fdfb003c]@[wasm code]
<?>.wasm-function[colonize::main::ha827ff1ad819c552]@[wasm code]
<?>.wasm-function[std::rt::lang_start::{{closure}}::h00c8646e66105f2b]@[wasm code]
<?>.wasm-function[std::rt::lang_start_internal::he20668ad5870f3e0]@[wasm code]
<?>.wasm-function[main]@[wasm code]
<?>.wasm-function[13174]@[wasm code]
wasm-stub@[wasm code]
__wbindgen_start@[native code]
https://dev.colonize.rs/target/colonize.js:987:26
asyncFunctionResume@[native code]
[native code]
promiseReactionJobWithoutPromise@[native code]
promiseReactionJob@[native code]
Unhandled Promise Rejection: RuntimeError: Unreachable code should not be executed (evaluating 'wasm.__wbindgen_start()')
mockersf commented 3 years ago

WebGL2 need to be enabled on Safari on iOS, it's in "Settings > Safari > Advanced > Experimental Features"

You can check https://caniuse.com/webgl2 for browser support

indiv0 commented 3 years ago

:facepalm: yeah that fixed it. Thanks!