From ddfc8815566b2d1d5193429609288fc8bb3bbf4c Mon Sep 17 00:00:00 2001 From: ReversedGravity Date: Tue, 26 Mar 2024 17:45:22 +0000 Subject: [PATCH 1/2] Added swapchain clone. --- luisa_compute/src/runtime.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/luisa_compute/src/runtime.rs b/luisa_compute/src/runtime.rs index d51f7d4..33f74e5 100644 --- a/luisa_compute/src/runtime.rs +++ b/luisa_compute/src/runtime.rs @@ -340,9 +340,7 @@ impl Device { raw_window_handle::RawWindowHandle::Orbital(_) => todo!(), raw_window_handle::RawWindowHandle::Xlib(h) => h.window as u64, raw_window_handle::RawWindowHandle::Xcb(h) => h.window.get() as u64, - raw_window_handle::RawWindowHandle::Wayland(h) => { - h.surface.as_ptr() as u64 - } + raw_window_handle::RawWindowHandle::Wayland(h) => h.surface.as_ptr() as u64, raw_window_handle::RawWindowHandle::Drm(_) => todo!(), raw_window_handle::RawWindowHandle::Gbm(_) => todo!(), raw_window_handle::RawWindowHandle::Win32(h) => h.hwnd.get() as u64, @@ -832,6 +830,7 @@ impl Drop for SwapchainHandle { } } +#[derive(Clone)] pub struct Swapchain { pub(crate) handle: Arc, #[allow(dead_code)] From cc956565dc1a6f0753b79af9c1b52a7bb90a7954 Mon Sep 17 00:00:00 2001 From: ReversedGravity Date: Tue, 26 Mar 2024 20:09:26 +0000 Subject: [PATCH 2/2] Fix track macro - it broke on `impl` types previously. --- luisa_compute_track/src/lib.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/luisa_compute_track/src/lib.rs b/luisa_compute_track/src/lib.rs index 271664a..c2894d9 100644 --- a/luisa_compute_track/src/lib.rs +++ b/luisa_compute_track/src/lib.rs @@ -426,10 +426,6 @@ pub fn tracked( let item = syn::parse_macro_input!(item as ItemFn); let body = &item.block; let body_span = body.span(); - let ret_type = match &item.sig.output { - ReturnType::Default => quote_spanned! {body_span=> () }, - ReturnType::Type(_, ty) => quote_spanned! {body_span=> #ty }, - }; let body = proc_macro::TokenStream::from(quote!({ #body })); let body = track_impl(parse_macro_input!(body as Expr), &crate_path); let body = quote_spanned! {body_span=> @@ -444,7 +440,7 @@ pub fn tracked( }; #crate_path::lang::debug::comment(&format!("begin fn {} at {}:{}:{}", __fn_name, file!(), line!(), column!())); #[allow(clippy::let_unit_value)] - let __ret: #ret_type = #body; + let __ret = #body; #[allow(unreachable_code)] { #crate_path::lang::debug::comment(&format!("end fn {} at {}:{}:{}", __fn_name, file!(), line!(), column!()));