feat: Update to Bevy 0.18 (#202)
This commit is contained in:
2172
Cargo.lock
generated
2172
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
38
Cargo.toml
38
Cargo.toml
@@ -10,23 +10,23 @@ resolver = "2"
|
||||
members = ["crates/*", "crates/bevy_openxr/examples/android"]
|
||||
|
||||
[workspace.dependencies]
|
||||
bevy = "0.17"
|
||||
bevy_ecs = { version = "0.17.0", default-features = false }
|
||||
bevy_math = { version = "0.17.0", default-features = false }
|
||||
bevy_render = { version = "0.17.0", default-features = false }
|
||||
bevy_core_pipeline = { version = "0.17.0", default-features = false }
|
||||
bevy_window = { version = "0.17.0", default-features = false }
|
||||
bevy_winit = { version = "0.17.0", default-features = false }
|
||||
bevy_pbr = { version = "0.17.0", default-features = false }
|
||||
bevy_app = { version = "0.17.0", default-features = false }
|
||||
bevy_reflect = { version = "0.17.0", default-features = false }
|
||||
bevy_log = { version = "0.17.0", default-features = false }
|
||||
bevy_gizmos = { version = "0.17.0", default-features = false }
|
||||
bevy_camera = { version = "0.17.0", default-features = false }
|
||||
bevy_color = { version = "0.17.0", default-features = false }
|
||||
bevy_transform = { version = "0.17.0", default-features = false }
|
||||
bevy_derive = { version = "0.17.0", default-features = false }
|
||||
bevy_platform = { version = "0.17.0", default-features = false }
|
||||
bevy = "0.18"
|
||||
bevy_ecs = { version = "0.18", default-features = false }
|
||||
bevy_math = { version = "0.18", default-features = false }
|
||||
bevy_render = { version = "0.18", default-features = false }
|
||||
bevy_core_pipeline = { version = "0.18", default-features = false }
|
||||
bevy_window = { version = "0.18", default-features = false }
|
||||
bevy_winit = { version = "0.18", default-features = false }
|
||||
bevy_pbr = { version = "0.18", default-features = false }
|
||||
bevy_app = { version = "0.18", default-features = false }
|
||||
bevy_reflect = { version = "0.18", default-features = false }
|
||||
bevy_log = { version = "0.18", default-features = false }
|
||||
bevy_gizmos = { version = "0.18", default-features = false }
|
||||
bevy_camera = { version = "0.18", default-features = false }
|
||||
bevy_color = { version = "0.18", default-features = false }
|
||||
bevy_transform = { version = "0.18", default-features = false }
|
||||
bevy_derive = { version = "0.18", default-features = false }
|
||||
bevy_platform = { version = "0.18", default-features = false }
|
||||
|
||||
|
||||
bevy_mod_xr = { path = "crates/bevy_xr", version = "0.4.0" }
|
||||
@@ -34,8 +34,8 @@ bevy_mod_openxr = { path = "crates/bevy_openxr", version = "0.4.0" }
|
||||
bevy_xr_utils = { path = "crates/bevy_xr_utils", version = "0.4.0" }
|
||||
openxr = "0.19.0"
|
||||
thiserror = "2.0.3"
|
||||
wgpu = "26"
|
||||
wgpu-hal = "26"
|
||||
wgpu = "27"
|
||||
wgpu-hal = "27"
|
||||
|
||||
# Enable a small amount of optimization in the dev profile.
|
||||
[profile.dev]
|
||||
|
||||
@@ -19,7 +19,7 @@ fn main() {
|
||||
.add_plugins(bevy_mod_openxr::features::fb_passthrough::OxrFbPassthroughPlugin)
|
||||
.add_systems(Startup, setup)
|
||||
.add_systems(Update, modify_camera)
|
||||
.insert_resource(AmbientLight {
|
||||
.insert_resource(GlobalAmbientLight {
|
||||
color: Default::default(),
|
||||
brightness: 500.0,
|
||||
affects_lightmapped_meshes: false,
|
||||
|
||||
@@ -10,7 +10,7 @@ fn main() -> AppExit {
|
||||
.add_plugins(bevy_mod_xr::hand_debug_gizmos::HandGizmosPlugin)
|
||||
.add_systems(Startup, setup)
|
||||
.add_systems(Update, handle_input)
|
||||
.insert_resource(AmbientLight::default())
|
||||
.insert_resource(GlobalAmbientLight::default())
|
||||
.run()
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ use ash::vk::{self, Handle};
|
||||
use bevy_log::{debug, error};
|
||||
use bevy_math::UVec2;
|
||||
use openxr::{sys, Version};
|
||||
use wgpu::{InstanceFlags, MemoryBudgetThresholds};
|
||||
use wgpu::{ExperimentalFeatures, InstanceFlags, MemoryBudgetThresholds};
|
||||
use wgpu::TextureUses;
|
||||
use wgpu_hal::api::Vulkan;
|
||||
use wgpu_hal::Api;
|
||||
@@ -453,6 +453,7 @@ fn init_from_instance_and_dev(
|
||||
required_limits: limits,
|
||||
memory_hints: wgpu::MemoryHints::Performance,
|
||||
trace: wgpu::Trace::Off,
|
||||
experimental_features: ExperimentalFeatures::enabled(),
|
||||
},
|
||||
)
|
||||
}?;
|
||||
@@ -811,6 +812,7 @@ fn wgpu_to_vulkan(format: wgpu::TextureFormat) -> Option<vk::Format> {
|
||||
Tf::EacR11Snorm => F::EAC_R11_SNORM_BLOCK,
|
||||
Tf::EacRg11Unorm => F::EAC_R11G11_UNORM_BLOCK,
|
||||
Tf::EacRg11Snorm => F::EAC_R11G11_SNORM_BLOCK,
|
||||
Tf::P010 => F::G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16,
|
||||
Tf::Astc { block, channel } => match channel {
|
||||
AstcChannel::Unorm => match block {
|
||||
AstcBlock::B4x4 => F::ASTC_4X4_UNORM_BLOCK,
|
||||
|
||||
@@ -9,22 +9,22 @@ use bevy_ecs::{
|
||||
};
|
||||
use bevy_log::{debug_span, error, info};
|
||||
use bevy_render::{
|
||||
Render, RenderApp,
|
||||
extract_resource::ExtractResourcePlugin,
|
||||
pipelined_rendering::PipelinedRenderingPlugin,
|
||||
texture::{ManualTextureView, ManualTextureViews},
|
||||
view::ExtractedView,
|
||||
Render, RenderApp,
|
||||
};
|
||||
|
||||
use bevy_mod_xr::{
|
||||
camera::{calculate_projection, Fov, XrCamera, XrProjection, XrViewInit},
|
||||
camera::{Fov, XrCamera, XrProjection, XrViewInit, calculate_projection},
|
||||
session::{
|
||||
XrFirst, XrHandleEvents, XrPreDestroySession, XrRenderSystems, XrRootTransform,
|
||||
XrSessionCreated,
|
||||
},
|
||||
spaces::XrPrimaryReferenceSpace,
|
||||
};
|
||||
use bevy_transform::{components::Transform, TransformSystems};
|
||||
use bevy_transform::{TransformSystems, components::Transform};
|
||||
use openxr::ViewStateFlags;
|
||||
|
||||
use crate::{helper_traits::ToTransform as _, init::should_run_frame_loop, resources::*};
|
||||
@@ -158,10 +158,7 @@ pub fn init_views<const SPAWN_CAMERAS: bool>(
|
||||
add_texture_view(&mut manual_texture_views, temp_tex, &graphics_info, index);
|
||||
if SPAWN_CAMERAS {
|
||||
commands.spawn((
|
||||
Camera {
|
||||
target: RenderTarget::TextureView(view_handle),
|
||||
..Default::default()
|
||||
},
|
||||
RenderTarget::TextureView(view_handle),
|
||||
XrCamera(index),
|
||||
Projection::custom(XrProjection::default()),
|
||||
// NoFrustumCulling,
|
||||
@@ -177,14 +174,14 @@ pub fn wait_frame(mut frame_waiter: ResMut<OxrFrameWaiter>, mut commands: Comman
|
||||
|
||||
pub fn update_cameras(
|
||||
frame_state: Res<OxrFrameState>,
|
||||
mut cameras: Query<(&mut Camera, &XrCamera)>,
|
||||
mut cameras: Query<(&mut Camera, &mut RenderTarget, &XrCamera)>,
|
||||
) {
|
||||
for (mut camera, xr_camera) in &mut cameras {
|
||||
camera.target =
|
||||
for (_, mut target, xr_camera) in &mut cameras {
|
||||
*target =
|
||||
RenderTarget::TextureView(ManualTextureViewHandle(XR_TEXTURE_INDEX + xr_camera.0));
|
||||
}
|
||||
if frame_state.is_changed() {
|
||||
for (mut camera, _) in &mut cameras {
|
||||
for (mut camera, _, _) in &mut cameras {
|
||||
camera.is_active = frame_state.should_render
|
||||
}
|
||||
}
|
||||
@@ -317,7 +314,7 @@ pub fn add_texture_view(
|
||||
let view = ManualTextureView {
|
||||
texture_view: view.into(),
|
||||
size: info.resolution,
|
||||
format: info.format,
|
||||
view_format: info.format,
|
||||
};
|
||||
let handle = ManualTextureViewHandle(XR_TEXTURE_INDEX + index);
|
||||
manual_texture_views.insert(handle, view);
|
||||
|
||||
@@ -120,7 +120,7 @@ fn on_tracker_add(mut world: DeferredWorld, HookContext { entity, .. }: HookCont
|
||||
if world
|
||||
.entity(entity)
|
||||
.get_components::<Has<Children>>()
|
||||
.is_some_and(identity)
|
||||
.is_ok_and(identity)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ fn main() {
|
||||
.add_systems(Update, read_action_with_marker_component)
|
||||
.add_systems(Update, handle_flight_input)
|
||||
// Realtime lighting is expensive, use ambient light instead
|
||||
.insert_resource(AmbientLight {
|
||||
.insert_resource(GlobalAmbientLight {
|
||||
brightness: 500.0,
|
||||
..AmbientLight::default()
|
||||
..GlobalAmbientLight::default()
|
||||
})
|
||||
.run();
|
||||
}
|
||||
|
||||
@@ -26,9 +26,9 @@ fn main() -> AppExit {
|
||||
Update,
|
||||
send_recenter.after(XRUtilsActionSystems::SyncActionStates),
|
||||
)
|
||||
.insert_resource(AmbientLight {
|
||||
.insert_resource(GlobalAmbientLight {
|
||||
brightness: 500.0,
|
||||
..AmbientLight::default()
|
||||
..GlobalAmbientLight::default()
|
||||
})
|
||||
.run()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user