diff --git a/piet-gpu-hal/src/metal.rs b/piet-gpu-hal/src/metal.rs index 7ec3a2c..891a9be 100644 --- a/piet-gpu-hal/src/metal.rs +++ b/piet-gpu-hal/src/metal.rs @@ -133,7 +133,7 @@ struct Helpers { } impl MtlInstance { - pub fn new(window_handle: Option<&dyn HasRawWindowHandle>) -> Result { + pub fn new() -> Result { Ok(MtlInstance) } @@ -142,10 +142,7 @@ impl MtlInstance { window_handle: &dyn HasRawWindowHandle, ) -> Result { if let RawWindowHandle::MacOS(handle) = window_handle.raw_window_handle() { - Ok(Self::make_surface( - handle.ns_view as id, - handle.ns_window as id, - )) + Ok(Self::make_surface(handle.ns_view as id, handle.ns_window as id).unwrap()) } else { Err("can't create surface for window handle".into()) } diff --git a/piet-gpu-hal/src/mux.rs b/piet-gpu-hal/src/mux.rs index dd20aa8..ba38217 100644 --- a/piet-gpu-hal/src/mux.rs +++ b/piet-gpu-hal/src/mux.rs @@ -183,7 +183,7 @@ impl Instance { mux_match! { self; Instance::Vk(i) => i.device(true).map(Device::Vk), Instance::Dx12(i) => i.device().map(Device::Dx12), - Instance::Mtl(i) => i.device(surface.map(Surface::mtl)).map(Device::Mtl), + Instance::Mtl(i) => i.device().map(Device::Mtl), } }