What: on a device whose driver has DriverFact::ImageUsesMissBufferWritesInOneCommandBuffer
(NVIDIA's 620.70.06 on the RTX 3090), an inline pass's last instance may now stay open, and
the next render encoder may continue it, as on every other device. Before it continues,
EncoderCore::continue_pass checks the group's byte writes (FoldOrder::byte_writes, the
leader's summary or the group's order) against every image the continuing pass uses:
its draws' images (AliasWrites' images noted apart), its attachments, and the uses of the
copies and steps before its later instances (render/inline_splits.rs, waiting_uses), all
of which record into the tail after what the group wrote there. Where one meets, the pass
begins its own instance in its own VkCommandBuffer, the measured form, counted in
WorkCounts::command_buffers_split_at_aliases. Where none meets, it continues and takes
the group's writes as its own (AliasWrites::continues), so what it records into the tail
after its pass is checked as a joining encoder's is.
Why: continuation cut the glass-panel frame's GPU time 11-26% on the 780M and Iris but was
off on the 3090. The open instance itself never holds a buffer write: its draws touch only
attachments, and anything else that records into the tail ends it first. The tail before
it can hold one, though (the leader's earlier inline instances and what records between
them), so the check is what the fact needs.
Also: render_fold's Lane::continuing (622368ab37) goes, since its lanes continue on every
device now. A test-only DeviceShared::aliases_split_forced lets lavapipe take the 3090's path.
New tests: tests::alias_split's continues unit test; tests::alias_split_device's count case,
a copy out of a texture after a continuation, a later instance of one pass reading an
earlier one's buffer write, and a texture over another buffer of the same host pages
(the last two are byte cases for two possible gaps on the 3090).
Also e818e7b442: Continued passes: a pass's uses of bytes count in the alias check, as an aliasing texture's are.
What: AliasWrites notes the bytes of buffers that the commands noted apart use (bytes_apart).
AliasWrites::continues now refuses a continuation where those bytes, or a Bytes use among
the pass's other uses, meet the group's byte writes, besides its images.
Why: a texture whose linear image aliases a buffer's bytes (Storage::Alias) names them as
the buffer's bytes (Texture::image_use), not as an image range. The lavapipe run with the
split forced (m3-max-35002) showed a pass sampling such a texture over bytes the leader had
just written continuing anyway: (1, 1, 1, 2, 0) where (2, 1, 0, 3, 1) was expected. A
continuation is refused rather than guessed at: a draw that reads, through a buffer, bytes
the group wrote also begins its own instance on such a device.
Tests: the count case now reads the written bytes through a texture over a buffer and
And dae7c2cad8: alias_split_device: the counted and copy-after cases read a texture over a buffer alone.
Verified in the lane (m3-max-35085, msi, at dae7c2cad8): clippy -p metal2vulkan-runtime --all-targets
--all-features -D warnings exit 0; lavapipe (m2v_cpu_icd) alias_split and render_fold 36/36; the
count test forced: written read (2,1,0,3,1), quiet read (1,1,1,2,0), unforced (1,1,1,2,0), texels
right. Still running when landed: the 3090 correctness job (alias_split, render_fold; F1-F3 byte
cases), PHOENIX render suites, clippy m2v_gpu and m2v_cpu_icd, rustdoc, the 3090 glass A/B.
New Degradation kinds: none.