This commit is contained in:
Benjamin Hansen 2024-06-12 12:38:41 -06:00
parent 7a2d7b6f04
commit 30a6b4488e

View File

@ -68,11 +68,7 @@ impl<'a> State<'a> {
..Default::default() ..Default::default()
}); });
// # Safety let surface = instance.create_surface(window).unwrap();
//
// The surface needs to live as long as the window that created it.
// State owns the window, so this should be safe.
let surface = unsafe { instance.create_surface(&window) }.unwrap();
let adapter = instance.request_adapter( let adapter = instance.request_adapter(
&wgpu::RequestAdapterOptions { &wgpu::RequestAdapterOptions {