Files
metal2vulkan/docs
Anees Iqbal 781bd94935 Fill queue: a batch takes and waits for the fills of memory its commands may reach alone
On a device with a fill queue (NVIDIA's copy engine), a batch took every fill waiting, whichever
buffers its commands name, and every submission of the device's waited on the GPU for the fill
queue's last submission until the host saw it complete. A fill-queue submission waits for the
batches before its batch on that batch's VkQueue, so a compositor's frame that named only old
buffers waited for an app's new buffer's zeros behind the app's kernels, or made them itself and
waited for its own queue's last batch first.

What, on such a device:
- A batch takes the fills of memory its commands may reach (FillTake::Reached): memory a resource
  its encoders' uses name owns (used_resources::owner_of over Owners and HeapKeys: the buffer, or
  the heap it lies in); every fill where a command of it may reach memory no use names
  (State::reaches_unnamed, State::parts_reach) or where it takes a move of an image in memory
  another resource owns or a staged copy (Taken::every_fill), which come after every fill of that
  memory; and the fills of the device's own buffers, which no use names. The rest stay waiting, in
  their order, for a batch that may reach them or an internal submission, which takes every one.
  A fill's key is noted as it is registered (Filled::key), and its owner as it is taken, so a
  buffer's fills share their turn.
- A batch waits on the GPU for the last fill-queue submission the host may not have seen complete
  whose fills it may reach (Device::fill_queue_wait_for), where its VkQueue did not already.
  Internal submissions still wait for the fill queue's last.
- A command buffer that needs no GPU work goes with no submission where nothing waits but fills of
  the program's memory (FirstMoves::none_waiting_but).
Other devices take every fill, as before.

Tests: first_move::a_batch_takes_the_fills_of_memory_it_reaches (pure); fill_waits (device) holds
fill_queue_waits_unused at 0, where the commit before counts the compositor's waits.

Docs: device/staging.rs and texture/first_move.rs module docs, the runtime README, FAST-PATHS'
fill-queue row.

Verified: cargo fmt. Builds, device runs and numbers follow as potluck jobs.
2026-11-12 00:52:54 -08:00
..