mirror of
https://github.com/italicsjenga/vello.git
synced 2025-01-10 12:41:30 +11:00
make it work on mac/metal
This commit is contained in:
parent
9626eaa19b
commit
af55dbfa4e
|
@ -133,7 +133,7 @@ struct Helpers {
|
|||
}
|
||||
|
||||
impl MtlInstance {
|
||||
pub fn new(window_handle: Option<&dyn HasRawWindowHandle>) -> Result<MtlInstance, Error> {
|
||||
pub fn new() -> Result<MtlInstance, Error> {
|
||||
Ok(MtlInstance)
|
||||
}
|
||||
|
||||
|
@ -142,10 +142,7 @@ impl MtlInstance {
|
|||
window_handle: &dyn HasRawWindowHandle,
|
||||
) -> Result<MtlSurface, Error> {
|
||||
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())
|
||||
}
|
||||
|
|
|
@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue