Files
metal2vulkan/docs
Anees Iqbal 57c21dc6bb Draws unlike their kept draw only in their own arguments are rebound with them
In reims' pin-26 glass walk, 69,981 of 70,882 draws unlike their kept draw differed only in
their arguments (draws_unlike_kept_arguments_alone, all of them in the index offset), and each
took every step. Such a draw, of something to draw, now goes to the rebound path
(render/draw_again/rebound.rs), whatever its tables' stamps, and works out again each step that
reads its arguments:

- its route, which reads them only through whether the draw may make a primitive
  (line_width::draws_primitives): the draw goes on only where that is the kept draw's;
- its commands' Vulkan draw, index overrun, BaseVertexInstance push fields and index buffer use,
  through a new BindingPlan::redraw_apart_into, which answers Ok(false) where the plan reads the
  arguments some other way (a stage's argument or root table, a mesh, patch or de-indexed draw)
  or a fixed-function vertex buffer's fetch window moves with them;
- its pulled attributes' reach (check_vertex_reach, as before, now of the new draw);
- its index buffer's use, patched in place as a moved slot's use is
  (binding::patch_command_uses), so a moved, narrowed draw checks, notes and gathers it with
  the moved slots' uses;
- its index buffer's bind (IndexBind::of of the new source), recorded where the record holds
  another, with its new draw; the kept draw takes its arguments, index source and draw.

A stop at one of those steps is counted (WorkCounts::draws_rebind_stopped_arguments) and the
draw takes every step; a rebound one is counted in draws_rebound_arguments. A draw of other
arguments that draws nothing still takes every step and is counted unlike, as before. The
draw-again debug check covers the new form: the kept draw it compares is the kept draw with the
new arguments, and the rebound check now compares the recording's Vulkan draw and index buffer
bind as well as its draw state.

New public items: BindingPlan::redraw_apart_into (docs/API.md), WorkCounts::draws_rebound_arguments
and draws_rebind_stopped_arguments (api_signatures blessed). Tests: the translator's
draws_of_other_arguments_redraw_what_every_step_writes holds redraw_apart_into to every step's
commands (first index, count, base vertex, a robust overrun) and to Ok(false) where a window
moves, for another kind, index type or buffer, and a de-indexed plan, and to every step's error
past a multiview limit; the runtime's draws_of_another_first_index_alone_are_rebound_with_their_pixels
draws each rectangle by its first index alone, then by its base vertex alone, rebound, with the
commands, state commands and pixels of the same draws taking every step; the unlike-count test
now holds one draw rebound with other counts, one stopped at its route and one of nothing.

(cherry picked from commit ab3e5002bbd6bf8dde7c2761bf7d12ab4461b555)
2026-11-08 20:04:26 -08:00
..