From 34d390ae8eb65118b73256d0eeb8ac6f9c94b578 Mon Sep 17 00:00:00 2001 From: ReversedGravity Date: Sat, 24 Aug 2024 11:49:30 -0700 Subject: [PATCH] Remove winit dependency. --- luisa_compute/Cargo.toml | 5 ++--- luisa_compute/src/runtime.rs | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/luisa_compute/Cargo.toml b/luisa_compute/Cargo.toml index 498e71b..9cb632a 100644 --- a/luisa_compute/Cargo.toml +++ b/luisa_compute/Cargo.toml @@ -16,8 +16,7 @@ parking_lot = "0.12.1" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -winit = "0.30.5" -raw-window-handle = "0.6.0" +raw-window-handle = "0.6.2" indexmap = "2.0.0" luisa_compute_api_types = { path = "../luisa_compute_sys/LuisaCompute/src/rust/luisa_compute_api_types", version = "0.1.1-alpha.1" } @@ -33,7 +32,7 @@ nalgebra = { version = "0.33.0", optional = true } [dev-dependencies] libc = "0.2" - +winit = "0.29.15" rand = "0.8.5" image = "0.24.5" tobj = "4.0.0" diff --git a/luisa_compute/src/runtime.rs b/luisa_compute/src/runtime.rs index 33f74e5..60b0264 100644 --- a/luisa_compute/src/runtime.rs +++ b/luisa_compute/src/runtime.rs @@ -14,7 +14,6 @@ use parking_lot::{Condvar, Mutex, RawMutex, RwLock}; use std::ffi::c_void; use raw_window_handle::{HasDisplayHandle, HasWindowHandle}; -use winit::window::Window; use crate::internal_prelude::*; use crate::lang::soa::{SoaBuffer, SoaBufferVar, SoaBufferView, SoaMetadata}; @@ -326,7 +325,7 @@ impl Device { } pub fn create_swapchain( &self, - window: &Window, + window: impl HasWindowHandle + HasDisplayHandle, stream: &Stream, width: u32, height: u32, @@ -358,7 +357,7 @@ impl Device { h.display.map(|d| d.as_ptr() as u64).unwrap_or(0) } raw_window_handle::RawDisplayHandle::Wayland(h) => h.display.as_ptr() as u64, - raw_window_handle::RawDisplayHandle::Windows(h) => 0u64, + raw_window_handle::RawDisplayHandle::Windows(_h) => 0u64, _ => todo!(), }; self.create_swapchain_raw_handle(