Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions wgpu/src/backend/wgpu_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ pub struct CoreTlas {
pub struct CoreSurfaceOutputDetail {
context: ContextWgpuCore,
surface_id: wgc::id::SurfaceId,
error_sink: ErrorSink,
}

type ErrorSink = Arc<Mutex<ErrorSinkRaw>>;
Expand Down Expand Up @@ -3443,9 +3444,16 @@ impl dispatch::SurfaceInterface for CoreSurface {
crate::SurfaceStatus,
dispatch::DispatchSurfaceOutputDetail,
) {
let error_sink = if let Some(error_sink) = self.error_sink.lock().as_ref() {
error_sink.clone()
} else {
Arc::new(Mutex::new(ErrorSinkRaw::new()))
};

let output_detail = CoreSurfaceOutputDetail {
context: self.context.clone(),
surface_id: self.id,
error_sink: error_sink.clone(),
}
.into();

Expand All @@ -3455,7 +3463,7 @@ impl dispatch::SurfaceInterface for CoreSurface {
.map(|id| CoreTexture {
context: self.context.clone(),
id,
error_sink: Arc::new(Mutex::new(ErrorSinkRaw::new())),
error_sink,
})
.map(Into::into);

Expand Down Expand Up @@ -3491,7 +3499,10 @@ impl dispatch::SurfaceOutputDetailInterface for CoreSurfaceOutputDetail {
fn present(&self) {
match self.context.0.surface_present(self.surface_id) {
Ok(_status) => (),
Err(err) => self.context.handle_error_fatal(err, "Surface::present"),
Err(err) => {
self.context
.handle_error_nolabel(&self.error_sink, err, "Surface::present");
}
}
}

Expand Down