Cut a draw's and a pass open's allocations

Compare a draw's graphics key in place, keep a drawing state's routing for the pass colors it last
met, write descriptors from the stack and allocate the set in place, keep a draw's small lists on
the stack, hold what a draw retains by reference in one entry per encoder, find a draw's bind shape
among its state's settles, fill push bytes in place, bound coverage without allocating, gather named
keys only once a draw reaches the resident set, compare viewport compensations as they come, list
argument samplers again only where the device's changed, and keep each pass shape's compatible
render pass on the device (up to 64 shapes). The frame-cost lane bounds a draw at 27 allocations and
a pass open at 14.

Gain: allocations per draw from 67.5 to 24.5 and per pass open from 18 to 13 on RADV, ANV and
lavapipe. Frame CPU on ANV (Iris Xe), clean rounds: 5.66 -> 5.02 ms.

Verified on the original branch: the runtime lanes, 1313 of 1313 on RADV, ANV and lavapipe. This
squashed commit (with the wake fix under it) was not re-tested on its own.
This commit is contained in:
Anees Iqbal committed 2026-10-14 12:15:47 +03:00
1 parent 965eb0b538
commit bd21b102f5
35 files changed
+1185 -311

No files matched your search

@@ -182,7 +182,7 @@ impl State {
// recording does.
for segment in recorded.segments.drain(..) {
if let Some(mut before) = segment.recorded {
self.retained.extend(before.retained);
self.retained.extend(before.retained.into_entry());
before.taken.retain_into(&mut self.retained);
}
self.retained.push(Box::new(segment.work));
@@ -215,7 +215,7 @@ impl State {
self.retained.push(Box::new(first));
}
}
self.retained.extend(retained);
self.retained.extend(retained.into_entry());
self.retained.push(Box::new(heaps));
Ok(())
}