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

Panic in wgpu_render_pass #981

Closed
msvbg opened this issue Dec 2, 2020 · 1 comment
Closed

Panic in wgpu_render_pass #981

msvbg opened this issue Dec 2, 2020 · 1 comment

Comments

@msvbg
Copy link
Contributor

msvbg commented Dec 2, 2020

Bevy version

This bug is confirmed to not occur on 6b004f7, but it does occur on f54eb12. The versions in between don't compile for me, but I'm assuming this issue is related to the recent rendering optimizations.

Operating system & version

macOS 10.14.6

What you did

Minimal repro:

use bevy::prelude::*;

fn main() {
    App::build()
        .add_plugins(DefaultPlugins)
        .add_resource(Option::<Entity>::None)
        .add_startup_system(startup)
        .add_system(sys)
        .run();
}

fn startup(commands: &mut Commands, mut entity: ResMut<Option<Entity>>) {
    commands.spawn(SpriteBundle::default());
    *entity = commands.current_entity();
    commands.spawn(Camera2dBundle::default());
}

fn sys(
    mut meshes: ResMut<Assets<Mesh>>,
    mesh_query: Query<&Handle<Mesh>>,
    entity: Res<Option<Entity>>,
) {
    if let Some(entity) = *entity {
        let mesh = mesh_query.get(entity).unwrap();
        meshes.get_mut(mesh);
    }
}

What actually happened

The window opens and renders a gray screen briefly, before panicking with this error message:

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /Users/martin.svanberg/.cargo/git/checkouts/bevy-f7ffde730c324c74/f54eb12/crates/bevy_wgpu/src/wgpu_render_pass.rs:44:66
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@cart
Copy link
Member

cart commented Dec 2, 2020

Resolved by #984

@cart cart closed this as completed Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants