Under the identity binding domains a guest computes a texture's or sampler's gpuResourceID itself,
with no round trip: the index the consumer grants in the low 32 bits and a word in the high 32 bits
that is a pure function of the Metal descriptor. The guest's port needs the word specified and a
file of vectors both sides check.
- metal::resource_word::TextureWord::of(pixel_format, swizzle): bits 0-11 Metal's border texels
after the swizzle (the existing border_texels rule), bit 12 the out-of-bounds alpha of a format
without alpha, bits 16-31 the MTLPixelFormat raw value, so a texture's word is never 0. None for
the placeholders and the formats the translator holds no texture of or only copies.
- The sampler word is the existing SamplerWord, unchanged.
- docs/RESOURCE-ID.md: the ID's layout, the index classes (0 nil; storage-capable textures 1 to
4,095, valid in both arrays; other textures 4,096 to 65,535; samplers 1 to 3,999), both words'
bits and the level rule, and the vectors file. README's documentation table lists it.
- crates/metal2vulkan/tests/resource_words.tsv: 392 vectors (every pixel format with a word under
the default swizzle, each channel of seven formats from each other source, every sampler field
through its values, the level clamps around the points the nearest level turns at, and one
descriptor with every field changed). tests/resource_words.rs recomputes every line through the
public API and holds the file equal to what the generator writes; an ignored test blesses it.
- api_surface lists the new module; api_signatures regenerated.
Verified:
- msi job 40810 at the same tree: clippy -p metal2vulkan --all-targets --all-features -D warnings,
rustdoc -D warnings, nextest 18 of 18 (resource_words, the TextureWord unit test, api_surface,
api_signatures).
- msi job 40811 at the same tree: clippy under --cfg m2v_gpu and --cfg m2v_cpu_icd.
- msi job 40809: the bless test wrote the vectors; the combined sampler line (0x58f6ab53) and the
A8Unorm and R8Unorm texture lines checked by hand against the bit tables.