diff --git a/wgpu-core/src/present.rs b/wgpu-core/src/present.rs index 60203e2a4..54418882e 100644 --- a/wgpu-core/src/present.rs +++ b/wgpu-core/src/present.rs @@ -152,17 +152,15 @@ impl WebGpuError for ConfigureSurfaceError { } } -pub type ResolvedSurfaceOutput = SurfaceOutput>; - #[repr(C)] #[derive(Debug)] -pub struct SurfaceOutput { +pub struct SurfaceOutput> { pub status: Status, pub texture: Option, } impl Surface { - pub fn get_current_texture(self: &Arc) -> Result { + pub fn get_current_texture(self: &Arc) -> Result { let output = self.get_current_texture_inner(); #[cfg(feature = "trace")] if let Some(present) = self.presentation.lock().as_ref() { @@ -178,7 +176,7 @@ impl Surface { output } - pub(crate) fn get_current_texture_inner(&self) -> Result { + pub(crate) fn get_current_texture_inner(&self) -> Result { profiling::scope!("Surface::get_current_texture"); let (device, config) = if let Some(ref present) = *self.presentation.lock() { @@ -292,7 +290,7 @@ impl Surface { ), }; - Ok(ResolvedSurfaceOutput { status, texture }) + Ok(SurfaceOutput { status, texture }) } pub fn present(self: &Arc) -> Result { @@ -489,7 +487,7 @@ impl Global { &self, surface_id: id::SurfaceId, texture_id_in: Option, - ) -> Result { + ) -> Result, SurfaceError> { let surface = self.surfaces.get(surface_id); let fid = self.hub.textures.prepare(texture_id_in);