Files
metal2vulkan/docs
Anees Iqbal 75137702ab Record what a DontCare colour's kept texels cost
Family A's change came in be0b42bc67/568dd0d59b (a DontCare colour of a
texture's own image keeps its texels through a pooled backing) and
18b42a54bc/e3b68145f3 (drop the pass-sequence-color-actions rows). Their
subjects say WIP and they have no body, so this is their body:

What: kept_bytes::settle now also renders a colour attachment of a
texture's own image stored DontCare (not memoryless, resolving nothing,
not over a buffer) through a backing its queue keeps for the
attachment's shape (attachment_stand_in::pooled_backing, which now takes
whether it copies, Cause::KeptTexels), into which a Load copies the
texels first; the backing is stored DONT_CARE and nothing is copied back.
Not where the pass hands the store to a driver whose DONT_CARE is
Metal's own (MoltenVK), nor the viewed/executes/taken passes, nor where
a format makes no stand-in. No dont-care-store is announced for it, as
the texture keeps Metal's answer; WorkCounts::kept_texels_passes counts
each such pass.

Why: Metal's documentation leaves a DontCare store's contents open ("You
need to assume that GPU discarded the texture's contents"); what the M3
Max leaves, measured by pass-sequence-color-actions over eight runs, is
the attachment's texels from before the pass. Vulkan's DONT_CARE leaves
them undefined, and llvmpipe and the RTX 5080 left the pass's clear and
draw (8 ledger rows). STORE_OP_NONE does not keep the texels of a pass
that writes, so no store op alone matches; the backing does at the cost
below.

Verified:
- lavapipe: pass-sequence-color-actions every plane equal to Metal's
  (m3-max-3621, m3-max-3768, m3-max-3807 at the rebased tip); the whole
  lavapipe set matches the ledger exactly (3768: 1156 rows; 3807: 1137);
  the touched lane tests pass under m2v_cpu_icd (48 at the tip, 3807),
  among them dont_care_stores'
  a_dont_care_color_keeps_its_earlier_texels_on_every_driver, which
  counts kept_texels_passes.
- MoltenVK on the M3 Max: the case announced, its planes exact
  (m3-max-3743, m3-max-3822); 46 lane tests pass under m2v_gpu.
- Negative control (keeps_texels forced false, steelbrain/rows3-negctl,
  m3-max-3729): the 4 llvmpipe rows come back.
- Costs (this commit, docs/FAST-PATHS.md): the scratch example
  rows3_cost on the RTX 5080 (b5080 t entries rows3-t1, rows3-t2, batch
  m3-max-3848) and lavapipe (m3-max-3765, m3-max-3782).

(cherry picked from commit b0197dcf1103f2794723a2cf520f20d698a7b2fd)
2026-11-07 09:05:41 -08:00
..