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

Asset sprite failed to load #2485

Closed
Nukeuler123 opened this issue Jul 15, 2021 · 4 comments
Closed

Asset sprite failed to load #2485

Nukeuler123 opened this issue Jul 15, 2021 · 4 comments
Labels
A-Assets Load files from disk to use for things like images, models, and sounds C-Bug An unexpected or incorrect behavior S-Needs-Investigation This issue requires detective work to figure out what's going wrong

Comments

@Nukeuler123
Copy link

Bevy version

0.5.0

Operating system & version

Debian 10 + KDE

What you did

Using the .png file provided I tried to load it into the engine using the AssetServer and put it into a Sprite bundle (check sprite.rs in the examples/2d folder for a similar implementation)

What you expected to happen

My programmer art sprite to be visible on the screen.

What actually happened

Nothing was on screen

Additional information

When the action is preformed using the standard bevy icon sprite, it worked perfectly. Im submitting my "cursed" .png file for inspection
player

@Nukeuler123 Nukeuler123 added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jul 15, 2021
@rparrett
Copy link
Contributor

I believe this is the same issue as #1824

@alice-i-cecile alice-i-cecile added A-Assets Load files from disk to use for things like images, models, and sounds S-Needs-Investigation This issue requires detective work to figure out what's going wrong and removed S-Needs-Triage This issue needs to be labelled labels Jul 15, 2021
@mockersf
Copy link
Member

mockersf commented Jul 15, 2021

this png actually make Bevy crash due to a wgpu error

