Files
metal2vulkan/docs
Anees Iqbal 1210972f03 Hold multisampled word-format textures in their word's format
Metal makes 2- and 4-sample textures of R8Unorm_sRGB (11), A1BGR5Unorm
(41), ABGR4Unorm (42) and RGB9E5Float (93) for every usage, memoryless
included (our probe msaa_word_formats.m, M3 Max, macOS 27.0.1). The RTX
5080 samples these formats but renders none, so Vulkan states one
sample for their images and the runtime refused each at creation
(TextureSampleCount, FramebufferColorSampleCount(4)).

What changes:
- image_plan::word_samples: where the device samples the format, renders
  it at no count and renders the word's format (R8_UINT, R16_UINT,
  R32_UINT), a multisampled texture's image is the word's format,
  mutable to the format's sampled view (and an 8-bit sRGB format's UNORM
  twin, for its resolve). Every sample holds Metal's word by
  construction: the existing word lowering writes it, clears write
  Metal's clear word, reads decode through the format's view, copies are
  bitwise. Shader writes stay unavailable (Metal writes no multisampled
  texture from a function). A device that renders the format keeps its
  native image.
- The resolve of such an attachment is the crate-owned one: Metal's for
  RGB9E5Float and 8-bit sRGB, a near-equivalent within one code for the
  packed formats, announced as the new Degradation::WordResolve
  (word-resolve). The NotImplemented(Format) refusal of word resolves in
  resolve.rs is gone; an attachment that takes neither input attachment
  usage nor the copy is still refused.
- DeviceOptions::withheld_attachment_formats (doc hidden, a test hook):
  a device made with formats' color attachments withheld, so the word
  path runs on MoltenVK, which renders all four.
- RUNTIME_VERSION 1721. Docs: API.md (word bullets, the multisampled
  word paragraph, the word-resolve catalogue entry), FAST-PATHS known
  gaps (word resolves no longer refused), word.rs, image_plan.rs and
  resolve.rs module docs; runtime-sources pin recomputed.

Routes over the committed profiles (tests::word_samples, pinned): the
word for all four formats at 2 and 4 on NVIDIA's three profiles, for
R8Unorm_sRGB and RGB9E5Float on ANV's four, and RGB9E5Float at 4 on the
gate's lavapipe; native on MoltenVK and RADV; refused where the word's
format renders one sample or the textures take no such count
(swiftshader, lavapipe's profile, the floors).

Verified:
- cargo nextest run -p metal2vulkan-runtime --all-features: 1188 pass
  (the three word_samples planning tests among them).
- Device lane runtime_lane::word_samples_msaa on the M3 Max through
  MoltenVK (--cfg m2v_gpu, maclock), new owned fixture wsm_samples: the
  device as it is (each format natively) and with the four attachments
  withheld (each held in its word, printed per format). On the word path
  every stored sample is Metal's word (all 32 or 64 per shape), reads
  decode them, the sRGB and RGB9E5 resolves are Metal's in every pixel,
  the packed resolves within a code (7-9 of 16 pixels exact after a
  draw, 13-16 after a load), a packed blend's words Metal's in every
  sample. word-resolve and shader-resolve announced. Negative control:
  with word_samples disabled the lane fails.
- clippy -D warnings (default and --cfg m2v_gpu), rustdoc -D warnings,
  private intra-doc links at their ceilings, refusal_surface --check,
  api_signatures --bless (DeviceOptions field, Degradation::WordResolve
  added), METAL-COVERAGE and CONFORMANCE-COVERAGE --check current.

Not in this change: the golden tables for the new fixture
(golden_hashes, the engine inventory, the air_input printout) are
re-blessed on development. Blends of an 8-bit sRGB or RGB9E5Float word
stay refused as the device lacking the format, as they are at one
sample.

(cherry picked from commit ad8b94cd840f3d0bf4bb9552904fbdf2f253b9af)
2026-11-02 01:32:20 -08:00
..