%% one line of a draw in the WIDE, NARROW or ALPHA_ANTIALIASED mode on an M1 (Metal has only aliased lines).
flowchart TD
A["Line-list or strip draw,
mode WIDE, NARROW
or ALPHA"] --> B["Vertex shader
captures its outputs"]
B --> C["Object function:
one thread per line"]
C --> D["Clip to w ≥ 10⁻⁶ and to the
viewport + 8 px, in clip space;
map to pixels with the
first vertex's viewport"]
D --> E{"mode"}
E -- "WIDE" --> F["Rectangle
1.4 px wide"]
E -- "NARROW, or ALPHA
without a float4 o0" --> G["Rectangle
1.0 px wide"]
E -- "ALPHA" --> H["2 px wide + ½ px caps
(+ √2/2 with MSAA),
corners carry across,
along and length"]
F --> I["Two clockwise triangles,
offsets scaled by w"]
G --> I
H --> I
I --> J["Metal rasterizes
(no depth bias)"]
J --> K{"ALPHA?"}
K -- no --> L["Pixel shader"]
K -- yes --> M["Pixel shader, then
o0.a × box-filtered coverage;
discard where it is 0"]