thread 'main' panicked at 'Handling wgpu errors as fatal by default', ~/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.9.0/src/backend/direct.rs:1978:5
stack backtrace:
   0: std::panicking::begin_panic
             at ~/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/panicking.rs:519:12
   1: wgpu::backend::direct::default_error_handler
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.9.0/src/backend/direct.rs:1978:5
   2: core::ops::function::Fn::call
             at ~/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:70:5
   3: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
             at ~/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/boxed.rs:1560:9
   4: wgpu::backend::direct::ErrorSinkRaw::handle_error
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.9.0/src/backend/direct.rs:1965:9
   5: wgpu::backend::direct::Context::handle_error
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.9.0/src/backend/direct.rs:93:9
   6: <wgpu::backend::direct::Context as wgpu::Context>::device_create_bind_group
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.9.0/src/backend/direct.rs:938:13
   7: wgpu::Device::create_bind_group
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.9.0/src/lib.rs:1584:17
   8: <bevy_wgpu::renderer::wgpu_render_resource_context::WgpuRenderResourceContext as bevy_render::renderer::render_resource_context::RenderResourceContext>::create_bind_group
             at ./crates/bevy_wgpu/src/renderer/wgpu_render_resource_context.rs:590:35
   9: bevy_render::renderer::render_resource::render_resource_bindings::RenderResourceBindings::update_bind_group
             at ./crates/bevy_render/src/renderer/render_resource/render_resource_bindings.rs:184:17
  10: bevy_render::draw::DrawContext::set_bind_groups_from_bindings_internal
             at ./crates/bevy_render/src/draw.rs:309:47
  11: bevy_render::draw::DrawContext::set_bind_groups_from_bindings
             at ./crates/bevy_render/src/draw.rs:256:9
  12: bevy_render::pipeline::render_pipelines::draw_render_pipelines_system
             at ./crates/bevy_render/src/pipeline/render_pipelines.rs:154:13
  13: core::ops::function::FnMut::call_mut
             at ~/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:150:5
  14: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
             at ~/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:269:13
  15: <Func as bevy_ecs::system::function_system::SystemParamFunction<(),Out,(F0,F1,F2,F3,F4),()>>::run::call_inner
             at ./crates/bevy_ecs/src/system/function_system.rs:439:21
  16: <Func as bevy_ecs::system::function_system::SystemParamFunction<(),Out,(F0,F1,F2,F3,F4),()>>::run
             at ./crates/bevy_ecs/src/system/function_system.rs:442:17
  17: <bevy_ecs::system::function_system::FunctionSystem<In,Out,Param,Marker,F> as bevy_ecs::system::system::System>::run_unsafe
             at ./crates/bevy_ecs/src/system/function_system.rs:369:19
  18: bevy_ecs::schedule::executor_parallel::ParallelExecutor::prepare_systems::{{closure}}
             at ./crates/bevy_ecs/src/schedule/executor_parallel.rs:195:30
  19: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at ~/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/future/mod.rs:80:19
  20: async_executor::Executor::spawn::{{closure}}
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:144:13
  21: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at ~/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/future/mod.rs:80:19
  22: async_task::raw::RawTask<F,T,S>::run
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.0.3/src/raw.rs:489:20
  23: async_task::runnable::Runnable::run
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.0.3/src/runnable.rs:309:18
  24: async_executor::Executor::try_tick
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:181:17
  25: bevy_tasks::task_pool::TaskPool::scope::{{closure}}
             at ./crates/bevy_tasks/src/task_pool.rs:222:21
  26: std::thread::local::LocalKey<T>::try_with
             at ~/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/local.rs:376:16
  27: std::thread::local::LocalKey<T>::with
             at ~/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/local.rs:352:9
  28: bevy_tasks::task_pool::TaskPool::scope
             at ./crates/bevy_tasks/src/task_pool.rs:169:9
  29: <bevy_ecs::schedule::executor_parallel::ParallelExecutor as bevy_ecs::schedule::executor::ParallelSystemExecutor>::run_systems
             at ./crates/bevy_ecs/src/schedule/executor_parallel.rs:120:9
  30: <bevy_ecs::schedule::stage::SystemStage as bevy_ecs::schedule::stage::Stage>::run
             at ./crates/bevy_ecs/src/schedule/stage.rs:820:17
  31: bevy_ecs::schedule::Schedule::run_once
             at ./crates/bevy_ecs/src/schedule/mod.rs:208:13
  32: <bevy_ecs::schedule::Schedule as bevy_ecs::schedule::stage::Stage>::run
             at ./crates/bevy_ecs/src/schedule/mod.rs:226:21
  33: bevy_app::app::App::update
             at ./crates/bevy_app/src/app.rs:62:9
  34: bevy_winit::winit_runner_with::{{closure}}
             at ./crates/bevy_winit/src/lib.rs:484:17
  35: <winit::platform_impl::platform::app_state::EventLoopHandler<T> as winit::platform_impl::platform::app_state::EventHandler>::handle_nonuser_event::{{closure}}
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.25.0/src/platform_impl/macos/app_state.rs:100:13
  36: winit::platform_impl::platform::app_state::EventLoopHandler<T>::with_callback
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.25.0/src/platform_impl/macos/app_state.rs:78:13
  37: <winit::platform_impl::platform::app_state::EventLoopHandler<T> as winit::platform_impl::platform::app_state::EventHandler>::handle_nonuser_event
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.25.0/src/platform_impl/macos/app_state.rs:99:9
  38: winit::platform_impl::platform::app_state::Handler::handle_nonuser_event
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.25.0/src/platform_impl/macos/app_state.rs:205:21
  39: winit::platform_impl::platform::app_state::AppState::cleared
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.25.0/src/platform_impl/macos/app_state.rs:382:13
  40: winit::platform_impl::platform::observer::control_flow_end_handler::{{closure}}
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.25.0/src/platform_impl/macos/observer.rs:180:21
  41: winit::platform_impl::platform::observer::control_flow_handler::{{closure}}
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.25.0/src/platform_impl/macos/observer.rs:142:57
  42: std::panicking::try::do_call
             at ~/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/panicking.rs:379:40
  43: ___rust_try
  44: std::panicking::try
             at ~/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/panicking.rs:343:19
  45: std::panic::catch_unwind
             at ~/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/panic.rs:431:14
  46: winit::platform_impl::platform::event_loop::stop_app_on_panic
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.25.0/src/platform_impl/macos/event_loop.rs:216:11
  47: winit::platform_impl::platform::observer::control_flow_handler
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.25.0/src/platform_impl/macos/observer.rs:142:5
  48: winit::platform_impl::platform::observer::control_flow_end_handler
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.25.0/src/platform_impl/macos/observer.rs:175:9
  49: <unknown>
  50: <unknown>
  51: <unknown>
  52: <unknown>
  53: <unknown>
  54: <unknown>
  55: <unknown>
  56: <unknown>
  57: <unknown>
  58: <unknown>
  59: <() as objc::message::MessageArguments>::invoke
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/objc-0.2.7/src/message/mod.rs:128:17
  60: objc::message::platform::send_unverified
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/objc-0.2.7/src/message/apple/mod.rs:27:9
  61: objc::message::send_message
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/objc-0.2.7/src/message/mod.rs:178:5
  62: winit::platform_impl::platform::event_loop::EventLoop<T>::run_return
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.25.0/src/platform_impl/macos/event_loop.rs:177:22
  63: winit::platform_impl::platform::event_loop::EventLoop<T>::run
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.25.0/src/platform_impl/macos/event_loop.rs:144:9
  64: winit::event_loop::EventLoop<T>::run
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.25.0/src/event_loop.rs:154:9
  65: bevy_winit::run
             at ./crates/bevy_winit/src/lib.rs:170:5
  66: bevy_winit::winit_runner_with
             at ./crates/bevy_winit/src/lib.rs:492:9
  67: bevy_winit::winit_runner
             at ./crates/bevy_winit/src/lib.rs:210:5
  68: core::ops::function::Fn::call
             at ~/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:70:5
  69: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
             at ~/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/boxed.rs:1560:9
  70: bevy_app::app::App::run
             at ./crates/bevy_app/src/app.rs:72:9
  71: bevy_app::app_builder::AppBuilder::run
             at ./crates/bevy_app/src/app_builder.rs:70:9
  72: sprite::main
             at ./examples/2d/sprite.rs:4:5
  73: core::ops::function::FnOnce::call_once
             at ~/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

How did you make this file?

@Nukeuler123
Copy link
Author

Nukeuler123 commented Jul 15, 2021

this png actually make Bevy crash due to a wgpu error

Never crashed for me, just got a blank screen

How did you make this file?

Gimp, default options except for the sprite being 33x33

@rparrett
Copy link
Contributor

rparrett commented Mar 5, 2024

The cursed png loads for me now. I believe this was fixed by #9611.

@rparrett rparrett closed this as completed Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Assets Load files from disk to use for things like images, models, and sounds C-Bug An unexpected or incorrect behavior S-Needs-Investigation This issue requires detective work to figure out what's going wrong
Projects
None yet
Development

No branches or pull requests

4 participants