In place: 1- and 2-byte texels a shader writes, checked apart by the device's check
In every guest session reims measured (Iris Xe and Radeon 780M, macOS 26.7.2 guests), host_texture_shadows_store_width was 114, from 23 distinct R8Unorm, A8Unorm and R16 textures a shader writes (32x32 at 256-byte rows among them). They were shadows because the in-place check's write kernel stored only 4-, 8- and 16-byte texels (STORED_TEXEL_BYTES, ShadowCause::StoreWidth), so no check covered a driver's writes of narrower ones. What changes: - in_place.rs (from selfread's parked 0c587bcad5): Access gains NarrowWrites and NarrowBufferWrites, with 36 verdicts instead of 24. Access::written picks the writes check of a texel width and padding. STORED_TEXEL_BYTES holds 1, 2, 4, 8 and 16; NARROW_TEXEL_BYTES holds 1 and 2. in_place asks the written check in place of Writes. The report names "narrow writes" and "narrow buffer writes". CHECK_VERSION goes to 9 (development's dma-buf import fix took 8). - in_place_check.rs: NARROW_STORE_SHAPES, rounds of their own for the narrow accesses, through the copy-in kernel's R8_UINT and R16_UINT views (a801dac7d7). The shapes are packed R8 256x16 and R16 128x16 at 256; R8 61x37 and R16 45x29 at 256, whose rows end inside a word and whose heights are odd; the 16- and 64-byte tight pitches; and an R8 1024x1024. The source buffer holds a word per texel, the texel's bytes low and zeros above, since CopyIn takes 4*words() bytes a texel. A narrow round's change fails only the narrow verdicts, never a 4/8/16-byte texture's. A device whose kernel or image is not made (no shaderStorageImageExtendedFormats) leaves them unchecked. - in_place::storable: one helper for a render target's storage usage, used by route.rs and storage_form.rs. It asks Access::written(texel, Padding::Kept) instead of Writes, so a narrow render target never takes the 4-byte verdict. writes_reach (the storage usage an image that does not render takes beyond its usage) and fresh_pages_take ask the written check of the texels' width; InPlaceWatch carries the width. - InPlaceAccess::Writes covers the narrow accesses. Docs (in_place, the check, API.md, HOWTO, FAST-PATHS row, runtime README, WorkCounts, HostPageTexturePolicy, TextureShadowReason) say 1, 2, 4, 8 and 16 bytes, with narrow writes checked apart. The lane's VERDICTS goes to 36. Tests: - The decision test runs every width, 3 bytes for StoreWidth among them, against narrow answers that differ from their wide twins'. It also checks storable. - Shape tests cover the narrow set: tight pitches, row ends at 16/64/128/256, free padding. - New: each_check_of_storage_writes_stores_its_texels_width. A narrow tally case. - New device test narrow_writes_device: the guest's 32x32 R8Unorm and A8Unorm (and RG8Unorm and R16Unorm) at 256-byte rows over a no-copy buffer. Each takes its narrow verdict's path, its placement query agrees, a kernel's writes reach the bytes, and the padding and the bytes past the last row are kept. - in_place_storage adds an R8Unorm render target. Verified: not yet built; the build, clippy, unit and device runs follow as jobs. (cherry picked from commit dbb985df199b1c46bb783aafbd50efd40bcab187)
This commit is contained in:
1 parent
c35d95b08f
commit
6575c031f5
20 files changed
+768
-165
No files matched your search
+12
-7
@@ -330,15 +330,15 @@ and write every byte bound to it, where Metal keeps every CPU write to bytes a c
|
||||
not write; a render pass's load and store operations may too, for an image it renders. Under the
|
||||
default `HostPageTexturePolicy::InPlace` the runtime relies on the driver there, checked: a texture
|
||||
over host pages whose declared usage samples, reads, renders into it or writes it through a shader
|
||||
(`ShaderWrite` or `ShaderAtomic`, of texels of 4, 8 or 16 bytes) is a linear image aliasing the
|
||||
pages (one over dma-buf pages a `DRM_FORMAT_MOD_LINEAR` image over a dma-buf of its own pages, acquired
|
||||
(`ShaderWrite` or `ShaderAtomic`, of texels of 1, 2, 4, 8 or 16 bytes) is a linear image aliasing
|
||||
the pages (one over dma-buf pages a `DRM_FORMAT_MOD_LINEAR` image over a dma-buf of its own pages, acquired
|
||||
from `VK_QUEUE_FAMILY_FOREIGN_EXT`) wherever the device makes such an image and its own check
|
||||
passed for that kind of pages and each of its accesses (`WorkCounts::host_textures_in_place`,
|
||||
`dma_buf_textures_in_place`, `fresh_page_textures_in_place`, and `host_textures_in_place_written`
|
||||
for one a shader writes), on a discrete GPU as on any other. A texture that renders takes the
|
||||
feedback loop usage where the device makes the image with it, and the storage usage too where the
|
||||
check passed for a shader's writes over that kind of pages and its texels are of 4, 8 or 16 bytes
|
||||
(with it a shader writes the texels in place, as one declared to), so a draw that reads it after
|
||||
check passed for a shader's writes of texels of its width over that kind of pages (with it a shader
|
||||
writes the texels in place, as one declared to), so a draw that reads it after
|
||||
a render-target barrier reads it through a snapshot (`WorkCounts::feedback_loop_alias_images`);
|
||||
without the storage usage such a draw splits its pass. The
|
||||
check makes such images of every texel size, small and 3840x2160, over each kind of pages while a
|
||||
@@ -348,7 +348,11 @@ their first move, their moves into the feedback loop layout and back, and a rend
|
||||
clears and stores them, while the CPU writes the bytes between their rows and after them; and for
|
||||
one a shader writes, images made with `ShaderWrite` usage, whose every texel a kernel stores
|
||||
through an unsigned-integer view of 4, 8 or 16-byte texels while the CPU writes the bytes beside
|
||||
them (a program's atomics are among no round). Each verdict is given apart for texels that share
|
||||
them (a program's atomics are among no round), and apart from those, images of 1- and 2-byte
|
||||
texels stored through `R8_UINT` and `R16_UINT` views, rows of which end inside a 4-byte word: a
|
||||
driver may store a narrow texel through a wider access, so 1- and 2-byte texels take verdicts of
|
||||
their own, and a byte their rounds changed keeps no wider texel's texture a shadow (a device
|
||||
without `shaderStorageImageExtendedFormats` leaves them unchecked). Each verdict is given apart for texels that share
|
||||
a line of the device's memory (`nonCoherentAtomSize` bytes) with bytes beside them and for texels
|
||||
that share none (their first byte, their end and, with bytes between rows, each row's start and
|
||||
end on a line): a device that writes back a texel's line whole puts an older value back over a
|
||||
@@ -374,8 +378,9 @@ write reaches them as it reaches the buffer's.
|
||||
|
||||
Every other texture over host pages is a shadow (`shadowed-texture`, the notice naming why): under
|
||||
`HostPageTexturePolicy::Shadow` (`DevicePolicy::exact_answers`); one a shader writes of texels of
|
||||
1 or 2 bytes, which the check's kernel stores none of; one made before the check for an access of
|
||||
its answered, or where it failed or made no image; and one no image in place serves (its format or
|
||||
a width the check's kernel stores none of (none of 1, 2, 4, 8 and 16 bytes); one made before the
|
||||
check for an access of its answered, or where it failed or made no image; and one no image in
|
||||
place serves (its format or
|
||||
usage the device makes no linear image of, the bytes' pitch, placement or memory, or over dma-buf
|
||||
pages no dma-buf of the texture's own pages). `WorkCounts::host_texture_shadows_*` counts each
|
||||
reason apart (the texel width, `_store_width`), and of them all those whose usage renders into
|
||||
|
||||
Reference in new issue
Block a user