Files
metal2vulkan/docs
Anees Iqbal 2d3b673067 Take a blit into a texture at a pitch below the row on Metal's aligned path
A copy into a texture from offset 0, of one image, at a bytesPerRow that is
a multiple of 16 below the row was refused Copy(BytesPerRow) as unmeasured.
That is the row MTLPixelFormatGetInfoForDevice describes for the one-plane
YCbCr formats (a byte a texel for YCBCR8_422_1P, two for YCBCR10_444_1P:
half the row), which reims-vgpu's blits use (m3-max-4955 to 4985).

Measured (probes/short_row_blits.m, M3 Max, macOS 27.0.1, m3-max-5158):
every row of a 32 x 8 texture (64 x 8 for R8Unorm) read whole from its own
row's offset at every pitch of the texel from 16 below the row, in eight
formats of 1 to 16 bytes a texel, Private and Shared, 166 of 166. The
aligned path now takes such a pitch, rows at y x pitch; a pitch of 0 and an
offset of 16 or more stay refused.

A copy out at such a pitch stays refused: Metal writes the overlapping rows
in no one order (m3-max-5170: 900 copies out at half the row, 300 shapes of
12 formats in 3 processes, later-row bytes at some widths, even rows' at
others, neither at most, 15 shapes differing between processes). The CPU
copies already move nothing below the row, as Metal's.

Tests: blit_plan's placed-rows test takes three such pitches;
described_row_copies (device) copies in at the described row of both
formats and reads each row from its offset, and holds the copy out refused.
REFUSALS.md regenerated (the basis states the measurement).

Not yet verified: the tests and clippy follow.

(cherry picked from commit 3b174b367547b6f6187671d84f01797f9fe8f8ea)
2026-11-07 14:01:21 -08:00
..