Pooled class: a bound in bytes past which a texture over pooled memory stays a shadow (TextureShadowReason::LinearCost)
Measured on the Iris Xe (probe 7933): a small cache's shadow costs a fixed 3.5-4.3 us a
command buffer that writes it, which a linear image at Metal's pitch saves, while caches of
1.4 MB and more render and sample 8-18% slower as linear images than as shadows with their
copies. Over Private memory both forms give the same answer (no CPU reads the bytes, the check
judges the first move), so this chooses between two speeds and takes no FAST-PATHS row or
switch. in_place::POOLED_PITCHED_BYTES bounds a texture's rows to their pitch, the same on every
device; past it the cause is ShadowCause::LinearCost, which the placement query answers as the
new public TextureShadowReason::LinearCost { bytes } through the shared route. docs/API.md (the
padding-unobserved reason) and HOWTO say why.
The bound's value here (256 KiB) is provisional: the size sweep on the Iris and the 780M places
it at the measured crossover in a following commit.
Verified: cargo fmt; api signatures re-blessed (one variant added); REFUSALS.md regenerates
unchanged; builds follow.
(cherry picked from commit 366e098c15c7227006ba7633ecda574da224690e)
This commit is contained in:
1 parent
85bf1ef03d
commit
6717cac4ea
9 files changed
+61
-5
No files matched your search
+5
-1
@@ -1610,7 +1610,11 @@ bound.
|
||||
does in the buffer's memory, holding no byte past them, and no `DRM_FORMAT_MOD_LINEAR` image at
|
||||
Metal's pitch serves (the device makes none, its policy is `HostPageTexturePolicy::Shadow`, or
|
||||
its check of such images over its pooled memory has not passed for the texture's accesses:
|
||||
pending, failed or unchecked, as over host pages); or the buffer is over the caller's
|
||||
pending, failed or unchecked, as over host pages); past a bound in bytes of its rows to their
|
||||
pitch, the same on every device, such a texture stays a shadow too
|
||||
(`TextureShadowReason::LinearCost`): there a linear image renders and samples slower than the
|
||||
shadow's own image with its copies, and over the device's own memory both give the same answer;
|
||||
or the buffer is over the caller's
|
||||
`VkBuffer`, whose memory backs no image of the runtime's; or it is a tiled texture of more than
|
||||
one level (`Buffer::new_tiled_texture`), over any buffer: no image over the buffer's memory holds
|
||||
levels past the first, so one image of its own holds every level, its first level's texels
|
||||
|
||||
Reference in new issue
Block a user