diff --git a/Cargo.toml b/Cargo.toml index d98da31..3a05473 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,8 +14,12 @@ exclude = [".github"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[features] +webgl2 = ["bevy/webgl2"] +webgpu = ["bevy/webgpu"] + [dependencies.bevy] -version = "0.13" +version = "0.14" default-features = false features = ["bevy_render"] @@ -23,7 +27,7 @@ features = ["bevy_render"] crossbeam-channel = "0.5.0" [dev-dependencies.bevy] -version = "0.13" +version = "0.14" default-features = false features = [ "android_shared_stdcxx", @@ -31,11 +35,12 @@ features = [ "bevy_core_pipeline", "bevy_pbr", "bevy_render", + "bevy_state", "bevy_ui", "bevy_winit", "default_font", "hdr", - "multi-threaded", + "multi_threaded", "tonemapping_luts", "ktx2", "zstd", diff --git a/README.md b/README.md index 2994183..8c5b249 100644 --- a/README.md +++ b/README.md @@ -18,10 +18,10 @@ Install [wasm-server-runner](https://github.com/jakobhellermann/wasm-server-runn ```bash # WebGL -cargo run --example states --target=wasm32-unknown-unknown --features=bevy/webgl2 +cargo run --example states --target=wasm32-unknown-unknown --features=webgl2 # WebGPU -cargo run --example states --target=wasm32-unknown-unknown --features=bevy/webgpu +cargo run --example states --target=wasm32-unknown-unknown --features=webgpu ``` ## Compatibility diff --git a/examples/states.rs b/examples/states.rs index 9494d13..76b7bb1 100644 --- a/examples/states.rs +++ b/examples/states.rs @@ -14,10 +14,13 @@ struct LoadingOnly; // This value should be found experimentally by logging `PipelinesReady` in your app // during normal use and noting the maximum value. #[cfg(not(target_arch = "wasm32"))] -const EXPECTED_PIPELINES: usize = 8; +const EXPECTED_PIPELINES: usize = 10; // The value will likely differ on the web due to different implementations of some // render features. -#[cfg(target_arch = "wasm32")] +#[cfg(all(target_arch = "wasm32", feature = "webgpu", not(feature = "webgl2")))] +const EXPECTED_PIPELINES: usize = 8; +// Note: you must add these features to your app. See `Cargo.toml`. +#[cfg(all(target_arch = "wasm32", feature = "webgl2", not(feature = "webgpu")))] const EXPECTED_PIPELINES: usize = 6; fn main() { @@ -61,13 +64,13 @@ fn setup_loading_screen( commands.spawn(PbrBundle { mesh: meshes.add(Cylinder::default()), - material: materials.add(Color::PINK), + material: materials.add(Color::from(bevy::color::palettes::tailwind::PINK_500)), ..default() }); commands.spawn(PbrBundle { mesh: meshes.add(Plane3d::default().mesh().size(10.0, 10.0)), - material: materials.add(Color::rgb(0.6, 0.6, 0.6)), + material: materials.add(Color::from(Srgba::gray(0.6))), transform: Transform::from_xyz(0., -0.5, 0.), ..default() });