From 1e4db18f84f35bc2c22ef2d7337dc1cef6abb46c Mon Sep 17 00:00:00 2001 From: Schmarni Date: Sat, 27 Jan 2024 04:06:27 +0100 Subject: [PATCH] commit --- src/lib.rs | 12 ++++++------ src/xr_input/xr_camera.rs | 16 +--------------- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 8d77c30..44fc206 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -18,7 +18,9 @@ use bevy::app::{AppExit, PluginGroupBuilder}; use bevy::core::TaskPoolThreadAssignmentPolicy; use bevy::ecs::system::SystemState; use bevy::prelude::*; -use bevy::render::camera::{ManualTextureView, ManualTextureViewHandle, ManualTextureViews}; +use bevy::render::camera::{ + camera_system, ManualTextureView, ManualTextureViewHandle, ManualTextureViews, +}; use bevy::render::extract_resource::ExtractResourcePlugin; use bevy::render::pipelined_rendering::PipelinedRenderingPlugin; use bevy::render::renderer::{render_system, RenderInstance}; @@ -42,7 +44,7 @@ use xr_input::controllers::XrControllerType; use xr_input::hands::emulated::HandEmulationPlugin; use xr_input::hands::hand_tracking::{HandTrackingData, HandTrackingPlugin}; use xr_input::hands::XrHandPlugins; -use xr_input::xr_camera::XrCameraType; +use xr_input::xr_camera::{XRProjection, XrCameraType}; use xr_input::OpenXrInput; const VIEW_TYPE: xr::ViewConfigurationType = xr::ViewConfigurationType::PRIMARY_STEREO; @@ -170,7 +172,7 @@ impl Plugin for OpenXrPlugin { .run_if(xr_only()) .run_if(xr_after_wait_only()) .run_if(xr_render_only()) - .after(RenderSet::Render), + .in_set(RenderSet::Cleanup), ); render_app.add_systems( Render, @@ -178,7 +180,7 @@ impl Plugin for OpenXrPlugin { .run_if(xr_only()) .run_if(xr_after_wait_only()) .run_if(not(xr_render_only())) - .after(RenderSet::Render), + .in_set(RenderSet::Cleanup), ); } } @@ -219,8 +221,6 @@ impl PluginGroup for DefaultXrPlugins { .set(TaskPoolPlugin { task_pool_options: TaskPoolOptions { compute: TaskPoolThreadAssignmentPolicy { - // set the minimum # of compute threads - // to the total number of available threads min_threads: 2, max_threads: std::usize::MAX, // unlimited max threads percent: 1.0, // this value is irrelevant in this case diff --git a/src/xr_input/xr_camera.rs b/src/xr_input/xr_camera.rs index 1d143c3..95b70b1 100644 --- a/src/xr_input/xr_camera.rs +++ b/src/xr_input/xr_camera.rs @@ -44,17 +44,15 @@ pub struct XrCameraBundle { pub color_grading: ColorGrading, pub xr_camera_type: XrCameraType, } -#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, Ord, PartialOrd, Component)] +#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, Ord, PartialOrd, Component, ExtractComponent)] pub enum XrCameraType { Xr(Eye), Flatscreen, } - #[derive(Component)] pub(super) struct TransformExtract; - impl ExtractComponent for TransformExtract { type Query = Read; @@ -67,18 +65,6 @@ impl ExtractComponent for TransformExtract { } } -impl ExtractComponent for XrCameraType { - type Query = Read; - - type Filter = (); - - type Out = Self; - - fn extract_component(item: bevy::ecs::query::QueryItem<'_, Self::Query>) -> Option { - Some(*item) - } -} - #[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)] pub enum Eye { Left = 0,