The rt backend played newTextureWithDescriptor:iosurface:plane: as a substitute, an ordinary
texture whose texels are undefined, so two textures over one surface shared nothing and the
3090 chain's rt plays varied where the old arm, which plays the texture over its receiver
buffer, repeated.
It now plays it as the product makes it: one Device::new_texture_for_views texture (an entry)
per receiver range (receiver buffer, plane, offset, bytesPerRow) and shape (width, height,
bytes a texel), with shader read and write, render-target and pixel-format-view usage, and
every recorded surface texture a view of it at the texture's own index. The receiver buffer
holds the pages' bytes as the stream writes them:
- a new entry is filled from the buffer by a blit in a command buffer of the backend's own,
committed at the making: after every earlier commit, with no wait;
- a new shape over a range first downloads the range's newest entry into the buffer at that
entry's extent, then fills the new entry, so bytes map by byte offset; an older shape's entry
goes once no texture of it lives and is not kept current, and the calls that name such a
texture after a newer shape are counted (surface_older_uses), argument buffers unseen;
- a copy from the guest's RAM into a range also copies the range into its newest entry, and a
copy back first copies the newest entry into the range, both in the copy's own blit encoder:
replace_region would land ahead of the encoders already in the command buffer, and get_bytes
would add a wait the old arm does not have;
- a recorded CPU write into a range uploads the texels it covers (replace_region) until the
buffer's first m2v.externalWriteDone, the new record of another API's write landing (a
decoded picture), which refills every entry of its buffer by a blit committed then; the old
backend plays that record as nothing;
- another call naming a receiver buffer as a buffer is refused, and a texture of a format that
reads across a surface's two planes is skipped (skipped_surfaces_across_planes).
The player leaves a receiver buffer's checks and snapshot ranges uncompared on every runtime
(verdict receiver, a receivers line), as the texels live apart from it; the rt backend reads a
texture back for a check, laid out as the old backend lays it out. The surface substitute key
goes; substitutes_read counts the tiled and gap substitutes (and their views) a call named, the
substitutes line naming the first, and the doc's claim that a substitute makes a play no gate
result, which no code made true, now says what holds. The surface record's keys move to args.rs,
shared by both backends.
Census before building (job 51225, gb-3090-r3): 653 entries made, none after an uncommitted
guest-RAM copy into their buffer, so a fill committed at the making misses no copy there.
Tests: the surfaces unit test (the texels a write reaches); the player's receiver test; the
device test of two formats over one surface, a new extent, a copy from the guest's RAM and an
older-extent use. To be run by the check job.