From 969e411e17b7928238d7d0cb62a4e909612e8020 Mon Sep 17 00:00:00 2001 From: gents83 Date: Sun, 27 Aug 2023 10:53:17 +0200 Subject: [PATCH] Fixing wasm32 --- wgpu-core/src/instance.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/wgpu-core/src/instance.rs b/wgpu-core/src/instance.rs index c8b32aef86..f2ffa74a75 100644 --- a/wgpu-core/src/instance.rs +++ b/wgpu-core/src/instance.rs @@ -590,11 +590,13 @@ impl Global { .gl .as_ref() .map(|inst| { + let raw_surface = inst.create_surface_from_canvas(canvas)?; Ok(HalSurface { - raw: Arc::new(inst.create_surface_from_canvas(canvas)?), + raw: Arc::new(raw_surface), }) }) - .transpose()?; + .transpose()? + .unwrap(); AnySurface::new(hal_surface) }, }; @@ -624,11 +626,13 @@ impl Global { .gl .as_ref() .map(|inst| { + let raw_surface = inst.create_surface_from_offscreen_canvas(canvas)?; Ok(HalSurface { - raw: Arc::new(inst.create_surface_from_offscreen_canvas(canvas)?), + raw: Arc::new(raw_surface), }) }) - .transpose()?; + .transpose()? + .unwrap(); AnySurface::new(hal_surface) }, };