Files
metal2vulkan/crates
Anees Iqbal a7672e9864 Lane-test ASTC HDR textures against Metal's decode on the device
New runtime_lane::astc_hdr_textures (any(m2v_gpu, m2v_cpu_icd)):

- astc_hdr_texels_read_as_metal_s: each of the fourteen _HDR formats,
  natively where the device holds its SFLOAT block, else through the
  carrier and twin. A new texture's zero blocks, then blocks from a CPU
  copy, a blit from a buffer, a fill of an HDR void-extent block and a
  copy from another texture: every texel's read and nearest sample
  compared with the decoder's Metal values (exact, NaN as NaN) where
  the twin carries them or the device samples through Metal's own
  texture unit; get_bytes and a blit into a buffer give the blocks
  back unchanged. It counts the decode passes, asserts
  carried-decoded-twin was announced exactly for the carried formats
  and decoded-texel-precision never, and prints which route ran.
- astc_hdr_textures_of_every_usage_are_made: an ASTC8x8HDR texture of
  read, write, render-target and pixel-format-view usage is made; a
  render pass into it is refused Unsupported and a kernel's write of it
  refused typed (Bind or Unsupported), where Metal's validation stops
  both; a view in the LDR form is refused on a carrier and otherwise
  reads the LDR decode of the same blocks.

The ASTC LDR lane's helpers it shares become pub(super).

Verified (which path each ran, from the lane's printed route line):
- MoltenVK on the M3 Max (--cfg m2v_gpu, through the GPU lock and
  memcap): both pass; 14 formats in their own block, Metal's sampler.
- lavapipe (scripts/linux-gate, --cfg m2v_cpu_icd): both pass; 0 in
  their own block, 14 in a carrier.
- The other five ASTC lanes pass on both devices.

(cherry picked from commit 9193d3e09fc1e0366e55035fcb29a81b9245ffe5)
2026-11-02 01:09:01 -08:00
..