List argument samplers at each batch's submission, and retire resource-id-takeover

The steps this packet landed as, in order:
- Refuse the private option bit where Metal ends the process, and take it where Metal ignores it
- Drop the GPU's writes to no-copy memory of the private option bit on macOS
- Let a host step ask the driver for a heap set's layout support
- Run a command that leaves a live sampler state out, announced, instead of failing it
- Record what a read-only view of no-copy pages costs

Content: the tree of `development` at abc094a6c3, unchanged.
This commit is contained in:
Anees Iqbal committed 2026-10-26 13:19:05 +02:00
1 parent c660aa807a
commit 123a9919fc
36 files changed
+1037 -481

No files matched your search

+23 -13
View File
@@ -1505,17 +1505,19 @@ fast forms record, and each `PrecisionNote`'s rustdoc states its bound.
implementation-defined on the device, where Metal's is maximal
(`Reconvergence::ImplementationDefined`). Cost: simdgroup operations after divergent control flow
can see other lanes active than Metal's.
- `metal2vulkan-degrade-resource-id-takeover` (precision). `ResourceIdTakeover`: A function can read
a resource ID whose holder the runtime cannot give it as Metal's command buffer reads it: a
sampler state was made while a committed command buffer not yet completed lists the argument
samplers as it committed. Cost: a function reading the ID can see an earlier holder of it, or the
neutral resource, where Metal's sees the resource holding it as the command buffer runs.
- `metal2vulkan-degrade-unlisted-argument-sampler` (precision). `UnlistedArgumentSampler`: A sampler
state whose element no set-1 sampler array can hold, as more states live than it holds: the
device's, as the state is made, or a pipeline's, as a command lists the argument samplers or its
command buffer lists them again as it commits. Cost: a command buffer whose commands list the
argument samplers while the state lives fails (UnlistedArgumentSampler), where Metal's function
reads the state through its ID.
command buffer lists them again as it commits or as the command's batch is submitted. Or, as a
command buffer commits or the batch is submitted, more states live than a command's plan's
sampler tables hold, or one of a shape its checks refuse. The command runs with the states it
lists: those that fit its sampler arrays, where its tables hold them, else those it listed
before; each such command buffer is counted once (`WorkCounts::unlisted_argument_sampler_buffers`).
A command misses a state where more states live than its sampler arrays hold (at most the device's
update-after-bind sampler limit), or than its plan's tables hold, twice the capacity class of the
states live as it was encoded. Cost: a function reading the
state through its ID in an argument buffer reads the neutral sampler, where Metal's reads the
state.
- `metal2vulkan-degrade-depth-twin` (performance). `DepthTwin`: A `Depth32Float` texture the program
only reads or samples, on a device whose driver is not measured to keep every `float` in a depth
image, is held in an `R32_SFLOAT` image with a `D32_SFLOAT` twin for the comparisons the device
@@ -1647,11 +1649,16 @@ fast forms record, and each `PrecisionNote`'s rustdoc states its bound.
unrelated to the buffer. Cost: the record reads its word as zero, where Metal reads what lies at
that address in its own address space: zero where nothing is there, another buffer's bytes where
Metal placed one.
- `metal2vulkan-degrade-private-resource-option` (precision). `PrivateResourceOption`: A resource
made with `MTLResourceOptions` bit 24, a private option Metal takes
(`ResourceOptions::PRIVATE_BIT`), is made as without it, and reports its options without it, as
Metal's does. Cost: the private option has no effect here: on Metal a no-copy buffer made with it
kept the GPU's writes from the CPU (measured on an M4), where the runtime's reach it.
- `metal2vulkan-degrade-private-resource-option` (precision). `PrivateResourceOption`: A heap of
the runtime's memory or an indirect command buffer made with `MTLResourceOptions` bit 24
(`ResourceOptions::PRIVATE_BIT`), or off macOS a no-copy buffer or heap over the caller's bytes,
which Metal makes and keeps the GPU's writes from the memory of, is made as without it, and
reports its options without it, as Metal's does. On macOS a no-copy buffer or heap with the bit
drops the GPU's writes as Metal's does, its pages imported through a read-only view of them,
announcing nothing. A buffer of the runtime's memory or a texture descriptor with the bit is
refused, as Metal ends the process there; a buffer placed in a heap without the bit is made as
without it, announcing nothing. Cost: the GPU's writes reach the resource's memory, the CPU and
later command buffers, where Metal's never reach them.
- `metal2vulkan-degrade-optimized-depth-stencil-texture` (precision).
`OptimizedDepthStencilTexture`: A depth or stencil texture with `allowGPUOptimizedContents` off
sized or made in a heap (never a device's own texture, whose layout nothing shows), on a device
@@ -2817,6 +2824,9 @@ fast forms record, and each `PrecisionNote`'s rustdoc states its bound.
(Unsupported FramebufferFetch).
- `metal2vulkan-degrade-unrestored-first-move-bytes` (retired). No replacement: a texture over a
no-copy buffer's host pages is a shadow, which takes no first move over them.
- `metal2vulkan-degrade-resource-id-takeover` (retired). No replacement: a command reads the
sampler states live as its batch is submitted, so a state made before the event wait that orders
its ID's write is the one its function reads, as on Metal.
## 10. Accepted differences