A draw that samples a texture its own pass renders reads the texture's shadow, a copy taken
before the pass's load actions (texture/attached_reads.rs). In a pass that clears the color, a
first draw that sampled it with no barrier read the texels from before the pass at every pixel it
read: the M3 Max's answer, while both x86 Macs read the clear there (probe ownread: no draw
before it, so the load and the draws before it wrote only the clear). The copy was cleared to the
clear (Texture::cleared_copy, vkCmdClearColorImage) only after a memory barrier before the pass's
first draw.
The Macs disagree, so Metal's answer is either; the macOS guests are x86 ones, and a clear of the
copy costs less than a copy of the texture. RenderLowering's draw now takes the cleared copy for
every draw that samples a color the pass clears before any draw of the pass recorded, wherever
Texture::cleared_copy holds (a whole single-sampled 2D texture of one level and slice that one
color renders in place), with a barrier before it or none; the draw keeps nothing to draw again,
as after the barrier. A pass that loads the color, and every read outside cleared_copy, read as
before.
Tests: attachment_reads' no-barrier lane becomes a_first_draw_with_no_barrier_reads_its_pass_s_load,
Load and Clear over both target kinds, the texture of its own image taking the cleared copy
(attachment_read_clears) and reading the clear where the pass clears; check() counts a cleared
copy as taking no split's place with no barrier. framebuffer_fetch gains
a_first_fetch_after_a_clear_reads_the_clear (a fetch after a Clear reads the clear, not the texels
from before the pass). The conformance rows pass-start-barrier-*-sample with no barrier accept the
clear too, as the -read rows did. docs/API.md's accepted differences and attached_reads.rs's docs
say which Macs answer what.
Verification: the jobs that compile and run it are reported with this sha.
With: 645f1c3323 snapshot_reads' first test makes its readers' pipelines before the counted pass; af0a44cc6d The render lanes and inline-split tests read their fixtures where the test runner names the crate; 8b5cd6dfb4 attachment_reads' first-draw lane lets a target over a buffer's bytes take the cleared copy too (test-only).
The user's GitHub issue 17. Compiled in m3-max-31319 at 8b5cd6dfb4 (clippy x3; lavapipe lanes, the first-draw lane, the
fetch-after-clear lane, the 14 pass-start-barrier conformance rows exact and default; the negative fails).