What: a new zero-filled Private texture's first move is marked overwritable
(FirstMove::mark_overwritable). An encoder notes each such texture it writes
whole before any of its commands reads it, decided from its own description,
never a shader's (encoder::Overwrite, on its first part):
- a render pass that loads every aspect of it Clear (as the descriptor set
it, before DontCare loads take clears) and stores it, rendering it itself
(no stand-in, sample planes or separate depth and stencil scratch) over its
whole extent, the image of one level and one layer
(PassLayout::overwrites);
- a blit command whose box covers its whole extent in every aspect
(BlitCommandEncoder::scrub).
At a batch's take (command_buffer/submit.rs, first_overwrites), an
overwrite counts where its part has no segment, only blit parts with no
segment that name nothing of the image come before it (any other encoder may
reach a texture through its resource ID, unnamed), and the part's own uses
read nothing of the image but its attachment's own reads (a pass) or
nothing at all (a blit). FirstMoves::take_holding then takes that move
without its zeros (unzeroed, undone if the submission is given back): the
layout move stays, and batches on other VkQueues wait for this batch as for
any first work. A part that runs nothing drops its overwrites (fail_part).
DontCare and Load first uses, and partial writes, keep the zeros. Counted:
WorkCounts::private_textures_overwritten_unfilled (new public field,
signatures re-blessed); the runtime README and docs/API.md say so.
tests::first_overwrite checks both paths (whole pass, depth pass, whole
copy, a recycled image's clear; DontCare, Load, a partial copy, a clear after
another pass) and first_overwrite_costs (ignored) prints OVERWRITE-COST,
for textures made together before the first commit (the first submission
takes every waiting first move, so only its own texture goes unzeroed) and
for textures each made just before its own command buffer (every one does).
Why: the zeros are for isolation only (main's plan for pin 64): a first use
that writes every texel before anything reads one never shows them, and
they cost the Iris Xe up to 0.22 ms a 2048² depth texture (job 24088).
Verified: before this replay onto development, at 9ab0b01426 (on a67e1e3d55):
the validation lanes touching first moves, recycling, clear reach, resolves,
blits and heaps on lavapipe (job 24205, 358 passed); on the Iris Xe (job
24218) tests::first_overwrite, memoryless_fresh and recycle (9 passed;
FIRST-OVERWRITE whole: 1 each) and OVERWRITE-COST zeroed against skipped:
made together, 8 RGBA8 1024² 2.136 against 2.100 ms median, 2 Depth32Float
2048² 1.693 against 1.487 ms, one texture a burst unzeroed. At this commit,
tests::first_overwrite and the runtime suite on lavapipe, clippy (plain and
m2v_gpu) and rustdoc, and the each-made-before cost on the Iris, reported
with this sha.