Make surface creation safe

This commit is contained in:
Hanno Braun 2024-01-29 13:09:01 +01:00
parent 1fb88651c7
commit c99d92dfde

View File

@ -44,12 +44,7 @@ impl Renderer {
});
// This is sound, as `window` is an object to create a surface upon.
let surface = unsafe {
instance.create_surface_unsafe(
wgpu::SurfaceTargetUnsafe::from_window(&screen.window())
.unwrap(),
)
}?;
let surface = instance.create_surface(screen.window())?;
for adapter in instance.enumerate_adapters(wgpu::Backends::all()) {
debug!("Available adapter: {:?}", adapter.get_info());