bevyengine / bevy

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

In `0.14.0-rc.2`, minimal app with `bevy_core_pipeline` crashes without `ktx2`, `zstd`, and `bevy_pbr` #13728

Closed benfrankel closed 3 months ago

benfrankel commented 3 months ago

Bevy version

0.14.0-rc.2

What you did

Note: The following setup runs fine in bevy 0.13.

In Cargo.toml:

[dependencies]
bevy = { version = "0.14.0-rc.2", default-features = false, features = [
    "bevy_core_pipeline",
    "bevy_winit",
    "x11",
] }

In main.rs:

use bevy::prelude::*;

fn main() {
    App::new().add_plugins(DefaultPlugins).run();
}

What went wrong

It runs but immediately crashes with error message:

Failed to load SMAA area LUT: UnsupportedTextureFormat("Ktx2")

After enabling the ktx2 feature, we get a new crash:

Failed to load SMAA area LUT: SuperDecompressionError("Unsupported supercompression scheme: Zstandard")

After enabling the zstd feature, we get a new crash:

Resource requested by bevy_core_pipeline::core_3d::extract_core_3d_camera_phases does not exist: bevy_render::render_phase::ViewBinnedRenderPhases

After enabling the bevy_pbr feature, there is no crash.

jgayfer commented 3 months ago

Related to https://github.com/bevyengine/bevy/issues/13571, though at the time I created that ticket it was only bevy_pbr that needed to be included.

ChristopherBiscardi commented 3 months ago

This happened in the bevy_ecs_tilemap upgrade I'm working on when running the examples -- https://github.com/StarArawn/bevy_ecs_tilemap/pull/537

bugsweeper commented 3 months ago

at the time I created that ticket it was only bevy_pbr that needed to be included.

That because you enabled only bevy_winit feature, but in this issue bevy_core_pipeline is also enabled, which adds SmaaPlugin, which loads ktx2 textures, which wants zstd zlib for supercompression

bugsweeper commented 3 months ago

The question is: Do we want Smaa to be optional, or bevy_core_pipeline to require ktx2?

aevyrie commented 3 months ago

Ideally the SMAA LUTs should be behind a feature flag. I should be able to turn off default features and be able to run with a minimal feature set.

knutsoned commented 3 months ago

Using the published v0.14.0-rc.3 crate, I am seeing this issue if bevy_core_pipeline and multi_threaded are the only features enabled. Minimal reproduction: https://github.com/knutsoned/rc3-winit-example

djeedai commented 3 months ago

Confirming I'm also hitting this in a trivial empty integration test for Hanabi.

rparrett commented 3 months ago

This is an issue for several of my apps -- I don't want to compile bevy_pbr for a 2d game.