Files
metal2vulkan/docs
Anees Iqbal 6e3b5d4795 Guest RAM: a copy over a chunk that takes no import goes through the CPU always
On ANV an object over a listed chunk keeps its own import (residency flat), which holds
the chunk back from the copies over it, as an object's pointer import at the RAM's own
addresses does on every device. copy_take answered such a chunk ThroughCpu, but
stages() still declined a gather some use may write the bytes of (an object lies over
them) and any copy that also touched a chunk it would import (Waits); those went to
the chunk's import and failed with the invariant "a guest RAM chunk a live import of an
object's own holds pages of" (a consumer's IOSurface block on the Iris Xe).

Now copy_take answers CopyTake::CpuOnly for a chunk the device refuses or objects' own
imports hold back, and stages() stages every copy over one, whatever else it touches
(Staging). A gather over such a chunk whose host bytes some use but a copy's read may
write takes a part of its own (Deferred::gpu_written for its GatherStage), so the work
before it in its command buffer is submitted and completed before its host step reads
the pages; its uses are noted again at that part's start, where its copy lies, and it
counts as a gated fill. An encoder holding a gather over such a chunk keeps no log
(Deferred::recorded_by_an_encoding_again), since an encoding again would copy it
through the imports.

Docs: copy.rs ("First touch", stages, record_staged, Staging), host_ram.rs
(CopyTake::CpuOnly, copy_take), deferred.rs, HOWTO.md.
2026-11-12 15:29:42 -08:00
..