Files
metal2vulkan/docs
Anees Iqbal 0f2067150f rt: a draw of lines carries DeviceLineRasterization on every device; the raster test holds the diamond-exit rule's cells
What:
- RenderCommandEncoder::LINE_NOTE (PrecisionNote::DeviceLineRasterization)
  is the static note of a draw of lines or a line strip, and of a draw of
  triangles under the Lines fill mode, on every device.
- A render pipeline state no longer carries the note; it carried it only
  under alpha to coverage or alpha to one.
- The note's text (artifact.rs, docs/API.md's catalogue, its items list
  and the accepted difference on a line's tie-break, the runtime's README)
  names its grounds, and keeps what it said of a state with alpha to
  coverage or alpha to one: there the device's default line rule draws,
  not Bresenham's mode. One note, both facts.
- The conformance side announces LINE_NOTE for each line draw and each
  Lines fill mode set. The note is among replay's NATIVE_NOTES, so it
  loosens the notices site alone.
- known-gaps-rt.tsv: the 12 primitive-type-restart-indices rows (NVIDIA,
  RX 550, Iris Xe) cite the note. Their lines run through the boundary
  point (3.5, 1.0).
- api_signatures.tsv gains the const's two rows
  (scripts/api-signatures/signatures.py --check passes).
- Tests:
  - raster.rs's Lines pass draws the triangle (-0.65, -0.675), (3, -0.675),
    (-0.65, 3) through the target's own viewport. Its edges at x 1.4 and
    y 6.7 lie inside the target with a pixel on each side, and strictly
    inside the clip volume and the viewport.
  - The pass holds the diamond-exit rule's cells exactly, column 1 and
    row 6, on every device. A device that draws another cell fails with
    the target drawn. It does not read the corner where the two lines'
    ends meet.
  - draw.rs's alpha-to-coverage test now holds that no state carries the
    note, and that LINE_NOTE is it.

Why the note: a card draws a line pixel that differs from Metal's. The 12
ledgered rows are lines through the boundary point (3.5, 1.0): Metal on an
Apple M3 Max covers the lower pixel there, NVIDIA's driver the upper. The
runtime draws lines with VK_LINE_RASTERIZATION_MODE_BRESENHAM. Its diamond
is open, so no Vulkan control decides that pixel. The Vulkan
specification's section "Bresenham Line Segment Rasterization" also lets an
implementation's fragments "not deviate by more than one unit in either x or
y framebuffer coordinates from a corresponding fragment produced by the
diamond-exit rule", with a fragment count within one. Rule 1: a line's pixels
are the device's answer, so the operation carries a static note.

Why the test changed: the old Lines pass put its bottom edge at y 7.7 through
a viewport of y -0.3 and height 8. The Iris Xe drew none of row 7 there
(m3-max-63429 at ce998742d7, m3-max-63507 at 7c1baad228). With both edges
strictly inside the clip volume and the viewport, the Iris Xe draws the
diamond-exit rule's cells, as the other cards do. The fractional viewport's
cut row is a separate item, not a line rule.

Verified, column 1 and row 6 at the test's geometry:
- Iris Xe: m3-max-63735
- RTX 2080: m3-max-63736
- lavapipe: m3-max-63737
- RX 7900 XTX: m3-max-63707, at the same edges
The exact-cell form's legs are named with its sha.

Not a regression: the Lines pass came with a5fac6fa9b (11-20 22:51), and its
viewport moved at 2a36291a80 (23:32). No Iris run of the old pass passed.
2026-11-21 08:02:39 -08:00
..