Files
metal2vulkan/docs
Anees Iqbal e15d067fe0 rt: a texture view the image's own Vulkan format holds is made without PixelFormatView usage
A guest's Mac walk (58383) met Refusal::TextureViewFormat once: an A8Unorm view of an R8Unorm
texture made without PixelFormatView usage. Metal's validation layer stops such a view ("texture
usage (0x01) doesn't specify MTLTextureUsagePixelFormatView (0x10)"), and plain Metal makes it,
a blit out of it reading the texture's bytes (probe texture_view_rules.m, an Apple M3 Max under
macOS 27.0.1, jobs m3-max-43677 and m3-max-59523: R32Uint, RGBA8Uint, BGRA8Unorm and
BGRA8Unorm_sRGB of RGBA8Unorm; A8Unorm, R8Snorm and R8Uint of R8Unorm; R16Unorm of RG8Unorm).

- texture: without PixelFormatView usage, a view of a format Metal views the texture as with
  that usage (views_with_usage) is made where the view's Vulkan format is the image's own and only
  its component mapping differs, as plain Metal makes it: A8Unorm over R8Unorm is R8_UNORM with
  red read as alpha on every device (rt never exposes A8_UNORM). A view that needs another Vulkan
  format stays Refusal::TextureViewFormat: making every image mutable for it would cost every
  texture (rule 3).
- error: TextureViewFormat's doc and basis say so, with the probe's pairs; docs/REFUSALS.md
  regenerated. The runtime README records the divergence from Metal's validation in one sentence,
  of the form of the scissor and tessellation-factor-offset precedents.
- tests (view): on every device, an A8Unorm view of an R8Unorm texture of ShaderRead usage
  alone is made, and a draw sampling it (sampled_fragment into RGBA8Unorm) reads each texel's red
  byte as alpha, (0, 0, 0, r), exactly; an R8Uint view of it, another Vulkan format, is still
  refused, as is the R32Uint view of RGBA8Unorm without the flag. draw's CONSTEXPR is shared.
2026-11-20 11:12:35 -08:00
..