Skip to content

Commit

Permalink
Make surface creation safe
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Jan 29, 2024
1 parent 1fb8865 commit c99d92d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions crates/fj-viewer/src/graphics/renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit c99d92d

Please sign in to comment.