Files
metal2vulkan/docs
Anees Iqbal 0ecac16dd3 rt: a render state answers Metal's imageblock sample and memory lengths; one imageblock gap
The consumer asked for RenderPipelineState's imageblockSampleLength and
imageblockMemoryLengthForDimensions:. Metal's render answer is not 0 without an explicit
imageblock: it counts the color attachments' texels (measured on an M3 Max and an M4, and kept
by the translator as metal::format::imageblock_sample_length: [R8Unorm, R32Float] is 8). rt makes
no state whose fragment function reaches an imageblock (RenderPipelineKind::Imageblock), so a
state's sample is its colors alone, computed once per content from the descriptor's color
formats; the memory length is that times the width, the height and the raster sample count, none
rounded, as the old runtime answers it from the same measurements. A color format with no
measured place in Metal's record answers the gap.

The gap is one variant for both states: Gap::ImageblockMemoryLength { dimensions } becomes
Gap::ImageblockLength, which the compute state answers for a kernel that declares an imageblock
it never reaches (or whose compile kept no reflection to tell) and the render state for an
unmeasured color format. The compute state's imageblock_memory_length_for_dimensions answers u64,
as the render state's does.

Test: every_device_answers_a_state_s_metal_answers also makes a render state of R8Unorm and
R32Float colors: 8 bytes a sample, 512 for 8 by 8 pixels of one sample. README (render states;
the compute paragraph's gap name), api_signatures.tsv and REFUSALS.md regenerated.

Verified at this commit: cargo fmt only. The build and device legs run on the lane's tip.
2026-11-19 02:36:04 -08:00
..