Files
metal2vulkan/docs
Anees Iqbal b31ce16c85 The uint2 rasterization-rate map overloads compile to Metal's decoder
A fragment shader's map_screen_to_physical_coordinates and
map_physical_to_screen_coordinates with uint2 arguments were refused
(Unsupported{RasterizationRateMap, NotImplemented} at the lowering of
Fragment::MapCoordinates). Canon now expands them beside the float2
overloads, reusing the float2 decoder:

- screen to physical: the float2 decoder at the pixel's centre (c + 1/2),
  converted to uint saturating (a NaN to 0), the conversion the float2
  index path already uses;
- physical to screen: the bits of the float (0 - offset) * reciprocal of
  the entry of granule c >> 5 on the axis's to-screen table; the
  coordinate's value within the granule is not read.

Both are Metal's answers as our probe rate_map_integer_overloads measured
them on an Apple M3 Max under macOS 27.0.1: 20,114 coordinates over four
maps (one of two layers), at each map's layers and two past them, every
one equal to these formulas. The arithmetic is float and the device's own
(owner rule 1); where a device's denormals differ from Metal's flushed
ones the existing PrecisionNote::DeviceDenormals reading applies, as for
the float2 decoder. The boundary byte of a table entry is compared on its
low seven bits, as Metal's decoder does (the probe's maps hit an entry
with the high bit set).

The decoder's Rust models gain shader_screen_to_physical_integer and
shader_physical_to_screen_integer. Lowering's MapCoordinates arm is now an
invariant error: canon compiles every overload before lowering.

Tests:
- bind::rate_map::apple_tests::metals_integer_answers: 1,561 of the M3's
  answers (apple_integer_vectors.txt: Metal's answers to our probe on our
  maps, no Apple binary) against the Rust models, each map's bytes
  checked by sha-256;
- tests::engine_rate_map::integer: the fixture rate_map_integer (kernel
  and fragment) compiles on every tested profile, robust and not, passes
  L3 with no RasterizationRateMap note; the interpreter's answers equal
  the decoder's arithmetic at every layer and two past, and Metal's on a
  map's own layers; and the translated kernel's answers equal the M3's
  recorded ones at all 587 recorded points of the maps' own layers, bit
  for bit;
- the fixture's four expectation rows go from the refusal to ok on all
  profiles; integer_rasterization_rate_maps_are_refused is removed.

docs/REFUSALS.md regenerated: the fragment select site leaves the
RasterizationRateMap sites.
2026-11-13 08:31:52 -08:00
..