Files
metal2vulkan/crates
Anees Iqbal c8fa4e9440 rt: a render encoder keeps a line width; a draw of lines at another width than 1 is Gap::Draw{LineWidth}
A gap against the old runtime. Apple's private setLineWidth: has no rt setter, so the rt player
refused the call ("not played on a render encoder") and every rt play of a stream that sets it
stopped at its first call, while the old runtime plays it.

RenderCommandEncoder::set_line_width(f32) keeps the width the encoder's later draws see, Metal's 1
until set, each encoder starting at 1. Every width is accepted, as on Metal. The runtime draws
lines at width 1 alone: its pipelines fix the width at 1, and Vulkan's wider lines are a device
feature (wideLines) that the floor does not require, so no second form is built on it. A draw of
lines or a line strip while the width is not 1 is the new DrawKind::LineWidth, refused at the
draw before anything is recorded; a draw of no vertices records nothing as at any width, and a
draw of triangles runs at any width, as Metal's filled triangles do. A triangle fill mode of lines,
which Metal draws at the width, is already refused where it is set (DrawKind::FillMode).

The player plays setLineWidth: into the setter; a line draw under another width is then the
runtime's gap, skipped and counted like any other.

Also: fill_push's doc comment had landed above `primitives`; it is back on its function.

Docs: the setter's doc names Metal's counterpart (the private setLineWidth: of
MTLRenderCommandEncoder) and what is refused; DrawKind::LineWidth says why; the rt README holds
the width in the encoder's state and the draw in its known gaps. api_signatures gains the method
and the variant. refusal_surface.py regenerates docs/REFUSALS.md with no change: it lists
Gap::Draw by its raise sites, and the new kind is raised in draw, already listed. api_surface pins
the translator's module roots alone, so no row moves.

Tests: tests::draw::on_device::every_device_draws_lines_at_width_1_alone (width 2: a line and a
line strip refused with DrawKind::LineWidth, an empty line draw and a triangle draw; width 1 again
and a later encoder's default: lines draw their rows) and
runtime_lane::rt_replay::a_line_width_plays_and_a_line_drawn_at_another_width_is_skipped (at 1
nothing skipped; at 2 the line is skipped and counted as Draw { kind: LineWidth } at its call).

Verified: the check job named at hand-over compiles it and runs the touched tests.
2026-11-19 05:41:47 -08:00
..