Skip to content

Commit

Permalink
Merge pull request #40 from iMplode-nZ/main
Browse files Browse the repository at this point in the history
Remove winit dependency and swap to raw_window_handle.
  • Loading branch information
shiinamiyuki authored Aug 24, 2024
2 parents cbc56a7 + 6a14f5c commit 3de6e82
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
5 changes: 2 additions & 3 deletions luisa_compute/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ parking_lot = "0.12.1"

serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
winit = "0.29.4"
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" }
Expand All @@ -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"
Expand Down
5 changes: 2 additions & 3 deletions luisa_compute/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -326,7 +325,7 @@ impl Device {
}
pub fn create_swapchain(
&self,
window: &Window,
window: impl HasWindowHandle + HasDisplayHandle,
stream: &Stream,
width: u32,
height: u32,
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion luisa_compute_derive_impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub struct Compiler {
impl Compiler {
pub fn new() -> Self {
Self {
crate_path: quote!(::luisa_compute),
crate_path: quote!(luisa_compute),
}
}
fn lang_path(&self) -> TokenStream {
Expand Down
2 changes: 1 addition & 1 deletion luisa_compute_track/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ pub fn tracked(
let path = crate_path.path;
quote!(#path)
} else {
quote!(::luisa_compute)
quote!(luisa_compute)
};

let item = syn::parse_macro_input!(item as ItemFn);
Expand Down

0 comments on commit 3de6e82

Please sign in to comment.