Allow creating a surface by passing a metal layer.
This is useful if you're using `SDL2`
```rust
let canvas = window.into_canvas().build().unwrap();
let metal_layer = unsafe { sdl2::sys::SDL_RenderGetMetalLayer(canvas.raw()) };
let surface = instance.create_surface_with_metal_layer(metal_layer);
```
@@ -242,6 +242,13 @@ impl Instance {
id: wgn::wgpu_instance_create_surface_from_winit(self.id, window),
}
}
+
+ #[cfg(feature = "metal")]
+ pub fn create_surface_with_metal_layer(&self, window: *mut std::ffi::c_void) -> Surface {
+ Surface {
+ id: wgn::wgpu_instance_create_surface_from_macos_layer(self.id, window),
+ }
+ }
}
impl Adapter {
