Files
metal2vulkan/crates
Anees Iqbal e2a9f1fa6b rt: textures over the same bytes of a buffer in images of their own alias
Two textures over one Shared buffer, each in an image of its own (a pitch the device's linear
image does not take), are one memory in Metal: encoder 1 writes T2, encoder 2 reads the same
bytes through T3. The Shared copy rules tracked each image alone. T2's write left only T2's
image ahead of its buffer, and T3's first use leaned on the submission's leading copy, so T3 read
the buffer's bytes from before T2's write (the aliasing test's own-image form: 4078 of 4096
bytes wrong on lavapipe, with byte 0 the host's sentinel).

Now a write through one such texture makes stale every other one over bytes that meet its, and
before a command uses such a texture, each other one over bytes it holds whose image is ahead
goes back first; the texture then takes its copy in (stale, or its first use after a copy back of
its buffer). The copies are the existing counted copies, between their own barriers, by cause.
Textures over bytes that do not meet owe each other nothing, so a path with one writer and no
alias takes no copy more. OverCopy carries the texels' byte range in the buffer, which a Managed
texture's entry now takes from it instead of working it out again.

Verified: lavapipe runs of the aliasing test and the no-alias count test, before and after this
commit (jobs named in the lane's report).
2026-11-20 08:12:56 -08:00
..