A render pass over a rasterization-rate map that executes an indirect command buffer the GPU
may write goes to the host step. There the host read every record, decoded it and drew each
command through the probe and the fan-out routes. On the consumer's RTX 3090 that step took
44.7 ms of a 65.8 ms frame, reading 781 records a frame. The only rule its executions broke was
the rate map's.
At a host step that fans the pass's triangles out, an execution whose records the GPU may write,
and which takes its merged GPU form once the rate map's rule is passed over (the cause.rs
decision), now takes its GPU route (render/executions/gpu_route.rs):
- The step records the form's prework: the head, the preprocess and the two merge passes. It
copies each command's first corner and the merged draw's two VkDrawIndirectCommands to the
host, submits that with a fence and waits, as it does for its probe.
- The host reads those words and no record. Each command that draws becomes one direct draw of
its corners in the state's merged variant, with the merged header pushed
(RenderLowering::merged_header).
- The probe and the routes take those draws as they take commands the host read: probed, then
fanned out, boxed, in parts or region by region. A long corner draw is cut into piece-sized
ranges, as an indexed command is.
- The host reads the records as before where the total reaches MERGED_CHUNK corners, where the
prefix does not rise to the total, or where the prework did not complete.
RenderExecution::record_gpu's prework moves into RenderExecution::prework, which both paths
share. The replay loop takes a GPU route's corners beside the records the host read (Replayed,
StepCommand). The new counters are WorkCounts::rate_map_gpu_routes and
rate_map_gpu_route_wait_nanos.
Tests:
- New, tests::rate_mapped_gpu_route. Eight commands of a buffer that inherits the encoder's
pipeline state: grids, one in two instances, one without indices, and the large, medium and
wide triangles the probe flags. Each command is nearer than the one before, under LessEqual
depth and half-alpha blending. It asserts no record read, one route, one probe and three
flagged draws, and that the colour and Depth32Float bytes equal the encoder's own draws.
- Changed, tests::host_step_rules. Its empty command, through the route, counts as
nothing_to_probe.
Also in this landing (the lane's later commits):
- d2728b735e: the step's commands are one vector of reads or of corners (no per-command enum of 3.3 KB); clippy.
- 51afad9359: HostReplayedIndirectCommands' cost names the GPU route's second round trip (the notice's text changes).
RUNTIME 2325: an unchanged artifact's rate-mapped host step now decodes GPU-written records on the GPU, and the
notice's text changes. Negative controls (m3-max-30703): the plan.rs lifts reverted fail
a_merged_draw_s_variant_fans_out (NotImplemented(RasterizationRateMap)); the route turned off fails
rate_mapped_gpu_route's counts ([8, 0, 1, 3] against [0, 1, 1, 3]).