Files
metal2vulkan/docs
Anees Iqbal 933b4e774d SEMANTICS 2112 / RUNTIME 2304: a texture no image can lie over is read and written in place through a texel buffer of its rows
A texture over a buffer is Metal's linear layout: texel (x, y) at offset + y * bytesPerRow +
x * bpp. Where the device refuses the image route over the buffer's pages (a texture over pages
that need more than one dma-buf, a LINEAR plane at a refused pitch or offset) but the buffer is
in place, a slot whose function only reads (read, not sample or gather), writes or asks the
size of that texture now binds a storage (or uniform) texel buffer view over the buffer's bytes,
addressed as rows (the row pitch in texels and the size from a push field), instead of a shadow
image copied in and out. The texel buffer view's format converts as the image's would: the
device's own conversion, no note.

- Translator: a structural fact of the slot (its uses are read/write/size only, proven in
  lowering), a push field and a variant key, after the YCbCr in-place variant's machinery.
- Runtime: the planner takes the rows variant where the image route is refused for a stated
  reason; the tracker sees the slot's writes as writes of the buffer's bytes (rows only, the
  bytes between rows untouched); a buffer with a read twin takes no rows (its twin texture
  stays the shadow of its truth). Sample and gather uses, levels past the first, arrays, 3D and
  compressed formats stay shadows.
- WorkCounts: texel_rows_textures, texel_rows_bound. No new Degradation kind, no precision note.
- Docs: API.md variant section, FAST-PATHS known gap narrowed, the shadow log's rows line.

Workload reason (consumer's 780M diagnostic, numbers only): of the device-gap shadows in three
compute workloads, half the textures are only written by their kernels (1.67 G texels per pass),
the other half only sampled; the written half takes this route.

Verified (msi, lavapipe): texel_rows and read_twin tests 28/28 at f848389cfc (m3-max-29579):
over a copy that lavapipe refuses as an image (pitch 272), no shadow copy, rows bound, texels
inverted in the pages, gap bytes kept, a sample in the same and the next command buffer read the
rows' writes; RGBA8Unorm 1024 codes read / 1024 floats stored and RGBA16Float 65536 / 65536 bit
for bit against the image route. Clippy plain, --cfg m2v_cpu_icd and --cfg m2v_gpu 0; rustdoc 0
(m3-max-29541 at 532be1f473, route code unchanged since). Negative control (the row word swapped
for the width word): 6 of 13 tests fail. Release first dispatch of a new state on lavapipe: base
4.12 ms cold / 0.98 warm, rows 2.80 / 1.56 (the rows side also commits over a copied buffer).
2026-11-14 09:04:48 -08:00
..