Translator: the ordered fetch form goes; its computed writes are refused on every device

The framebuffer fetch had a second form chosen by rasterizationOrderColorAttachmentAccess: over
a rasterization-order input attachment, a fragment function computed writes no Vulkan blend,
write mask or logic operation gives. No runtime enables that feature, so the form ran on no
guest's device. It goes (rule 2: a second form chosen by a query outside the named list; rule 4).

What changes:
- A fetch reads its input attachment ordered between draws alone on every device, noted
  UnorderedFetchWithinDraw. Under the identity domains it reads the pushed texture
  (PushField::FetchedColor).
- These states are refused on every device: a padded extended-range attachment's blend; a write
  of some of the codes one word of an extended-range attachment holds; and a blend no Vulkan
  state gives on a rotated (ARGB8Unorm) attachment. Each refusal is FramebufferFetch, not
  implemented (lower::fragment::fetch::computed_write_refused).
- A word attachment under a partial mask takes its format's own attachment, and is refused where
  the device lacks that format.
- A private logic operation on a device without logicOp is refused naming
  PrivateRenderState(LogicOperation) and logicOp.
- Deleted: lower/fragment/input_blend.rs, word_input.rs, the shader logic operation in logic.rs,
  lower/arith/extended_range/blend.rs, pipeline/link/fetch.rs, and the arithmetic only they used
  (the fma emulation cluster, div_exact, encode_keeping).
- Deleted public items:
  - LoweringInputs.framebuffer_fetch and .logic_operation;
  - FramebufferFetchInputs, FetchedAttachment, BlendEquation;
  - GraphicsState.rasterization_order_attachment_access and
    FragmentCaps.rasterization_order_color_access;
  - metal::format::extended_range_blend, Feature::ExtendedRangeBlend and the ExtendedRangeBlend
    enum;
  - RuntimeInput::FramebufferFetch and ::LogicOperation;
  - RuntimeFact::ExtendedRangeInputBlend, ::RotatedInputBlend and ::WordInputMerge;
  - PrecisionNote::ExtendedRangeBlendSource and ::ExtendedRangeFloatBlendSource.
- The enable-set facts class VK_EXT_rasterization_order_attachment_access as described and never
  enabled.

Docs, in this commit:
- rt README: Known gaps of render encoders gets one line per refused state, each built on the
  runtime's own fetch form if a guest meets it. The Not-enabled row of
  rasterizationOrderColorAttachmentAccess goes, and so does logicOp's mention of the shader form.
- docs/API.md loses the two blend-source notes from the precision-note catalogue, the
  rasterization-order form and the word merge.
- REFUSALS.md is regenerated (reach row of ExtendedRangeBlend removed), along with
  api_signatures.tsv and the api_surface table.
- The conformance ledger: the 39 rows refused naming rasterization-order access (on llvmpipe and
  the UHD 630; on other venues the case read as lacks-feature) become 22 every-venue rows,
  refused, needs NotImplemented. The matrix replay on development confirms the scope.

Lines: product sources (crates/metal2vulkan, -air, -runtime src, tests excluded) +238 -4647;
product tests +277 -2279; validation and conformance +61 -182; docs +48 -67.

Consumer search (reims-vgpu at 71573a84c8, git grep -w over *.rs, *.toml and *.md):
- 0 hits: ExtendedRangeBlend, rasterization_order_color_access, BlendEquation,
  FramebufferFetchInputs, rasterization_order_attachment_access, framebuffer_fetch,
  extended_range_blend, ExtendedRangeBlendSource, ExtendedRangeFloatBlendSource,
  ExtendedRangeInputBlend, RotatedInputBlend, WordInputMerge, DualSource.
