From 258bd0448d24dadbd9fd5655be0a5b546166ee54 Mon Sep 17 00:00:00 2001 From: Schmarni Date: Sun, 19 Oct 2025 16:52:44 +0200 Subject: [PATCH] fix(bevy_mod_openxr/android): fix fb_passthrough and rename feature Signed-off-by: Schmarni --- Cargo.lock | 1 + crates/bevy_openxr/Cargo.toml | 2 +- .../bevy_openxr/examples/android/Cargo.toml | 21 +++++++++++-------- .../src/openxr/features/fb_passthrough.rs | 8 ++++++- crates/bevy_openxr/src/openxr/features/mod.rs | 2 +- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 362e2f6..fc64ca7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1066,6 +1066,7 @@ dependencies = [ name = "bevy_openxr_android" version = "0.3.0" dependencies = [ + "bevy", "bevy_mod_openxr", "bevy_mod_xr", "bevy_xr_utils", diff --git a/crates/bevy_openxr/Cargo.toml b/crates/bevy_openxr/Cargo.toml index ab7bb6d..1015c65 100644 --- a/crates/bevy_openxr/Cargo.toml +++ b/crates/bevy_openxr/Cargo.toml @@ -11,7 +11,7 @@ keywords = ["gamedev", "bevy", "Xr", "Vr", "OpenXR"] default = ["vulkan"] vulkan = ["dep:ash", "dep:android_system_properties"] d3d12 = ["wgpu/dx12", "wgpu-hal/dx12", "dep:winapi"] -passthrough = [] +fb_passthrough = [] reflect = ["dep:bevy_reflect"] window_support = ["dep:bevy_winit", "dep:bevy_window"] diff --git a/crates/bevy_openxr/examples/android/Cargo.toml b/crates/bevy_openxr/examples/android/Cargo.toml index 4d81c8d..69caf27 100644 --- a/crates/bevy_openxr/examples/android/Cargo.toml +++ b/crates/bevy_openxr/examples/android/Cargo.toml @@ -7,17 +7,20 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bevy_mod_openxr.workspace = true +bevy_mod_openxr = { workspace = true, features = [ + "window_support", + "fb_passthrough", +] } bevy_xr_utils.workspace = true bevy_mod_xr.workspace = true -# bevy = { workspace = true, default-features = false, features = [ -# # Bevy 0.15 made GameActivity the default which breaks Quest builds -# # To use NativeActivity instead of GameActivity all of the features have to be listed manually -# "android-native-activity", -# "bevy_window", -# "multi_threaded", -# "tonemapping_luts", -# ] } +bevy = { workspace = true, features = [ + # Bevy 0.15 made GameActivity the default which breaks Quest builds + # To use NativeActivity instead of GameActivity all of the features have to be listed manually + "android-native-activity", + "bevy_window", + "multi_threaded", + "tonemapping_luts", +] } [build-dependencies] reqwest = { version = "0.12", features = ["blocking"] } diff --git a/crates/bevy_openxr/src/openxr/features/fb_passthrough.rs b/crates/bevy_openxr/src/openxr/features/fb_passthrough.rs index 2d550e2..ae4fe2d 100644 --- a/crates/bevy_openxr/src/openxr/features/fb_passthrough.rs +++ b/crates/bevy_openxr/src/openxr/features/fb_passthrough.rs @@ -1,3 +1,9 @@ +use bevy_app::App; +use bevy_app::Plugin; +use bevy_ecs::schedule::IntoScheduleConfigs as _; +use bevy_ecs::schedule::common_conditions::resource_added; +use bevy_ecs::system::Res; +use bevy_ecs::world::World; use bevy_log::error; use bevy_log::info; use bevy_render::Render; @@ -35,7 +41,7 @@ impl Plugin for OxrFbPassthroughPlugin { app.sub_app_mut(RenderApp).add_systems( Render, insert_passthrough - .in_set(RenderSet::PrepareAssets) + .in_set(RenderSystems::PrepareAssets) .run_if(resource_added::), ); } else { diff --git a/crates/bevy_openxr/src/openxr/features/mod.rs b/crates/bevy_openxr/src/openxr/features/mod.rs index d7a1da6..b0bd2a3 100644 --- a/crates/bevy_openxr/src/openxr/features/mod.rs +++ b/crates/bevy_openxr/src/openxr/features/mod.rs @@ -1,4 +1,4 @@ pub mod handtracking; -#[cfg(feature = "passthrough")] +#[cfg(feature = "fb_passthrough")] pub mod fb_passthrough; pub mod overlay;