bevyengine / bevy

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

Running shader_defs example causing error #803

Closed chaoticgood1 closed 3 years ago

chaoticgood1 commented 3 years ago

Bevy version

0.3.0

Operating system & version

Ubuntu 18.04

What you did

Run on terminal

cargo run --example shader_defs

What you expected to happen

Should show a working bevy program

What actually happened

Shows log errors on terminal

Additional information

thread 'Compute Task Pool (1)' panicked at 'called `Result::unwrap()` on an `Err` value: "glslang_shader_preprocess:\nInfo log:\nERROR: 0:2: \'#version\' : bad profile name; use es, core, or compatibility \nERROR: 0:2: \'#version\' : bad tokens following profile -- expected newline \nERROR: 2 compilation errors.  No code generated.\n\n\nDebug log:\n\n"', crates/bevy_render/src/shader/shader.rs:31:73
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'Compute Task Pool (0)' panicked at 'task has failed', /home/nickan/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.0.2/src/task.rs:368:45
thread 'main' panicked at 'task has failed', /home/nickan/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.0.2/src/task.rs:368:45
thread 'main' panicked at 'task thread panicked while executing: Any', crates/bevy_tasks/src/task_pool.rs:75:18
stack backtrace:
   0:     0x55903aa91e40 - std::backtrace_rs::backtrace::libunwind::trace::ha1eabb142084ea37
                               at /rustc/de521cbb303c08febd9fa3755caccd4f3e491ea3/library/std/src/../../backtrace/src/backtrace/libunwind.rs:96
   1:     0x55903aa91e40 - std::backtrace_rs::backtrace::trace_unsynchronized::hbb8825661d997281
                               at /rustc/de521cbb303c08febd9fa3755caccd4f3e491ea3/library/std/src/../../backtrace/src/backtrace/mod.rs:66
   2:     0x55903aa91e40 - std::sys_common::backtrace::_print_fmt::h26d850e2f7183914
                               at /rustc/de521cbb303c08febd9fa3755caccd4f3e491ea3/library/std/src/sys_common/backtrace.rs:79
   3:     0x55903aa91e40 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h3834b06f68a2b012
                               at /rustc/de521cbb303c08febd9fa3755caccd4f3e491ea3/library/std/src/sys_common/backtrace.rs:58
   4:     0x55903aab4a0c - core::fmt::write::h3a043650ba7bf668
                               at /rustc/de521cbb303c08febd9fa3755caccd4f3e491ea3/library/core/src/fmt/mod.rs:1117
   5:     0x55903aa8ecc7 - std::io::Write::write_fmt::h9c0c8944a1898139
                               at /rustc/de521cbb303c08febd9fa3755caccd4f3e491ea3/library/std/src/io/mod.rs:1514
   6:     0x55903aa94230 - std::sys_common::backtrace::_print::h693c0c2cc41d4d10
                               at /rustc/de521cbb303c08febd9fa3755caccd4f3e491ea3/library/std/src/sys_common/backtrace.rs:61
   7:     0x55903aa94230 - std::sys_common::backtrace::print::h213be73e5670b8ea
                               at /rustc/de521cbb303c08febd9fa3755caccd4f3e491ea3/library/std/src/sys_common/backtrace.rs:48
   8:     0x55903aa94230 - std::panicking::default_hook::{{closure}}::h2d49a3361cc4e7ea
                               at /rustc/de521cbb303c08febd9fa3755caccd4f3e491ea3/library/std/src/panicking.rs:200
   9:     0x55903aa93f7c - std::panicking::default_hook::hd41fbdeba93207ba
                               at /rustc/de521cbb303c08febd9fa3755caccd4f3e491ea3/library/std/src/panicking.rs:219
  10:     0x55903aa94893 - std::panicking::rust_panic_with_hook::hcab398664b4bd473
                               at /rustc/de521cbb303c08febd9fa3755caccd4f3e491ea3/library/std/src/panicking.rs:569
  11:     0x55903aa94469 - std::panicking::begin_panic_handler::{{closure}}::h7512c6f2998ba93d
                               at /rustc/de521cbb303c08febd9fa3755caccd4f3e491ea3/library/std/src/panicking.rs:476
  12:     0x55903aa922ac - std::sys_common::backtrace::__rust_end_short_backtrace::h1a25d7e7e1864d3d
                               at /rustc/de521cbb303c08febd9fa3755caccd4f3e491ea3/library/std/src/sys_common/backtrace.rs:153
  13:     0x55903aa94429 - rust_begin_unwind
                               at /rustc/de521cbb303c08febd9fa3755caccd4f3e491ea3/library/std/src/panicking.rs:475
  14:     0x55903aab25c1 - core::panicking::panic_fmt::h019ad16a92ccd092
                               at /rustc/de521cbb303c08febd9fa3755caccd4f3e491ea3/library/core/src/panicking.rs:85
  15:     0x55903aab23e3 - core::option::expect_none_failed::h7135ba2fdb185931
                               at /rustc/de521cbb303c08febd9fa3755caccd4f3e491ea3/library/core/src/option.rs:1221
  16:     0x55903a9e8a96 - core::result::Result<T,E>::expect::hc30ba2eef40ba2da
                               at /home/nickan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:933
  17:     0x55903a9ef048 - <bevy_tasks::task_pool::TaskPoolInner as core::ops::drop::Drop>::drop::h68432b731204f476
                               at /home/nickan/gamedev/src/dependencies/bevy/crates/bevy_tasks/src/task_pool.rs:73
  18:     0x55903a9ed546 - core::ptr::drop_in_place::h5919ae684192bb7e
                               at /home/nickan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:184
  19:     0x55903a95d644 - alloc::sync::Arc<T>::drop_slow::hb5a7aeb811e861f4
                               at /home/nickan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:840
  20:     0x55903a92c9e6 - <alloc::sync::Arc<T> as core::ops::drop::Drop>::drop::hd4b3a75befbd55d0
                               at /home/nickan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:1360
  21:     0x55903a92b1ef - core::ptr::drop_in_place::h530605b5ff31555b
                               at /home/nickan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:184
  22:     0x55903a92a721 - core::ptr::drop_in_place::h0d0cff5458fad700
                               at /home/nickan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:184
  23:     0x55903a92b5cf - core::ptr::drop_in_place::h71f4ca4b1dcd3c82
                               at /home/nickan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:184
  24:     0x55903a9669db - core::ptr::mut_ptr::<impl *mut T>::drop_in_place::h91a4350f278aba41
                               at /home/nickan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mut_ptr.rs:1000
  25:     0x55903a96297f - bevy_hecs::archetype::TypeInfo::of::drop_ptr::hb6cf1cc33e64159b
                               at /home/nickan/gamedev/src/dependencies/bevy/crates/bevy_ecs/hecs/src/archetype.rs:493
  26:     0x55903aa563d9 - bevy_hecs::archetype::Archetype::clear::hea64c9c4ee0e49d8
                               at /home/nickan/gamedev/src/dependencies/bevy/crates/bevy_ecs/hecs/src/archetype.rs:88
  27:     0x55903aa4c8e3 - <bevy_hecs::archetype::Archetype as core::ops::drop::Drop>::drop::h19a441ae795c60b8
                               at /home/nickan/gamedev/src/dependencies/bevy/crates/bevy_ecs/hecs/src/archetype.rs:424
  28:     0x55903aa4b446 - core::ptr::drop_in_place::h5bba8cb4f25ca77f
                               at /home/nickan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:184
  29:     0x55903a92b116 - core::ptr::drop_in_place::h480416146c233f4f
                               at /home/nickan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:184
  30:     0x55903a92ab16 - core::ptr::drop_in_place::h2511c21fb94ca818
                               at /home/nickan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:184
  31:     0x55903a94201b - core::ptr::mut_ptr::<impl *mut T>::drop_in_place::hd9af3df480d9fa0c
                               at /home/nickan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mut_ptr.rs:1000
  32:     0x55903a93055f - hashbrown::raw::Bucket<T>::drop::h090d6711d49a1c5a
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.8.2/src/raw/mod.rs:334
  33:     0x55903a92cf76 - <hashbrown::raw::RawTable<T> as core::ops::drop::Drop>::drop::h1caae5a529b9b4a5
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.8.2/src/raw/mod.rs:1292
  34:     0x55903a92c5cf - core::ptr::drop_in_place::he5be2582c44d19b9
                               at /home/nickan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:184
  35:     0x55903a92c636 - core::ptr::drop_in_place::he7b46628e06148ba
                               at /home/nickan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:184
  36:     0x55903a92b7df - core::ptr::drop_in_place::h7ff8a7cc6c7c211d
                               at /home/nickan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:184
  37:     0x55903a9087b6 - core::ptr::drop_in_place::hef08e665b625f0d4
                               at /home/nickan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:184
  38:     0x55903a907ad8 - core::ptr::drop_in_place::h650b311be558e56a
                               at /home/nickan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:184
  39:     0x559039c4d3bf - core::ptr::drop_in_place::h9f31ba0117b041f8
                               at /home/nickan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:184
  40:     0x559039c7cd9a - winit::platform_impl::platform::x11::EventLoop<T>::run_return::h8a78d2230de90b99
                               at /home/nickan/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.23.0/src/platform_impl/linux/x11/mod.rs:380
  41:     0x559039c7e40f - winit::platform_impl::platform::x11::EventLoop<T>::run::h27a1e66fb1a3e5ac
                               at /home/nickan/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.23.0/src/platform_impl/linux/x11/mod.rs:386
  42:     0x559039ca581c - winit::platform_impl::platform::EventLoop<T>::run::h0cb4937fa455fd3f
                               at /home/nickan/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.23.0/src/platform_impl/linux/mod.rs:642
  43:     0x559039c807e8 - winit::event_loop::EventLoop<T>::run::he1337812e5136e4e
                               at /home/nickan/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.23.0/src/event_loop.rs:154
  44:     0x559039ca74e8 - bevy_winit::run::h08ebbd4d408290de
                               at /home/nickan/gamedev/src/dependencies/bevy/crates/bevy_winit/src/lib.rs:105
  45:     0x559039c7fd69 - bevy_winit::winit_runner::hee69a38bf4ba8db7
                               at /home/nickan/gamedev/src/dependencies/bevy/crates/bevy_winit/src/lib.rs:300
  46:     0x559039c4be41 - core::ops::function::Fn::call::h1764072b5bbd5793
                               at /home/nickan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:72
  47:     0x55903a9100da - <alloc::boxed::Box<F> as core::ops::function::Fn<A>>::call::hcf08b1fd9d1aa943
                               at /home/nickan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/boxed.rs:1039
  48:     0x55903a90b8b9 - bevy_app::app::App::run::hdf955052926e858a
                               at /home/nickan/gamedev/src/dependencies/bevy/crates/bevy_app/src/app.rs:81
  49:     0x55903a9174e5 - bevy_app::app_builder::AppBuilder::run::h2a88ab5c150ddf98
                               at /home/nickan/gamedev/src/dependencies/bevy/crates/bevy_app/src/app_builder.rs:43
  50:     0x55903948af9a - shader_defs::main::hc68020126b14b5b2
                               at /home/nickan/gamedev/src/dependencies/bevy/examples/shader/shader_defs.rs:16
  51:     0x55903946a45b - core::ops::function::FnOnce::call_once::h4ce2fdeee170034e
                               at /home/nickan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:233
  52:     0x5590394971be - std::sys_common::backtrace::__rust_begin_short_backtrace::h9281233fde40be2f
                               at /home/nickan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:137
  53:     0x5590394655b1 - std::rt::lang_start::{{closure}}::hd6b9761c56210a15
                               at /home/nickan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:66
  54:     0x55903aa94c7e - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::hde9814ae740a85dc
                               at /rustc/de521cbb303c08febd9fa3755caccd4f3e491ea3/library/core/src/ops/function.rs:265
  55:     0x55903aa94c7e - std::panicking::try::do_call::h3026bab8cd7540d7
                               at /rustc/de521cbb303c08febd9fa3755caccd4f3e491ea3/library/std/src/panicking.rs:373
  56:     0x55903aa94c7e - std::panicking::try::h852bb5e5a66f7f84
                               at /rustc/de521cbb303c08febd9fa3755caccd4f3e491ea3/library/std/src/panicking.rs:337
  57:     0x55903aa94c7e - std::panic::catch_unwind::hfeb0f3dddf7c6a72
                               at /rustc/de521cbb303c08febd9fa3755caccd4f3e491ea3/library/std/src/panic.rs:379
  58:     0x55903aa94c7e - std::rt::lang_start_internal::h32f0ac6e87476559
                               at /rustc/de521cbb303c08febd9fa3755caccd4f3e491ea3/library/std/src/rt.rs:51
  59:     0x559039465587 - std::rt::lang_start::h0d1771768f3f2042
                               at /home/nickan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:65
  60:     0x55903948c58a - main
  61:     0x7f816c8a5b97 - __libc_start_main
  62:     0x55903945a17a - _start
  63:                0x0 - <unknown>
thread panicked while panicking. aborting.
Illegal instruction (core dumped)
chaoticgood1 commented 3 years ago

The error disappears when I set the "always_blue = false" on line 99

CleanCut commented 3 years ago

Confirmed. I can also reproduce this on macOS for both v0.3.0 and master, including the workaround described in the previous comment.

cart commented 3 years ago

Same here. The fix here https://github.com/cart/glsl-to-spirv/pull/4 by @goodbadwolf resolved it for me. Looks like we need to push out a patch release :)

cart commented 3 years ago

0.2.1 of bevy-glsl-to-spirv is published. This issue is resolved for the latest bevy crates.io release by deleting cargo.lock or running cargo upgrade.