cleanup deps

This commit is contained in:
galister
2024-02-22 01:43:35 +01:00
parent ce573f52ea
commit 61a978bfb4
4 changed files with 44 additions and 827 deletions

817
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -12,12 +12,11 @@ edition = "2021"
[dependencies] [dependencies]
anyhow = "1.0.79" anyhow = "1.0.79"
ash = "^0.37.2" ash = "^0.37.2"
ash-window = "0.12.0"
chrono = "0.4.29" chrono = "0.4.29"
chrono-tz = "0.8.5" chrono-tz = "0.8.5"
cstr = "0.2.11" cstr = "0.2.11"
ctrlc = { version = "3.4.2", features = ["termination"] } ctrlc = { version = "3.4.2", features = ["termination"] }
dbus = { version = "0.9.7", optional = true } dbus = { version = "0.9.7" }
flexi_logger = "0.27.4" flexi_logger = "0.27.4"
fontconfig-rs = "0.1.1" fontconfig-rs = "0.1.1"
freetype-rs = "0.32.0" freetype-rs = "0.32.0"
@@ -32,8 +31,6 @@ log = "0.4.20"
once_cell = "1.18.0" once_cell = "1.18.0"
openxr = { version = "0.17.1", features = ["linked"], optional = true } openxr = { version = "0.17.1", features = ["linked"], optional = true }
ovr_overlay = { features = ["ovr_input", "ovr_system"], git = "https://github.com/galister/ovr_overlay_oyasumi", optional = true } ovr_overlay = { features = ["ovr_input", "ovr_system"], git = "https://github.com/galister/ovr_overlay_oyasumi", optional = true }
png = "0.17.10"
raw-window-handle = "0.5.2"
regex = "1.9.5" regex = "1.9.5"
rodio = { version = "0.17.1", default-features = false, features = ["wav", "hound"] } rodio = { version = "0.17.1", default-features = false, features = ["wav", "hound"] }
rosc = { version = "0.10.1", optional = true } rosc = { version = "0.10.1", optional = true }
@@ -45,13 +42,11 @@ strum = { version = "0.25.0", features = ["derive"] }
thiserror = "1.0.56" thiserror = "1.0.56"
vulkano = { git = "https://github.com/vulkano-rs/vulkano", rev = "94f50f1" } vulkano = { git = "https://github.com/vulkano-rs/vulkano", rev = "94f50f1" }
vulkano-shaders = { git = "https://github.com/vulkano-rs/vulkano", rev = "94f50f1" } vulkano-shaders = { git = "https://github.com/vulkano-rs/vulkano", rev = "94f50f1" }
winit = "0.29.10"
wlx-capture = { git = "https://github.com/galister/wlx-capture" } wlx-capture = { git = "https://github.com/galister/wlx-capture" }
xdg = "2.5.2" xdg = "2.5.2"
[features] [features]
default = ["openvr", "openxr", "osc", "x11", "wayland", "notifications"] default = ["openvr", "openxr", "osc", "x11", "wayland"]
notifications = ["dep:dbus"]
openvr = ["dep:ovr_overlay", "dep:json"] openvr = ["dep:ovr_overlay", "dep:json"]
openxr = ["dep:openxr"] openxr = ["dep:openxr"]
osc = ["dep:rosc"] osc = ["dep:rosc"]

View File

@@ -1,7 +1,5 @@
pub mod common; pub mod common;
pub mod input; pub mod input;
#[cfg(feature = "notifications")]
pub mod notifications; pub mod notifications;
#[cfg(feature = "openvr")] #[cfg(feature = "openvr")]

View File

@@ -1,6 +1,5 @@
use std::{ use std::{
collections::HashMap, collections::HashMap,
io::Cursor,
os::fd::{FromRawFd, IntoRawFd}, os::fd::{FromRawFd, IntoRawFd},
slice::Iter, slice::Iter,
sync::{Arc, OnceLock, RwLock}, sync::{Arc, OnceLock, RwLock},
@@ -17,16 +16,7 @@ use vulkano::{
}; };
#[cfg(feature = "openxr")] #[cfg(feature = "openxr")]
use {ash::vk, std::os::raw::c_void, vulkano::swapchain::Surface}; use {ash::vk, std::os::raw::c_void};
pub const BLEND_ALPHA: AttachmentBlend = AttachmentBlend {
src_color_blend_factor: BlendFactor::SrcAlpha,
dst_color_blend_factor: BlendFactor::OneMinusSrcAlpha,
color_blend_op: BlendOp::Add,
src_alpha_blend_factor: BlendFactor::One,
dst_alpha_blend_factor: BlendFactor::One,
alpha_blend_op: BlendOp::Max,
};
use vulkano::{ use vulkano::{
buffer::{ buffer::{
@@ -111,6 +101,15 @@ pub struct Vert2Uv {
pub const INDICES: [u16; 6] = [2, 1, 0, 1, 2, 3]; pub const INDICES: [u16; 6] = [2, 1, 0, 1, 2, 3];
pub const BLEND_ALPHA: AttachmentBlend = AttachmentBlend {
src_color_blend_factor: BlendFactor::SrcAlpha,
dst_color_blend_factor: BlendFactor::OneMinusSrcAlpha,
color_blend_op: BlendOp::Add,
src_alpha_blend_factor: BlendFactor::One,
dst_alpha_blend_factor: BlendFactor::One,
alpha_blend_op: BlendOp::Max,
};
pub struct WlxGraphics { pub struct WlxGraphics {
pub instance: Arc<Instance>, pub instance: Arc<Instance>,
pub device: Arc<Device>, pub device: Arc<Device>,
@@ -154,12 +153,11 @@ impl WlxGraphics {
use ash::vk::PhysicalDeviceDynamicRenderingFeatures; use ash::vk::PhysicalDeviceDynamicRenderingFeatures;
use vulkano::{Handle, Version}; use vulkano::{Handle, Version};
use winit::event_loop::EventLoop;
let event_loop = EventLoop::new()?; let instance_extensions = InstanceExtensions {
let mut instance_extensions = Surface::required_extensions(&event_loop)?; khr_get_physical_device_properties2: true,
..InstanceExtensions::empty()
instance_extensions.khr_get_physical_device_properties2 = true; };
let instance_extensions_raw = instance_extensions let instance_extensions_raw = instance_extensions
.into_iter() .into_iter()
@@ -930,19 +928,6 @@ impl WlxCommandBuffer {
Ok(image) Ok(image)
} }
#[allow(dead_code)]
pub fn texture2d_png(&mut self, bytes: Vec<u8>) -> anyhow::Result<Arc<Image>> {
let cursor = Cursor::new(bytes);
let decoder = png::Decoder::new(cursor);
let mut reader = decoder.read_info()?;
let info = reader.info();
let width = info.width;
let height = info.height;
let mut image_data = vec![0; (info.width * info.height * 4) as usize];
reader.next_frame(&mut image_data)?;
self.texture2d(width, height, Format::R8G8B8A8_UNORM, &image_data)
}
pub fn end_render_pass(&mut self) -> anyhow::Result<()> { pub fn end_render_pass(&mut self) -> anyhow::Result<()> {
self.command_buffer self.command_buffer
.end_render_pass(SubpassEndInfo::default())?; .end_render_pass(SubpassEndInfo::default())?;