A texture over host pages that renders is always a shadow (in_place.rs:
ShadowCause::RenderTarget), the consumer's guest's IOSurface framebuffer
among them, and Texture::snapshot_color took only an image of its own or a
linear image over the bytes. So every draw that read such a target at its own
pixels after a barrier over the render targets split the render pass
instance, on every device: a keep of the whole shadow for the merge, a copy
of every texel from the bytes into the copy the reader reads, and a store and
load of the attachment, at each read (the guest's selfread probe on the Iris
Xe: 30 splits, 31 whole copies in and 30 keeps a frame, 98 ms).
The shadow is the image the pass renders, so the snapshot path serves it as
it serves an image of its own:
- the shadow image takes the feedback loop usage where that costs it nothing
(Device::if_free, as with_free_usage gives an image of its own), counted as
WorkCounts::feedback_loop_shadow_images;
- Texture::snapshot_color takes Storage::Shadow's image;
- RenderCommandEncoder::over_bytes (the snapshot at any area) takes a texture
that renders its bytes through a shadow too (Texture::renders_bytes), as
the split's copy there reads the bytes into the reader's copy after a keep
and a merge.
Every other check of render/snapshot.rs stands; the reads are the snapshot's,
exact as for an image of its own. The pass's shadow plan is unchanged: the
attachment is copied in before the instance and merged back as the encoder
ends, as before, without the keeps and copies of the splits.
Tests: runtime_lane::snapshot_reads::a_surfaces_readers_take_the_snapshot_at_any_area
now expects a snapshot for each reader of a surface over host pages wherever
the device takes the path and the image the pass renders took the usage (the
shadow's, or a linear alias's), its bytes unchanged. The self_reads lane
prints the images made with the usage. The WorkCounts field is in the
api_signatures table and host_ab's list; the FAST-PATHS row on attachment
reads names shadows.
(cherry picked from commit 60b9a69d393a097f8658af8bcb5a8d6ef3576441)