Hosting does steps 3 and part of 4 without the storage of step 1. It runs wherever the device has unified image
layouts (VK_KHR_unified_image_layouts), where every image is in GENERAL, so a layout for each subresource (step 2)
is not needed. Elsewhere targets keep images of their own and the takes, as before. The tables below compare it off
and on, with a switch the measurements had.
tex_create, tex_info): block linear,
2D, an array or a cube, one sample, its format as memory holds it, and a format the device can draw into.tex_take_drawn), the target is hosted (vk_rt_host), when it has
the texture's format, it is not scaled, and it covers the level's size and the layers whole. Its image goes, and its
attachment view is made on the texture's image at its level and layer. Its pixels are already there from the take.vk_surf_use keeps the host's, so a barrier names the host's whole image.vk_surf_level0 and vk_surf_layer0 (the
attachment views, the publishes, the loads, the takes into other textures, the sampled views). The other paths
first give the target an image of its own again with a copy (vk_rt_own): the moves of a parked target's pixels,
the present, the upscaler, readbacks, captures, crops and storage use.tex_image_swap, a free), its targets get images of their own (vk_tex_unhost).
Before a texture loads from memory, its hosted targets that memory lacks are published first (tex_hosted_publish).A target that its rows of whole GOBs make wider than its level (a 48x22 target over a level of 40x22, a 16x1 one over
1x1) is hosted too. Its view is the level's size (vk_surf_view_w): the render area, and so the scissors and clears,
the loads and publishes and its copy out stop there. A publish of it through the block linear move zeroes the
columns past the level. A texture of its own size samples it through an image of its own again.
Depth targets are hosted too. Their own paths take the place in the host: the depth packs of a publish
(vk_depth_pack), the copies of a save state (zt_copy) and the depth shadow (depth_shadow.c). The 2D engine's
blits (blit2d, blit_depth, resolve_depth) give a hosted source or destination an image of its own first. In the
race, the depth takes were 3.5 a present and 62 MB (3072x3072 shadow cascades into a 3-layer array), the largest part
of the bytes. They fell to none.
A texture's check of its pieces leaves out those under a fresh target it hosts (take_cover), as it left out those
a take would copy. A texture with holes in its mapping (piecewise) hosts nothing: its loads clear the image first.
An A/B/B/A of the race with all of the above, 2026-11-25:
| Hosting | fps (median) | GPU busy a present | Copy gaps a present | Takes a present |
|---|---|---|---|---|
| 0 | 81.2, 70.9 | 7.61, 7.82 ms | 1.10, 1.16 ms | 101, 99 |
| 1 | 83.0, 86.4 | 7.29, 7.00 ms | 0.76, 0.79 ms | 0.7, 0.5 |
Storage image surfaces are hosted too, where the texture has storage usage: a dispatch's image over a level or layer
of a texture writes the texture's image through its storage view. A hosted texture surface has no loads or takes of
its own: its checks are its host's (tex_check, tex_take_drawn), and a copy engine's write into its level goes to
memory, which the host's check loads. In the race this took the storage surfaces' takes from 12 a present to none. A
bound measured before (the takes left out) showed no gain in fps or GPU time there: other games use storage images
more.
A texture that is one level of another's layers, of its format and layer stride, joins that one as a view of its image
(vk_tex_join): its pixels are copied there once, and the targets it hosts move with it. One game samples each of its
reflection cubes alone (6 layers, 1 level) and in an array of the cubes (12 layers, 7 levels). The faces were hosted
in the cube, and the array took them each frame: 18 takes a present. Joined, the race takes 0.3 a present.
Not hosted yet: scaled targets.
An A/B/B/A of the race, 2026-11-24:
| Hosting | fps (median) | GPU busy a present | Takes a present |
|---|---|---|---|
| 0 | 78.1, 81.6 | 7.82, 7.60 ms | 104, 99 |
| 1 | 80.8, 83.3 | 7.40, 7.19 ms | 37, 35 |
With the padded targets hosted too, the drawn targets taken fell to about 11 a present, and the storage surfaces stay at 19.
After the rebase on main of 2026-11-25, an A/B/B/A of the race (main's changes made the race slower with hosting off, see below):
| Hosting | fps (median) | GPU busy a present | Copy gaps a present | Takes a present |
|---|---|---|---|---|
| 0 | 52.4, 59.3 | 8.53, 8.47 ms | 2.99, 2.59 ms | 96, 98 |
| 1 | 59.8, 64.5 | 7.87, 7.66 ms | 2.13, 2.07 ms | 5.5, 5.5 |
A Switch game's world (a load into an outpost) took 31.7 targets a present with hosting off and 0.1 with it on, at 60 to 66 fps off and 66 to 70 on, one run each.
Sync validation found no new hazard, and the screenshots match. About half of the hosted targets stay hosted. The others go back when their texture's image is remade or freed, and the next take hosts them again. A Switch game that makes no takes hosts nothing.
Made from docs/dev/one-image.md at 69237645142c. GPL-3.0-or-later.