Files
metal2vulkan/crates/metal2vulkan-runtime/examples
Anees Iqbal 1f68adc9bb Framebuffer fetch without an ordered form: input attachments ordered between draws
A device with neither rasterization-order color attachment access nor the
fragment shader pixel interlock (Honeykrisp on Apple's M2 Pro, Mesa 25.3.6;
RADV on the RX 550) refused every fragment function that reads a color
attachment, Unsupported{FramebufferFetch, AnyOf[[ROAA],[interlock]]}. Metal
compiles those functions, so the device's own scope was narrower than the
refusal: Vulkan orders an earlier draw's color write before a later draw's
input attachment read of a subpass by a barrier of the subpass's dependency
on itself (core Vulkan, the Render Pass chapter's Common Render Pass Data
Races); only the overlapping fragments of one draw stay unordered.

Translator: on such a device a color input reads the input attachment, as on
lavapipe, without rasterization-order access, and the fragment stage records
the new PrecisionNote::UnorderedFetchWithinDraw (device gap). The device's
unsupported_features no longer lists FramebufferFetch. SEMANTICS_VERSION
2024 -> 2025.

Runtime: such a device fetches through input attachments
(framebuffer_fetch::through_inputs, inputs_between_draws); its subpasses and
pipelines take no rasterization-order flags; a draw that reads input
attachments after an earlier draw of its instance wrote a color, or writes a
color after one read them, records after the draws' subpass's whole
self-dependency barrier (InterlockedStorage's two new kinds,
render_target::DrawsBarrier), counted in the new
WorkCounts::fetch_draw_barriers. Devices with an ordered form keep their
paths: the new kinds are set only where inputs_between_draws holds.

Validation: the fetch lane's gate answers whether a device fetches in an
ordered form, and on one without checks the pipeline is made with the note;
framebuffer_fetch::between_draws is the device test of the new form on any
venue, ordered forms withheld.

Verified: cargo fmt only so far (builds and tests follow on potluck).
2026-11-11 04:01:35 -08:00
..