This commit is contained in:
galister
2025-12-12 20:44:06 +09:00
parent e1b209410e
commit 8b4e60e221
53 changed files with 206 additions and 215 deletions

View File

@@ -5,7 +5,7 @@ use std::{collections::VecDeque, time::Instant};
use glam::{Affine3A, Vec2, Vec3A, Vec3Swizzles};
use idmap_derive::IntegerId;
use smallvec::{smallvec, SmallVec};
use smallvec::{SmallVec, smallvec};
use wlx_common::common::LeftRight;
use wlx_common::windowing::{OverlayWindowState, Positioning};
@@ -16,7 +16,7 @@ use crate::state::{AppSession, AppState};
use crate::subsystem::hid::WheelDelta;
use crate::subsystem::input::KeyboardFocus;
use crate::windowing::manager::OverlayWindowManager;
use crate::windowing::window::{self, realign, OverlayWindowData};
use crate::windowing::window::{self, OverlayWindowData, realign};
use crate::windowing::{OverlayID, OverlaySelector};
use super::task::TaskType;

View File

@@ -2,13 +2,13 @@ use std::{array, fs::File, io::Write, time::Duration};
use anyhow::bail;
use ovr_overlay::{
TrackedDeviceIndex,
input::{ActionHandle, ActionSetHandle, ActiveActionSet, InputManager, InputValueHandle},
sys::{
ETrackedControllerRole, ETrackedDeviceClass, ETrackedDeviceProperty,
ETrackingUniverseOrigin,
},
system::SystemManager,
TrackedDeviceIndex,
};
use crate::{

View File

@@ -1,6 +1,6 @@
use std::f32::consts::PI;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
use std::sync::atomic::{AtomicUsize, Ordering};
use ash::vk::SubmitInfo;
use glam::{Affine3A, Vec3, Vec3A, Vec4};
@@ -8,6 +8,7 @@ use idmap::IdMap;
use ovr_overlay::overlay::OverlayManager;
use ovr_overlay::sys::ETrackingUniverseOrigin;
use vulkano::{
VulkanObject,
command_buffer::{
CommandBufferBeginInfo, CommandBufferLevel, CommandBufferUsage, RecordingCommandBuffer,
},
@@ -15,21 +16,20 @@ use vulkano::{
image::view::ImageView,
image::{Image, ImageLayout},
sync::{
fence::{Fence, FenceCreateInfo},
AccessFlags, DependencyInfo, ImageMemoryBarrier, PipelineStages,
fence::{Fence, FenceCreateInfo},
},
VulkanObject,
};
use wgui::gfx::WGfx;
use crate::backend::input::{HoverResult, PointerHit};
use crate::state::AppState;
use crate::subsystem::hid::WheelDelta;
use crate::windowing::Z_ORDER_LINES;
use crate::windowing::backend::{
FrameMeta, OverlayBackend, OverlayEventData, RenderResources, ShouldRender,
};
use crate::windowing::window::{OverlayWindowConfig, OverlayWindowData};
use crate::windowing::Z_ORDER_LINES;
use super::overlay::OpenVrOverlayData;

View File

@@ -1,6 +1,6 @@
use std::{fs::File, io::Read};
use anyhow::{bail, Context};
use anyhow::{Context, bail};
use json::{array, object};
use ovr_overlay::applications::ApplicationsManager;

View File

@@ -5,32 +5,33 @@ use std::{
time::{Duration, Instant},
};
use anyhow::{anyhow, Result};
use anyhow::{Result, anyhow};
use ovr_overlay::{
sys::{ETrackedDeviceProperty, EVRApplicationType, EVREventType},
TrackedDeviceIndex,
sys::{ETrackedDeviceProperty, EVRApplicationType, EVREventType},
};
use vulkano::{device::physical::PhysicalDevice, Handle, VulkanObject};
use vulkano::{Handle, VulkanObject, device::physical::PhysicalDevice};
use wlx_common::overlays::ToastTopic;
use crate::{
RUNNING,
backend::{
BackendError,
input::interact,
openvr::{
helpers::adjust_gain,
input::{set_action_manifest, OpenVrInputSource},
input::{OpenVrInputSource, set_action_manifest},
lines::LinePool,
manifest::{install_manifest, uninstall_manifest},
overlay::OpenVrOverlayData,
},
task::{OpenVrTask, OverlayTask, TaskType},
BackendError,
},
config::save_state,
graphics::{init_openvr_graphics, GpuFutures},
graphics::{GpuFutures, init_openvr_graphics},
overlays::{
toast::Toast,
watch::{watch_fade, WATCH_NAME},
watch::{WATCH_NAME, watch_fade},
},
state::AppState,
subsystem::notifications::NotificationManager,
@@ -38,7 +39,6 @@ use crate::{
backend::{RenderResources, ShouldRender},
manager::OverlayWindowManager,
},
RUNNING,
};
#[cfg(feature = "wayvr")]

View File

@@ -8,8 +8,8 @@ use ovr_overlay::{
sys::{ETrackingUniverseOrigin, VRVulkanTextureData_t},
};
use vulkano::{
image::{view::ImageView, ImageUsage},
Handle, VulkanObject,
image::{ImageUsage, view::ImageView},
};
use wgui::gfx::WGfx;

View File

@@ -4,7 +4,7 @@ use std::{
time::{Duration, Instant},
};
use glam::{bool, Affine3A, Quat, Vec3};
use glam::{Affine3A, Quat, Vec3, bool};
use libmonado as mnd;
use openxr::{self as xr, Quaternionf, Vector2f, Vector3f};
use serde::{Deserialize, Serialize};
@@ -15,7 +15,7 @@ use crate::{
state::{AppSession, AppState},
};
use super::{helpers::posef_to_transform, XrState};
use super::{XrState, helpers::posef_to_transform};
static CLICK_TIMES: [Duration; 3] = [
Duration::ZERO,

View File

@@ -4,16 +4,16 @@ use openxr as xr;
use std::{
f32::consts::PI,
sync::{
atomic::{AtomicUsize, Ordering},
Arc,
atomic::{AtomicUsize, Ordering},
},
};
use wgui::gfx::{
WGfx,
cmd::WGfxClearMode,
pass::WGfxPass,
pipeline::{WGfxPipeline, WPipelineCreateInfo},
WGfx,
};
use crate::{
@@ -27,8 +27,8 @@ use vulkano::{
};
use super::{
swapchain::{create_swapchain, SwapchainOpts, WlxSwapchain},
CompositionLayer, XrState,
swapchain::{SwapchainOpts, WlxSwapchain, create_swapchain},
};
static LINE_AUTO_INCREMENT: AtomicUsize = AtomicUsize::new(1);

View File

@@ -1,7 +1,7 @@
use std::{
collections::VecDeque,
ops::Add,
sync::{atomic::Ordering, Arc},
sync::{Arc, atomic::Ordering},
time::{Duration, Instant},
};
@@ -14,17 +14,18 @@ use vulkano::{Handle, VulkanObject};
use wlx_common::overlays::ToastTopic;
use crate::{
FRAME_COUNTER, RUNNING,
backend::{
BackendError,
input::interact,
openxr::{lines::LinePool, overlay::OpenXrOverlayData},
task::{OverlayTask, TaskType},
BackendError,
},
config::save_state,
graphics::{init_openxr_graphics, GpuFutures},
graphics::{GpuFutures, init_openxr_graphics},
overlays::{
toast::Toast,
watch::{watch_fade, WATCH_NAME},
watch::{WATCH_NAME, watch_fade},
},
state::AppState,
subsystem::notifications::NotificationManager,
@@ -32,7 +33,6 @@ use crate::{
backend::{RenderResources, ShouldRender},
manager::OverlayWindowManager,
},
FRAME_COUNTER, RUNNING,
};
#[cfg(feature = "wayvr")]

View File

@@ -4,9 +4,9 @@ use std::{f32::consts::PI, sync::Arc};
use vulkano::image::view::ImageView;
use xr::EyeVisibility;
use super::{helpers, swapchain::WlxSwapchain, CompositionLayer, XrState};
use super::{CompositionLayer, XrState, helpers, swapchain::WlxSwapchain};
use crate::{
backend::openxr::swapchain::{create_swapchain, SwapchainOpts},
backend::openxr::swapchain::{SwapchainOpts, create_swapchain},
state::AppState,
windowing::window::OverlayWindowData,
};

View File

@@ -15,13 +15,13 @@ use wgui::gfx::{cmd::WGfxClearMode, pipeline::WPipelineCreateInfo};
use crate::{
backend::openxr::{helpers::translation_rotation_to_posef, swapchain::SwapchainOpts},
config_io,
graphics::{dds::WlxCommandBufferDds, ExtentExt, GpuFutures},
graphics::{ExtentExt, GpuFutures, dds::WlxCommandBufferDds},
state::AppState,
};
use super::{
swapchain::{create_swapchain, WlxSwapchain},
CompositionLayer, XrState,
swapchain::{WlxSwapchain, create_swapchain},
};
pub(super) struct Skybox {

View File

@@ -9,7 +9,7 @@ use serde::Deserialize;
use crate::{
state::AppState,
windowing::{window::OverlayWindowConfig, OverlaySelector},
windowing::{OverlaySelector, window::OverlayWindowConfig},
};
#[cfg(feature = "wayvr")]

View File

@@ -10,8 +10,9 @@ use smithay::{
use crate::backend::wayvr::{ExternalProcessRequest, WayVRTask};
use super::{
ProcessWayVREnv,
comp::{self, ClientState},
display, process, ProcessWayVREnv,
display, process,
};
pub struct WayVRClient {

View File

@@ -21,9 +21,9 @@ use smallvec::SmallVec;
use smithay::{
backend::{
egl,
renderer::{gles::GlesRenderer, ImportDma},
renderer::{ImportDma, gles::GlesRenderer},
},
input::{keyboard::XkbConfig, SeatState},
input::{SeatState, keyboard::XkbConfig},
output::{Mode, Output},
reexports::wayland_server::{self, backend::ClientId},
wayland::{
@@ -45,7 +45,7 @@ use wayvr_ipc::{packet_client, packet_server};
use crate::{
state::AppState,
subsystem::hid::{WheelDelta, MODS_TO_KEYS},
subsystem::hid::{MODS_TO_KEYS, WheelDelta},
};
const STR_INVALID_HANDLE_DISP: &str = "Invalid display handle";