diff --git a/crates/bevy_openxr/Cargo.toml b/crates/bevy_openxr/Cargo.toml index 866b391c9c0c7d..3bceb1368583ae 100644 --- a/crates/bevy_openxr/Cargo.toml +++ b/crates/bevy_openxr/Cargo.toml @@ -24,9 +24,9 @@ bevy_xr = { path = "../bevy_xr", version = "0.5.0" } # other openxr = { git = "https://github.com/Ralith/openxrs" } serde = "1" -ash = "0.33" -wgpu = "0.11" -wgpu-hal = { version = "0.11", features = ["vulkan"] } +ash = "0.34" +wgpu = "0.12" +wgpu-hal = { version = "0.12", features = ["vulkan"] } thiserror = "1.0" parking_lot = "0.11" diff --git a/crates/bevy_openxr/src/presentation.rs b/crates/bevy_openxr/src/presentation.rs index 3535125a8082bf..239806dae5edc6 100644 --- a/crates/bevy_openxr/src/presentation.rs +++ b/crates/bevy_openxr/src/presentation.rs @@ -30,7 +30,7 @@ pub fn create_graphics_context( let device_descriptor = wgpu::DeviceDescriptor::default(); if instance.exts().khr_vulkan_enable2.is_some() { - let vk_entry = unsafe { ash::Entry::new().map_err(Box::new)? }; + let vk_entry = unsafe { ash::Entry::new() }; // Vulkan 1.0 constrained by Oculus Go support. // todo: multiview support will require Vulkan 1.1 or specific extensions @@ -52,10 +52,9 @@ pub fn create_graphics_context( flags |= hal::InstanceFlags::DEBUG; } - let instance_extensions = ::Instance::required_extensions( - &vk_entry, vk_version, flags, - ) - .map_err(Box::new)?; + let instance_extensions = + ::Instance::required_extensions(&vk_entry, flags) + .map_err(Box::new)?; let instance_extensions_ptrs = instance_extensions .iter() .map(|x| x.as_ptr()) @@ -86,7 +85,8 @@ pub fn create_graphics_context( vk_version, instance_extensions, flags, - Box::new(instance.clone()), + false, //TODO: is this correct? + Some(Box::new(instance.clone())), ) .map_err(Box::new)? }; @@ -124,9 +124,17 @@ pub fn create_graphics_context( .map(|x| x.as_ptr()) .collect::>(); - let mut physical_features = hal_exposed_adapter - .adapter - .physical_device_features(&device_extensions, device_descriptor.features); + // TODO: how do we get limits from actual device? + let uab_types = hal::UpdateAfterBindTypes::from_limits( + &device_descriptor.limits, + &vk::PhysicalDeviceLimits::default(), + ); + + let mut physical_features = hal_exposed_adapter.adapter.physical_device_features( + &device_extensions, + device_descriptor.features, + uab_types, + ); let family_info = vk::DeviceQueueCreateInfo::builder() .queue_family_index(queue_family_index) @@ -159,7 +167,10 @@ pub fn create_graphics_context( .adapter .device_from_raw( vk_device.clone(), + true, // TODO: is this right? &device_extensions, + device_descriptor.features, + uab_types, queue_family_index, queue_index, ) diff --git a/crates/bevy_xr/Cargo.toml b/crates/bevy_xr/Cargo.toml index 72fd192e58ac8f..36a24a0cc0a971 100644 --- a/crates/bevy_xr/Cargo.toml +++ b/crates/bevy_xr/Cargo.toml @@ -26,4 +26,4 @@ bevy_utils = { path = "../bevy_utils", version = "0.5.0" } # other downcast-rs = "1.2" serde = "1" -wgpu = "0.11" +wgpu = "0.12"