@@ -642,8 +642,14 @@ impl WebGpuError for QueueSubmitError {
642642/// surface textures they reference in [`surface_textures`]. Contribute to
643643/// [`Queue::pending_writes`] as necessary.
644644///
645- /// 3) Call the `PendingSubmission`'s [`submit`] method, passing your mutex
646- /// guard on [`Queue::pending_writes`].
645+ /// 3) Acquire the pending writes lock. This may be done at any point between
646+ /// the return from [`Queue::allocate_submission`] and the call to
647+ /// [`submit`]. Typically it should be done as late as is possible given
648+ /// any necessary pending writes activity.
649+ ///
650+ /// 4) Call the `PendingSubmission`'s [`submit`] method (which is a convenience
651+ /// wrapper around [`Queue::submit_pending_submission`]). Pass the pending
652+ /// writes mutex guard to [`submit`].
647653///
648654/// It is also acceptable to drop the `PendingSubmission` without submitting;
649655/// this frees its locks in the appropriate order. This may be necessary when
@@ -657,7 +663,7 @@ impl WebGpuError for QueueSubmitError {
657663/// - [`Queue::submit`] just submits user-constructed [`CommandBuffer`]s.
658664///
659665/// - [`Queue::prepare_surface_texture_for_present`] examines the surface
660- /// texture being presented, and submit deferred initialization commands and
666+ /// texture being presented, and submits deferred initialization commands and
661667/// barriers to get it ready.
662668///
663669/// - [`Queue::flush_writes_for_buffer`] and [`Queue::flush_pending_writes`]
@@ -693,7 +699,7 @@ pub(crate) struct PendingSubmission<'a> {
693699
694700 /// Surface textures referenced by command buffers in this submission.
695701 ///
696- /// These need to be passed to the [`wgpu_hal::Queue::submit`], which
702+ /// These need to be passed to [`wgpu_hal::Queue::submit`], which
697703 /// requires that the list contains no duplicates, so we store them in a
698704 /// `HashMap` keyed by `SurfaceTexture` address.
699705 surface_textures : FastHashMap < * const Texture , Arc < Texture > > ,
@@ -1697,7 +1703,7 @@ impl Queue {
16971703 /// Returns the index and a [`PendingSubmission`].
16981704 ///
16991705 /// The caller passes in the already-acquired [`SnatchGuard`]. This function acquires
1700- /// the fence lock and the command index lock.
1706+ /// the command index lock.
17011707 ///
17021708 /// The caller should update [`PendingSubmission::executions`] with details of the
17031709 /// submission.
0 commit comments