Files
metal2vulkan/docs
Anees Iqbal 0a39715cf8 rt: texture views, a texture over levels and slices of its parent's image with image views of its own
Texture::new_texture_view(pixel_format, texture_type, levels, slices, index) is
newTextureViewWithPixelFormat:textureType:levels:slices: (and, with the
texture's own type and every level and slice, newTextureViewWithPixelFormat:).
A view is a TextureInner over its parent's image: its own sampled and storage
image views of the subresource range, its own index and elements of set 1, no
image, memory or copy. It keeps its first parent (a view of a view composes
the ranges), shares the parent's resource id so hazards between them are one
texture's, and reports Metal's view descriptor: the extent of its first level,
its levels and slices (probe texture_view_rules.m, job m3-max-43677: width 4
for levels 1..3 of an 8-wide texture, arrayLength 2 for slices 1..3).
place() takes the texture's base level and layer, so blit copies,
replace_region and get_bytes through a view reach the parent's levels and
slices under it. The view's image views go to the reaper (Free::Views) when it
drops; Gauges::textures counts views until then.

Built, from replay's compute-bound views (gb 18, b2 19): the parent's own
pixel format over every slice in its type, a slice subrange of a 1D or 2D
array, one slice of a 2D array as a 2D texture, each over any level
subrange. Refused as Metal's validation stops them (job m3-max-43677):
Refusal::TextureViewRange (empty or past ranges) and
Refusal::TextureViewFormat (another format without PixelFormatView usage).
Not built: Gap::TextureView naming the kind (TextureViewKind: PixelFormat,
TextureType, Slices, Swizzle).

Test (device cfgs): tests::view::every_device_views_levels_and_slices_of_a_texture:
six views and a view of a view report Metal's descriptor and read Metal's
bytes (the probe's FNV-1a 64 of each view's level 0 copied out), each view
costs 0 submissions, 0 blocks and 0 bytes copied; the three range refusals,
the format refusal and four gap kinds; views outlive their parents' handles
and every gauge falls to zero. The blit tests' Side carries the base.
README, REFUSALS.md and the signatures table updated.
2026-11-17 19:35:25 -08:00
..