From 1f90e211ee74b0db2c58caba6c9b0b13e5d29e3a Mon Sep 17 00:00:00 2001 From: JMS55 <47158642+JMS55@users.noreply.github.com> Date: Wed, 15 Feb 2023 19:44:55 -0500 Subject: [PATCH 1/3] Make ktx2 and zstd default features --- Cargo.toml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index bcd8f51acd505..f8898f6f5bf4f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,11 @@ repository = "https://github.com/bevyengine/bevy" rust-version = "1.67.0" [workspace] -exclude = ["benches", "crates/bevy_ecs_compile_fail_tests", "crates/bevy_reflect_compile_fail_tests"] +exclude = [ + "benches", + "crates/bevy_ecs_compile_fail_tests", + "crates/bevy_reflect_compile_fail_tests", +] members = [ "crates/*", "examples/mobile", @@ -40,10 +44,12 @@ default = [ "bevy_ui", "png", "hdr", + "ktx2", + "zstd", "vorbis", "x11", "filesystem_watcher", - "android_shared_stdcxx" + "android_shared_stdcxx", ] # Force dynamic linking, which improves iterative compile times From a87ae4670e9b40736b6bd0028e2a8adfc6a4cf93 Mon Sep 17 00:00:00 2001 From: JMS55 <47158642+JMS55@users.noreply.github.com> Date: Wed, 15 Feb 2023 19:49:06 -0500 Subject: [PATCH 2/3] Let examples assume ktx2 and zstd features --- .github/workflows/ci.yml | 4 ++-- .github/workflows/validation-jobs.yml | 4 ++-- Cargo.toml | 2 -- examples/3d/load_gltf.rs | 6 ------ examples/tools/scene_viewer/main.rs | 6 ------ 5 files changed, 4 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f40993c7c4602..fce2860e53f05 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -190,14 +190,14 @@ jobs: - name: Build bevy # this uses the same command as when running the example to ensure build is reused run: | - TRACE_CHROME=trace-alien_cake_addict.json CI_TESTING_CONFIG=.github/example-run/alien_cake_addict.ron cargo build --example alien_cake_addict --features "bevy_ci_testing,trace,trace_chrome,ktx2,zstd" + TRACE_CHROME=trace-alien_cake_addict.json CI_TESTING_CONFIG=.github/example-run/alien_cake_addict.ron cargo build --example alien_cake_addict --features "bevy_ci_testing,trace,trace_chrome" - name: Run examples run: | for example in .github/example-run/*.ron; do example_name=`basename $example .ron` echo -n $example_name > last_example_run echo "running $example_name - "`date` - time TRACE_CHROME=trace-$example_name.json CI_TESTING_CONFIG=$example xvfb-run cargo run --example $example_name --features "bevy_ci_testing,trace,trace_chrome,ktx2,zstd" + time TRACE_CHROME=trace-$example_name.json CI_TESTING_CONFIG=$example xvfb-run cargo run --example $example_name --features "bevy_ci_testing,trace,trace_chrome" sleep 10 done zip traces.zip trace*.json diff --git a/.github/workflows/validation-jobs.yml b/.github/workflows/validation-jobs.yml index 3b36ab3639e7b..4d306320dae00 100644 --- a/.github/workflows/validation-jobs.yml +++ b/.github/workflows/validation-jobs.yml @@ -80,7 +80,7 @@ jobs: shell: bash # this uses the same command as when running the example to ensure build is reused run: | - WGPU_BACKEND=dx12 CI_TESTING_CONFIG=.github/example-run/alien_cake_addict.ron cargo build --example alien_cake_addict --features "bevy_ci_testing,ktx2,zstd" + WGPU_BACKEND=dx12 CI_TESTING_CONFIG=.github/example-run/alien_cake_addict.ron cargo build --example alien_cake_addict --features "bevy_ci_testing" - name: Run examples shell: bash @@ -88,7 +88,7 @@ jobs: for example in .github/example-run/*.ron; do example_name=`basename $example .ron` echo "running $example_name - "`date` - time WGPU_BACKEND=dx12 CI_TESTING_CONFIG=$example cargo run --example $example_name --features "bevy_ci_testing,ktx2,zstd" + time WGPU_BACKEND=dx12 CI_TESTING_CONFIG=$example cargo run --example $example_name --features "bevy_ci_testing" sleep 10 done diff --git a/Cargo.toml b/Cargo.toml index f8898f6f5bf4f..b810a3fa4aa2c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -432,7 +432,6 @@ wasm = true [[example]] name = "pbr" path = "examples/3d/pbr.rs" -required-features = ["ktx2", "zstd"] [package.metadata.example.pbr] name = "Physically Based Rendering" @@ -473,7 +472,6 @@ wasm = true [[example]] name = "skybox" path = "examples/3d/skybox.rs" -required-features = ["ktx2", "zstd"] [package.metadata.example.skybox] name = "Skybox" diff --git a/examples/3d/load_gltf.rs b/examples/3d/load_gltf.rs index 30604a5ca2f2c..216842a8309d2 100644 --- a/examples/3d/load_gltf.rs +++ b/examples/3d/load_gltf.rs @@ -27,17 +27,11 @@ fn setup(mut commands: Commands, asset_server: Res) { .looking_at(Vec3::new(0.0, 0.3, 0.0), Vec3::Y), ..default() }, - #[cfg(all(feature = "ktx2", feature = "zstd"))] EnvironmentMapLight { diffuse_map: asset_server.load("environment_maps/pisa_diffuse_rgb9e5_zstd.ktx2"), specular_map: asset_server.load("environment_maps/pisa_specular_rgb9e5_zstd.ktx2"), }, )); - #[cfg(not(all(feature = "ktx2", feature = "zstd")))] - { - warn!("feature ktx2 or zstd wasn't enabled."); - warn!("rerun this example with `--features=\"ktx2 zstd\" to get environment maps for ambient light"); - } commands.spawn(DirectionalLightBundle { directional_light: DirectionalLight { diff --git a/examples/tools/scene_viewer/main.rs b/examples/tools/scene_viewer/main.rs index 74b164d7c12a7..ee084e0af2721 100644 --- a/examples/tools/scene_viewer/main.rs +++ b/examples/tools/scene_viewer/main.rs @@ -128,7 +128,6 @@ fn setup_scene_after_load( }, ..default() }, - #[cfg(all(feature = "ktx2", feature = "zstd"))] EnvironmentMapLight { diffuse_map: asset_server .load("assets/environment_maps/pisa_diffuse_rgb9e5_zstd.ktx2"), @@ -137,11 +136,6 @@ fn setup_scene_after_load( }, camera_controller, )); - #[cfg(not(all(feature = "ktx2", feature = "zstd")))] - { - warn!("feature ktx2 or zstd wasn't enabled."); - warn!("rerun this example with `--features=\"ktx2 zstd\" to get environment maps for ambient light"); - } // Spawn a default light if the scene does not have one if !scene_handle.has_light { From 93488c31c864d8013215004f4652b3e2b069444d Mon Sep 17 00:00:00 2001 From: JMS55 <47158642+JMS55@users.noreply.github.com> Date: Thu, 16 Feb 2023 18:58:38 -0500 Subject: [PATCH 3/3] Remove test --- .../bevy_render/src/texture/image_texture_loader.rs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/crates/bevy_render/src/texture/image_texture_loader.rs b/crates/bevy_render/src/texture/image_texture_loader.rs index a5eb931acfa3b..791161411506c 100644 --- a/crates/bevy_render/src/texture/image_texture_loader.rs +++ b/crates/bevy_render/src/texture/image_texture_loader.rs @@ -95,15 +95,3 @@ impl std::fmt::Display for FileTextureError { ) } } - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_supported_file_extensions() { - for ext in FILE_EXTENSIONS { - assert!(image::ImageFormat::from_extension(ext).is_some()); - } - } -}