Skip to content

Commit

Permalink
[wgpu-core] document which closures are guaranteed to be called
Browse files Browse the repository at this point in the history
  • Loading branch information
teoxoy committed Nov 26, 2024
1 parent e829557 commit c0d3fd1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wgpu-core/src/device/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2083,7 +2083,7 @@ impl Global {
self.hub.devices.remove(device_id);
}

/// This closure will be called exactly once during "lose the device".
/// `device_lost_closure` might never be called.
pub fn device_set_device_lost_closure(
&self,
device_id: DeviceId,
Expand Down Expand Up @@ -2144,6 +2144,7 @@ impl Global {
self.hub.queues.remove(queue_id);
}

/// `op.callback` is guaranteed to be called.
pub fn buffer_map_async(
&self,
buffer_id: id::BufferId,
Expand Down
1 change: 1 addition & 0 deletions wgpu-core/src/device/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1396,6 +1396,7 @@ impl Queue {
unsafe { self.raw().get_timestamp_period() }
}

/// `closure` is guaranteed to be called.
pub fn on_submitted_work_done(
&self,
closure: SubmittedWorkDoneClosure,
Expand Down

0 comments on commit c0d3fd1

Please sign in to comment.