Write Metal's bytes in texture fills and two-plane buffer blits

The steps this packet landed as, in order:
- Hold RGB10A2Unorm_sRGB textures with Metal's conversions
- Name the runtime's gap, not a missing feature, for fetch on interlock devices
- Take clippy's forms in the RGB10A2Unorm_sRGB tests
- Fill multisample textures' samples as Metal's private fills write them
- Check fill units only for the formats the crate holds textures of
- Hold a two-plane texture's bytes between rows, which Metal's buffer blits read back
- Fill texture buffers as Metal does: bytes of the buffer, the pattern streamed
- Drop the multisample fill from apple_only's refusals, which fills it
- Meet the rows of a two-plane buffer blit into the texture in Metal's order
- Announce narrow two-plane row meetings across groups of 32 rows as one of Metal's

Content: the tree of `development` at 9d3447dec9, unchanged.
This commit is contained in:
Anees Iqbal committed 2026-10-26 13:19:05 +02:00
1 parent 9516e41497
commit ee21fca2f4
57 files changed
+5206 -515

No files matched your search

+44 -16
View File
@@ -1789,10 +1789,10 @@ fast forms record, and each `PrecisionNote`'s rustdoc states its bound.
and those an earlier blit left in a row's padding or past a plane, which Metal keeps.
- `metal2vulkan-degrade-extended-range-bits-kept` (precision). `ExtendedRangeBitsKept`: A draw in a
render pass that loads a color attachment of an extended-range or padded 10-bit format
(`BGR10_XR`, `BGRA10_XR`, `RGB10A8_2P_XR10`, `R10Unorm_X6`, `RG10Unorm_X12` and their sRGB twins)
and does not discard it at the store, where the pass's load pass does not take it: a multisampled
attachment, a texture held as a shadow of another image or of a heap's bytes, a sparse one, or one
whose image the device does not copy both ways (a padded format has none of these). Cost: the
(`BGR10_XR`, `BGRA10_XR`, `RGB10A8_2P_XR10`, `R10Unorm_X6`, `RG10Unorm_X12` and their sRGB twins,
and `RGB10A2Unorm_sRGB`) and does not discard it at the store, where the pass's load pass does
not take it: a multisampled attachment, a texture held as a shadow of another image or of a
heap's bytes, a sparse one, or one whose image the device does not copy both ways (a padded format has none of these). Cost: the
texels the pass's draws do not write keep their bytes; Metal's pass keeps their codes but rewrites
the bits they leave unused in each tile a draw reaches (BGR10_XR's bits 30 and 31 to ones,
BGRA10_XR's low six bits of each field to zeros, the two-plane color word's top two bits to zeros)
@@ -1816,14 +1816,30 @@ fast forms record, and each `PrecisionNote`'s rustdoc states its bound.
(`DriverFact::TileStoreIsMetals`), nor under `TileStorePolicy::Exact` for an attachment the load
pass rewrites as Metal's store leaves it.
- `metal2vulkan-degrade-two-plane-buffer-blit` (precision). `TwoPlaneBufferBlit`: A blit between a
buffer and a level of `RGB10A8_2P_XR10` or its sRGB twin whose width is not a multiple of 4: it
moves the texels at the rows the texture holds them in, where Metal's blit addresses the level's
rows `⌊4 w / 16⌋ · 16` bytes apart, short of its rows, and so moves texels into and out of other
rows (into the texture overlapping rows, in an order that varies). Cost: the texels move between
the buffer's rows and the texture's as getBytes and replaceRegion move them; Metal's blit
addresses the texture's rows floor(4w/16)*16 bytes apart where they lie align(4w,16) bytes apart,
so out of the texture it reads texels of earlier rows and padding (0) into later rows of the
buffer, and into it writes rows over each other in an order that varies.
buffer and a level of `RGB10A8_2P_XR10` or its sRGB twin whose width is not a multiple of 4,
where Metal's blit addresses the level's rows `⌊4 w / 16⌋ · 16` bytes apart, short of where they
lie, and so moves texels into and out of other rows and the bytes between them. A 2D texture or
array of one level is blitted at Metal's rows, the row whose bytes Metal's GPU leaves where two
meet standing, the bytes between its rows that its fills and blits with a buffer write held
apart; announced there are a blit into a texture 32 texels wide or wider whose rows meet (narrower,
`two-plane-buffer-blit-order`), and a blit out of a texture of the device's memory that reads bytes
between its rows after a copy from another texture wrote some there. Any other such texture (more
levels, a view, 1D, 3D, a surface's) moves the texels at the rows the texture holds them in. Cost:
where rows meet in a blit into a texture 32 texels wide or wider the earlier row's bytes stand,
where Metal's GPU writes them in an order that varies from run to run, at some sizes never all the
earlier row's; a blit out of a texture of the device's memory reads the bytes
between its rows that a copy from another texture wrote as its fills and blits with a buffer
left them, where Metal's reads the copy's back; and a texture of more than one
level, a view, a 1D or 3D texture or a surface's moves its texels at the rows it holds them in,
where Metal's blit addresses its rows floor(4w/16)*16 bytes apart.
- `metal2vulkan-degrade-two-plane-buffer-blit-order` (precision). `TwoPlaneBufferBlitOrder`: A blit
from a buffer into a level of `RGB10A8_2P_XR10` or its sRGB twin narrower than 32 texels, at a
width not a multiple of 4, whose rows meet between Metal's groups of 32 rows of the region:
Metal's GPU writes the two rows there in an order that varies from run to run (the earlier row's
bytes at 556 of 560 such meetings in our probes), and in its fixed order at every other meeting.
The runtime keeps the earlier row's bytes there and Metal's order elsewhere: Metal's most frequent
whole outcome. Cost: where the rows of two of Metal's groups of 32 meet the earlier row's bytes
stand, where Metal's GPU leaves either row's from run to run.
- `metal2vulkan-degrade-unadvertised-vertex-simdgroups` (validity). `UnadvertisedVertexSimdgroups`:
A render pipeline state whose vertex function runs simdgroup functions on a driver measured to run
a vertex function's subgroup operations as Metal does though its `subgroupSupportedStages` leaves
@@ -1902,7 +1918,8 @@ fast forms record, and each `PrecisionNote`'s rustdoc states its bound.
and never makes one the older release stops.
- `metal2vulkan-degrade-unreached-tiles-rewritten` (precision). `UnreachedTilesRewritten`: A render
pass that loads a color attachment of an extended-range or padded 10-bit format (`BGR10_XR`,
`BGRA10_XR`, `RGB10A8_2P_XR10`, `R10Unorm_X6`, `RG10Unorm_X12` and their sRGB twins), or under
`BGRA10_XR`, `RGB10A8_2P_XR10`, `R10Unorm_X6`, `RG10Unorm_X12` and their sRGB twins, and
`RGB10A2Unorm_sRGB`), or under
`TileStorePolicy::Exact` of a signed normalized format or `RGB9E5Float`, stores it and draws,
whose load pass rewrites every 32 x 32 tile of its render area: Metal's pass rewrites
only the tiles a draw's primitives reach, and every tile only where a color attachment of the pass
@@ -2228,9 +2245,20 @@ fast forms record, and each `PrecisionNote`'s rustdoc states its bound.
device reports maps to them. Cost: the device gives no answer for them (`PrivateAnswer::value` is
`None`); Metal's measured answers on Apple's GPUs ride beside, never as this device's.
- `metal2vulkan-degrade-unpacked-fill-color` (precision). `UnpackedFillColor`: A color fill
(`BlitCommandEncoder::fill_texture_color`) whose color is packed in a format whose fills do not
follow the color: compressed, 4:2:2, depth, stencil, two-plane or padded 10-bit. Cost: every unit
of the region holds zero bytes, whatever the color, where Metal's constant is its own process's.
(`BlitCommandEncoder::fill_texture_color`) whose color is packed in a format Metal packs no color
in: compressed, 4:2:2, depth, stencil, two-plane, YCbCr, padded 10-bit, `Invalid` or a private
format. Metal fills bytes of the calling thread's stack there, which hold the last color fill's
packed texel only where no other call used them since. Cost: every unit of the region holds the
command buffer's last packed texel over zeros, whatever the color, where Metal's bytes are its
stack's.
- `metal2vulkan-degrade-texture-buffer-fill-leftover` (precision). `TextureBufferFillLeftover`: A
fill of a texture buffer (`BlitCommandEncoder::fill_texture`,
`BlitCommandEncoder::fill_texture_color`) whose 16-byte chunks read bytes of its block past the
pattern's whole copies, or past the block: most patterns whose length is not a power of two, and
most regions whose first byte is not at a multiple of 16 of the buffer. Metal reads bytes of the
calling thread's stack there: zeros in our probes, an earlier fill's bytes in the consumer's
process. The runtime writes zeros there. Cost: those bytes of each chunk are zeros, where Metal's
are its stack's.
- `metal2vulkan-degrade-unsized-points` (precision). `UnsizedPoints`: A draw of points that
rasterizes, of some vertices and instances, under a render pipeline state whose vertex function
writes no `[[point_size]]` and whose input primitive topology class is not the point class: a