On lavapipe (and on every Mesa driver, whose queues merge a submission that
signals nothing into the next), commit_and_submit's committing thread never
submitted anything: tests::commit_and_submit printed "0 of 40 handlers on the
caller; passes at commit 40, batches 0", and six of its tests failed (lines
126, 217, 284, 427, 535, 624), with deferred_calls.rs:1106 (the check and
handler ran on the scheduler's thread, not the lowering thread). Under the
default CompletionPolicy::Grouped there, every batch "may wait in a group"
(group::groups), and scheduler::plain refused any such batch to a thread
other than the scheduler's, so each commit went to the scheduler's thread, a
wake and a pass away: the extension did nothing on the drivers it was made
for (the runtime README states it submits the ready command buffers needing
no host step and no storage-form switch; only the method's doc said "no
group").
A pass that holds a batch in the group sends the group at its end unless two
or more earlier submissions of its VkQueue are not seen complete
(Group::keeps). So where at most one runs, a committing thread now submits
such a batch alone (CommandBufferShared::goes_alone_at_commit, read from the
queue's timeline without its lock, as keeps reads it): it reaches the GPU no
later than through the scheduler, and the wake and pass are saved. Where two
or more run, it is left to the scheduler's thread, which holds it in the
group with the commits that join it, as before. submit_batch takes `alone`,
which a thread other than the scheduler's passes, so such a batch never joins
the group. A thread about to block keeps leaving groupable batches to the
scheduler.
Docs: commit_and_submit's doc, the scheduler module doc, the runtime README
and the Grouped row of docs/FAST-PATHS.md (its switch and forms unchanged).
Verified on lavapipe (layer 1.4.363) by the commit_and_submit and
deferred_calls tests and the grouped-submission lane at this commit and with
plain()'s change reverted, in one job (see the report for the job id).
(cherry picked from commit 25a43729192f80d5fc2ca3af42ef4c14596ae1f0)