diff --git a/Cargo.toml b/Cargo.toml index 18a8e68f46f3c3..803540222b1936 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ default = [ "vorbis", "x11", "filesystem_watcher", - "bevy_openxr", # todo: remove + "bevy_openxr", # todo: remove ] @@ -100,7 +100,9 @@ bevy_dylib = { path = "crates/bevy_dylib", version = "0.5.0", default-features = bevy_internal = { path = "crates/bevy_internal", version = "0.5.0", default-features = false } [target.'cfg(target_arch = "wasm32")'.dependencies] -bevy_internal = { path = "crates/bevy_internal", version = "0.5.0", default-features = false, features = ["webgl"] } +bevy_internal = { path = "crates/bevy_internal", version = "0.5.0", default-features = false, features = [ + "webgl", +] } [dev-dependencies] anyhow = "1.0.4" diff --git a/crates/bevy_openxr/src/presentation.rs b/crates/bevy_openxr/src/presentation.rs index 239806dae5edc6..64112f3fdd112b 100644 --- a/crates/bevy_openxr/src/presentation.rs +++ b/crates/bevy_openxr/src/presentation.rs @@ -177,13 +177,13 @@ pub fn create_graphics_context( .map_err(Box::new)? }; - // let wgpu_instance = unsafe { wgpu::Instance::from_hal::(hal_instance) }; - // let wgpu_adapter = unsafe { wgpu_instance.adapter_from_hal(hal_exposed_adapter) }; - // let (wgpu_device, wgpu_queue) = unsafe { - // wgpu_adapter - // .device_from_hal(hal_device, &device_descriptor, None) - // .map_err(Box::new)? - // }; + let wgpu_instance = unsafe { wgpu::Instance::from_hal::(hal_instance) }; + let wgpu_adapter = unsafe { wgpu_instance.create_adapter_from_hal(hal_exposed_adapter) }; + let (wgpu_device, wgpu_queue) = unsafe { + wgpu_adapter + .create_device_from_hal(hal_device, &device_descriptor, None) + .map_err(Box::new)? + }; Ok(( GraphicsContextHandles::Vulkan { @@ -193,12 +193,11 @@ pub fn create_graphics_context( queue_family_index, queue_index, }, - todo!(), - // XrGraphicsContext { - // instance: wgpu_instance, - // device: Arc::new(wgpu_device), - // queue: wgpu_queue, - // }, + XrGraphicsContext { + instance: wgpu_instance, + device: Arc::new(wgpu_device), + queue: wgpu_queue, + }, )) } else { #[cfg(windows)] diff --git a/examples/xr/vr_cubes.rs b/examples/xr/vr_cubes.rs index 8b3d7a2cb232b0..c1d83274376d42 100644 --- a/examples/xr/vr_cubes.rs +++ b/examples/xr/vr_cubes.rs @@ -8,7 +8,7 @@ use bevy::{ XrReferenceSpaceType, XrSessionMode, XrSystem, XrTrackingSource, XrVibrationEvent, XrVibrationEventType, }, - DefaultPlugins, PipelinedDefaultPlugins, + DefaultPlugins, }; #[bevy_main] @@ -16,7 +16,7 @@ fn main() { App::new() .add_plugin(XrPlugin) .add_plugin(OpenXrPlugin) - .add_plugins(PipelinedDefaultPlugins) + .add_plugins(DefaultPlugins) .add_startup_system(startup) .add_system(interaction) .run(); @@ -42,7 +42,7 @@ fn startup(mut xr_system: ResMut, mut app_exit_events: EventWriter 0.0 { // Low frequency rumble vibration_events.send(XrVibrationEvent {