Files
metal2vulkan/docs
Anees Iqbal 08ca74da22 Charge a sparse heap for a mapping update of a slice past the texture's
Plain Metal takes a sparse mapping update whose slice is past the
texture's own (its API validation refuses it) and charges its heap's
usedSize exactly what the same region on an in-bounds slice costs: one
page a tile of the region clipped to the level's tiles, idempotent per
tile, given back on an unmap of that tile, never below where it stood
(probes/sparse_indirect_usedsize.m and sparse_mapping_past_the_bounds.m
on the M3 Max, macOS 27.0.1, both selectors). Ours counted nothing, so
sparse-mapping-a-slice-past-the-textures read 65,536 where Metal read
81,920 at used-size/2, /3 and /4.

UnitGrid::clipped_region now names such a region's units at the slice
(past_slices tells them apart); sparse/bind.rs's apply takes and gives
back their heap room into SparseState::charged and binds nothing for
them, and undo reverts them with the rest. The move keeps the slice
bound (clipped_size), as measured.

The texels plain Metal's page reaches (read/4: a 16 by 16 block of slice
0's tile (0, 0) reads its unwritten pattern) are not mirrored, on the
owner's call via the orchestrator: an accepted difference in docs/API.md
section 10 (Vulkan binds nothing past an image's layers,
VUID-VkSparseImageMemoryBindInfo-subresource-01723, and the address is
not derivable), which the remaining ledger row now names.

Removes the three used-size rows of known-gaps.tsv. tests::sparse holds
the counts against Metal's readings row by row (every row now equal).

(cherry picked from commit 636522137c717715521cdda950fbb7213e00089f)
2026-11-07 06:26:30 -08:00
..