rt: the pixel interlock orders a raster order group on the memory the function reads and writes

Device creation enables VK_EXT_fragment_shader_interlock where the device lists it, and its
fragmentShaderPixelInterlock where the device reports it (floor's PIXEL_INTERLOCK, one of the
optional extensions; the sample interlock and the shading-rate interlock stay off). The
translator's profile then has the feature, and a fragment function's raster order group on a
buffer, a texture or an argument buffer's member it reads and writes compiles to its one form,
the body inside PixelInterlockOrderedEXT. A device without the feature keeps the typed refusal
(RasterOrderGroups, naming FragmentShaderPixelInterlock). Of the venues probed, KosmicKrisp on the
M3 Max and RADV on the RX 550 list neither the extension nor the feature (vulkaninfo, jobs
m3-max-61291 and m3-max-61296); every other venue reports it, the UHD 630's Windows driver
included (m3-max-61292).

Under the identity domains the interlock chooses no other form. The new
lower::fragment::interlock_forms(p) is pixel_interlock and not identity(p), and it now gates
every form the interlock chose beyond a raster order group's: the fetch's storage form
(interlock_orders), the blend, merge or logic operation computed over it (color::unordered),
the stencil output's storage form (stencil::device_form), the imageblock (imageblock::require),
the snapshot read (snapshot::finish) and the binding plan's snapshot (bind/graphics.rs). Each of
these is a storage image bound through a descriptor, which the identity domains hold none of,
so under them each keeps the form or the refusal it had before the enable, refusal text
included. rog::mode and the device report read the feature itself, as before.

A raster order group on a colour attachment: the lowering enters no critical section for it.
The interlock cannot order the attachment's own write, which happens after the function, so a
group on the colour input, or on a colour output of an attachment the function reads, keeps
the fetch's own ordering: the attachment's pushed texture read at its pixel, ordered after the
earlier draws of the pass and not within its own draw. That difference stands as the static
PrecisionNote::UnorderedFetchWithinDraw the read records, in the runtime README's Known gaps of
render encoders and in docs/API.md's catalogue; both now say the pixel interlock's devices are
included and why.

The storage-image forms of fetch, stencil, colour, imageblock and snapshot are unreached under
the identity domains after this. They are not deleted here; they go to cutxlate's queue.

Tests: the runtime's tests/pixel_interlock.rs draws rog_buffer (engine fragment_rog) four times
over a whole target in one draw on every device of the cfg's kind: the state is made only where
the profile has the feature, each pixel's float sums to 4 and its texel holds the fourth
fragment's sum; elsewhere the state is refused naming RasterOrderGroups. tests/floor.rs adds
the_pixel_interlock_is_enabled_where_reported (the sample interlock stays false) and chains the
structure as Device::open does. The translator's
tests/engine_identity_interlock.rs builds rog_buffer and fetch_ordered under the identity
domains on lavapipe's profile with and without the feature: rog_buffer interlocks and passes L3
with it and is refused without it; fetch_ordered has no interlock, no storage attachment, the
UnorderedFetchWithinDraw note and FetchedColor { color: 0 }, its modules word-identical either
way.

Docs: the runtime README's extension table, a Pixel interlock section under Floor with its
feature table, the raster-order-group gap of render pipeline states (now refused only on a
device without the feature) and the fetch gap; docs/API.md's UnorderedFetchWithinDraw entry;
rog.rs's and fetch.rs's module docs. docs/REFUSALS.md is unchanged (its check passes).
api_signatures.tsv re-blessed for floor::Features's new interlock field.

SEMANTICS_VERSION 2231 is a placeholder one above development's 2230: under the identity
domains a profile with the pixel interlock now takes, for a fetch, a stencil output, a blend,
an imageblock and a snapshot, the form a profile without it takes.

Verification: the lint, test, validation and states-only play jobs are named in the hand-off.
This commit is contained in:
Anees Iqbal committed 2026-11-20 20:01:45 -08:00
1 parent b1b5168fd6
commit 83049f641a
19 files changed
+490 -59

No files matched your search

+17 -16
View File
@@ -2041,22 +2041,23 @@ bound.
- `metal2vulkan-degrade-unordered-fetch-within-draw` (precision).
`PrecisionNote::UnorderedFetchWithinDraw`: A fragment function reads a color attachment
(framebuffer fetch) on a device with neither rasterization-order color attachment access nor
`fragmentShaderPixelInterlock` (Honeykrisp on Apple's M2 Pro; RADV on the RX 550). It reads the
attachment as an input attachment, and the runtime records a barrier of the draws' subpass's
dependency on itself, by region, before each draw that reads input attachments after an earlier
draw of its render pass instance, or its load operations, wrote a color, and before each draw
that writes a color after an earlier one read them: a fetch reads what every earlier
draw stored at its pixel, Metal's answer. Under the identity domains it reads the attachment's
texture at its own pixel instead (`PushField::FetchedColor`), and the consumer orders each
fetching draw after the earlier draws of its pass by a barrier between them (the runtime's
`Metrics::attachment_loop_reads`, or its copies into the attachment's shadow on a device
without the attachment feedback loop). Vulkan orders nothing between the overlapping
fragments of one draw there, where Metal orders them in primitive order: a fragment that covers
a pixel an earlier fragment of its own draw covered may read the texel from before that
fragment's write. Exact for a draw whose primitives do not overlap at a pixel; otherwise each
such pixel holds the result of some order of the draw's fragments there. A raster order group
on the color input, or on a color output of an attachment the function reads, takes the same
form.
`fragmentShaderPixelInterlock` (Honeykrisp on Apple's M2 Pro; RADV on the RX 550), or under the
identity domains on any device without rasterization-order access, the pixel interlock's included:
there the interlock chooses no fetch form, as its storage form is a descriptor the identity
domains do not hold. It reads the attachment as an input attachment, and the runtime records a
barrier of the draws' subpass's dependency on itself, by region, before each draw that reads input
attachments after an earlier draw of its render pass instance, or its load operations, wrote a
color, and before each draw that writes a color after an earlier one read them: a fetch reads what
every earlier draw stored at its pixel, Metal's answer. Under the identity domains it reads the
attachment's texture at its own pixel instead (`PushField::FetchedColor`), and the consumer orders
each fetching draw after the earlier draws of its pass by a barrier between them (the runtime's
`Metrics::attachment_loop_reads`, or its copies into the attachment's shadow on a device without
the attachment feedback loop). Vulkan orders nothing between the overlapping fragments of one draw
there, where Metal orders them in primitive order: a fragment that covers a pixel an earlier
fragment of its own draw covered may read the texel from before that fragment's write. Exact for a
draw whose primitives do not overlap at a pixel; otherwise each such pixel holds the result of
some order of the draw's fragments there. A raster order group on the color input, or on a color
output of an attachment the function reads, takes the same form.
- `metal2vulkan-degrade-fp8-value` (precision). `PrecisionNote::Fp8Value`: An 8-bit float converts
to an integer from the format's documented value with Metal's saturating float-to-integer rule,
where Metal's device here answers otherwise: Metal on Apple M3 compiles these reads but extends