On a device that orders framebuffer fetch through the pixel interlock but
has no shaderStorageImageReadWithoutFormat (ANV), a fetched BGRA8Unorm or
BGR10A2Unorm color attachment was refused: SPIR-V names no image format
for B8G8R8A8_UNORM or A2R10G10B10_UNORM_PACK32, so neither the typed nor
the format-less declaration reached it. A guest pipeline of a fetched
BGRA8Unorm color 0 beside an RGBA16Float color 1 was refused on the Iris
Xe and aborted the consumer.
What changed:
- One public decision for the fetch storage view's format,
StorageAttachmentUse::view_alias_of(format, profile) (the old
uint_view_of took no profile). An 8-bit sRGB attachment keeps its
unsigned-integer view. A BGRA-order format the device accesses without
a format keeps its own format (RADV, NVIDIA, MoltenVK unchanged). One
no declaration reaches takes its RGBA-order twin (R8G8B8A8_UNORM,
A2B10G10R10_UNORM_PACK32) where the twin declares and stores. The
compile layer (lower/fragment/fetch.rs) and the runtime
(framebuffer_fetch::storage_view_format) both call it.
- The fragment reads and writes such an attachment through the twin,
exchanging red and blue in the shared read and write helpers
(read_texel, metal_order), so every read, written value, kept channel
and per-sample plane sees Metal's channel order.
- The runtime makes the views: a BGRA8Unorm render target's free STORAGE
candidate is made mutable to the twin (so ANV fetches it in place),
and stand-ins and sample planes take the twin as their storage view.
- StorageAttachmentUse::format_usages names the view's format (the one
the storage image is bound in), not the attachment's.
- Public rename: StorageAttachmentUse::uint_view and
WriteSource::TileAttachment::uint_view become view_alias (serde keeps
the old name as an alias), with StorageAttachmentUse::with_view_alias
and view_alias_of.
- The refusal names both routes where neither reaches (a BGR10A2Unorm
attachment without shaderStorageImageExtendedFormats).
The class, on a device without format-less storage reads: a fetch of a
16-bit packed attachment (B5G6R5Unorm, A1BGR5Unorm, ABGR4Unorm,
BGR5A1Unorm) stays a typed FramebufferFetch refusal, and a read of an
argument buffer's writable texture a typed ArgumentBufferTextures one;
both are FAST-PATHS known gaps. Kernel slots, tile passes and the depth
and stencil stand-ins already declare typed first.
SEMANTICS_VERSION 1753, RUNTIME_VERSION 1313, runtime-sources pin
recomputed. REFUSALS.md regenerated; docs/API.md says which view the
storage form binds.
Verified:
- Metal (M3 Max, macOS 27.0.1, our own MSL probe under the Mac GPU
lock): BGRA8Unorm and RGBA8Unorm targets, 1x and 4x, masks of every
channel and of red and alpha, one to three fetch_ordered draws: every
byte matches the model the device test checks (c read as c/255,
halved, written as the exact product with 255 rounded to nearest).
- ms01, Iris Xe (ANV, Mesa 26.2.4), release, --cfg m2v_gpu:
runtime_lane::framebuffer_fetch::bgra passes with Metal's bytes in
every case beside an RGBA16Float color 1 that keeps its clear. The
BGRA8Unorm pipelines are made with view_alias R8G8B8A8_UNORM (4
pipelines); single-sampled targets are fetched in place (no storage
form switch, no fetch-through-scratch notice), 4x through sample
planes viewed in R8G8B8A8_UNORM. The fetch lane
(runtime_lane::framebuffer_fetch::, 47 tests) and
tests::srgb_fetch_images pass there too: 48 of 48.
- ms01, debug: lower::fragment::fetch::tests (new: the twin on each
of four ANV profiles for BGRA8Unorm and BGR10A2Unorm at 1x, in planes, under
reads, writes and a red-and-blue mask; format-less profiles
unchanged; both routes named; the refused class),
engine_fragment::a_fetched_bgra_attachment_is_viewed_in_its_rgba_twin
(the consumer's two-attachment shape on intel-irisxe-anv, 1x, 4x and
a partial mask, the SPIR-V validated against the profile), with
engine_fragment, engine_tile, cache::tests, pipeline::api_tests,
pipeline::link::tests, fast_paths and api_surface: 217 of 217 pass.
With the twin decision forced off, the five new translator tests
fail, the consumer shape refused as on the Iris Xe (FramebufferFetch
needs AnyOf([[ShaderStorageImageReadWithoutFormat]])).
- clippy --workspace --all-targets --all-features -D warnings clean
plain, with --cfg m2v_gpu and with --cfg m2v_cpu_icd.