Files
metal2vulkan/docs
Anees Iqbal 442dcd08c9 Copied host memory: a copy that drops the GPU's writes takes its guest RAM's log, and a draw that only reads through loaded addresses leaves unnamed copies uncompared
A copy of memory of Metal's private option bit 24 (on a system that maps no read-only view of
the pages) skipped the routing of its guest RAM runs, so it kept no log: every commit compared
every byte of it, and every completion of a command buffer with a root table compared every
copy. In consumer boots that is about 29.5 MiB per commit and per completion over 37-44 objects.

- Commit (copy in): a no-copy buffer, heap or rebind whose GPU writes are dropped has its runs
  asked as a writable one's are (routes_runs), so its copy takes the RAM's log and copies in only
  the pages the log reports written. It is still never bound in the RAM's chunk: the in-chunk
  binding is filtered on drops_writes. macOS keeps its read-only view and asks no runs.
- Completion (merge back): State::writes_unnamed narrows reaches_unnamed to commands whose
  functions may write memory. A draw's root table writes only where the vertex or fragment
  function may store or update memory (GraphicsState::vertex_writes_memory,
  fragment_writes_memory) or the pipeline has another stage; kernels, tile functions, replay
  tables and records resolved by host steps stay as they were (every copy compared). The compare
  itself stays: in a dropping copy it is what restores the dropped bytes, so later command
  buffers read the pages' bytes.

Tests: host_ram_copy_device a_private_bit_copy_over_the_pages_copies_in_only_the_pages_the_log_reports
(one page written: length - page bytes not compared, the GPU's fill dropped) and copied_device
a_merge_back_skips_a_copy_when_a_draw_only_reads_through_loaded_addresses (root table noted,
merge back compared 0). Docs: copied.rs, FAST-PATHS known gap, HOWTO section on copies.

(cherry picked from commit 61a9a4f4603a4c080ba5a4f2e204668ae621cf41)
2026-11-07 14:28:18 -08:00
..