- Hits that are not these items: FetchedAttachment 2 (rt's DrawKind); logic_operation 8 (its
  own structs and rt's private state).
- RuntimeInput: only LinkedFunction is used.
- No glob import or re-export of a metal2vulkan module (only `use metal2vulkan_runtime as rt`).

Verified: cargo fmt; refusal surface and signatures regenerated locally. The compile job and the
host suites follow on the branch.
This commit is contained in:
Anees Iqbal committed 2026-11-22 00:17:40 -08:00
1 parent 5eca62f83b
commit 4aee2fa9f1
91 files changed
+624 -7216

No files matched your search

+19 -42
View File
@@ -849,12 +849,9 @@ Where Metal's rules differ from Vulkan's, the pipeline gives Metal's answer:
does not render (the RTX 5080: it renders neither `R8_SRGB` nor `R8G8_SRGB`, and holds the
latter in its UNORM twin) renders through an `R8_UINT` or `R16_UINT` view of its texture the
same way: the fragment function writes the bytes of the device's sRGB encode
(`DevicePackConversion`), a pass clears it to the bytes of Metal's clear, and a partial mask
merges the word over the attachment's input attachment on a device that orders fetch through
rasterization-order input attachments (lavapipe; `RuntimeFact::WordInputMerge`), and is refused
as the device lacking the format elsewhere. A blend of one
other than one and zero is refused as the device lacking the format; a color input of one is
`NotImplemented(Format)`.
(`DevicePackConversion`), and a pass clears it to the bytes of Metal's clear. A partial mask, and
a blend of one other than one and zero, are refused as the device lacking the format; a color
input of one is `NotImplemented(Format)`.
- An `RGB9E5Float` attachment the device does not render (the RTX 5080) renders through an
`R32_UINT` view of its texture: the fragment function writes Metal's word of a `float` output
(each channel clamped to `[0, 65408]`, a NaN 0, the exponent of the largest, every mantissa
@@ -874,13 +871,11 @@ Where Metal's rules differ from Vulkan's, the pipeline gives Metal's answer:
tile's finer values. A device whose word's format renders one sample at that
count refuses the texture (the runtime's `Limit::TextureSamples`).
- A fragment function that reads a color attachment (framebuffer fetch) reads it as an input
attachment, ordered by rasterization-order attachment access wherever the device has it. On a
device without it the input attachment has no rasterization-order access
(`GraphicsState::rasterization_order_attachment_access` false), and the consumer records a
barrier of the subpass's dependency on itself, by region, before each draw that reads input
attachments after an earlier draw of the subpass, 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, Metal's
answer, but the overlapping fragments of one draw are not ordered, which the fragment stage
attachment without rasterization-order attachment access, on every device, and the consumer
records a barrier of the subpass's dependency on itself, by region, before each draw that reads
input attachments after an earlier draw of the subpass, 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, Metal's answer, but the overlapping fragments of one draw are not ordered, which the fragment stage
records (`PrecisionNote::UnorderedFetchWithinDraw`; the runtime does all of this itself). Under
the identity domains the read is the pushed texture of section 1 instead, at the fragment's own
pixel, with the same note: the consumer reads the attachment's texture there and orders each
@@ -892,10 +887,14 @@ Where Metal's rules differ from Vulkan's, the pipeline gives Metal's answer:
every device (`Unsupported{Format}` at the color attachment): Metal's tile holds
such an attachment as `half` through the render pass and rounds it to the codes only at the
store, so a read or a blend after an earlier draw's write sees that draw's `half`, which the
stored codes do not keep. An unblended write, under any write mask, is built. On a device
without rasterization-order access, a raster order group on a color input, or on a color output
of an attachment the function reads, orders that read alone there and takes no interlock; a group on anything else still
needs the pixel interlock (`Unsupported{RasterOrderGroups}`). A `[[stencil]]` output uses
stored codes do not keep. An unblended write, under any write mask, is built. A write the
function would compute over its own read of the attachment, where no Vulkan blend or write mask
gives Metal's, is not built (`Unsupported{FramebufferFetch}`, not implemented, on every device):
a padded extended-range attachment's blend, a write of some of the codes one word of an
extended-range attachment holds, and a blend no Vulkan state gives on an attachment held with
its channels rotated. A raster order group on a color input, or on a color output of an
attachment the function reads, orders that read alone and takes no interlock; a group on
anything else needs the pixel interlock (`Unsupported{RasterOrderGroups}`). A `[[stencil]]` output uses
`VK_EXT_shader_stencil_export`; a device without it refuses the function
(`Unsupported{StencilExport}` naming the extension).
- `[[barycentric_coord]]` reads `BaryCoordKHR` or `BaryCoordNoPerspKHR`, whose vertex order is
@@ -1993,8 +1992,7 @@ bound.
measured. The sample may read another level or filter than Metal's near a boundary.
- `metal2vulkan-degrade-unordered-fetch-within-draw` (precision).
`PrecisionNote::UnorderedFetchWithinDraw`: A fragment function reads a color attachment
(framebuffer fetch) on a device without rasterization-order color attachment access (among
the committed profiles, every one but the lavapipe ones). It reads the attachment as an input
(framebuffer fetch), on every device. 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
@@ -2280,27 +2278,6 @@ bound.
some channel written (`StageIo::half_blend_colors`, which the pipeline's stage reads), or its
module names no math mode (under fast math the pipeline's stage records
`PrecisionNote::HalfOutputFastMathBlend` instead).
- `metal2vulkan-degrade-extended-range-blend-source` (precision).
`PrecisionNote::ExtendedRangeBlendSource`: A fragment function's `half` color output (a scalar or
vector of AIR's `half`) is blended into a padded 10-bit attachment (`R10Unorm_X6`,
`RG10Unorm_X12`, their `_sRGB` twins, `RGB10A2Unorm_sRGB`), whose raw codes no device's blend
unit reads, so the function blends in the shader in the device's arithmetic: `S·Fs op D·Fd` in
`float`, in the blend equation's order, the source, second source and blend color unclamped, as
Metal takes them there (a blend into one of Apple's extended-range formats is refused, section
4). The device's compiler may contract a
product into its sum and may regroup the blend: MoltenVK on the M3 Max and NVIDIA's driver on an
RTX 5080 compute a second source's blend `S·F + D·(1 - F)` as `D + F·(S - D)`. Metal's compiler
rounds each step to `half`, so a blended channel may store another code than Metal's: within two
codes on a linear format and within six on an sRGB twin near zero, where its transfer is
steepest, in the conformance suite's extended-range and padded blend cases; and where the
device's compiler regroups a padded format's blend, an infinite second source stores the end code
its sign picks where Metal's sum is NaN, stored as code 0.
- `metal2vulkan-degrade-extended-range-float-blend-source` (precision).
`PrecisionNote::ExtendedRangeFloatBlendSource`: `PrecisionNote::ExtendedRangeBlendSource` for a
`float` color output (a scalar or vector of AIR's `float`): blended into a padded 10-bit
attachment in the shader in the device's arithmetic, which the device's compiler
may contract and regroup, where Metal's compiler rounds the output and each step of the blend to
`half`; a blended channel within `ExtendedRangeBlendSource`'s bound of Metal's.
- `metal2vulkan-degrade-anisotropic-filter` (precision). `PrecisionNote::AnisotropicFilter`: The
module samples a texture through an anisotropic sampler with Metal's anisotropic filter emulated
by the device's samples at explicit levels (`lower::sampler::anisotropic`), on a device without
@@ -2509,8 +2486,8 @@ bound.
`RGB10A2Unorm` stored green 938 where Metal's rule gives 937, and its xor of `0xe0` over an
`RGBA8Snorm` channel's `0x80` stored `0x60` where Metal's gives `0x61`), by a distance the note
does not bound: the result follows the codes' bits. The device's `logicOp` is its native form
there, and no other form is built for it; a device without `logicOp` computes Metal's rule in
the fragment function and records none. A signed channel the draw does not write (outside the
there, and no other form is built for it; a device without `logicOp` refuses the operation
(`Unsupported{PrivateRenderState(LogicOperation)}` naming `logicOp`). A signed channel the draw does not write (outside the
write mask, or every channel under no-op) keeps its lowest code where any draw's unwritten
texel does (`snorm-minimum-kept`).
- `metal2vulkan-degrade-device-depth-bias` (precision). `PrecisionNote::DeviceDepthBias`: A draw