WIP: perf(vk): a save's textures are made and uploaded during its loading screen, not at their first draw (RX_VK_TEX_AHEAD=1, off by default) #1122

Draft
p0lux wants to merge 2 commits from p0lux/Longshot:perf/textures-ahead into main
Contributor

Type: perf · Risk: low · Tested on: Linux (SteamOS), Steam Deck OLED (RADV VANGOGH) · Needs: none to merge it off; a desktop card (NVIDIA or AMD, Windows or Linux) before it is on by default

Why

After a save is loaded, the first seconds in the area stutter: on a Steam Deck, Kokiri Forest has 7 or 8 frames of 150 ms or more in its first 600, 3.3 s of them in all, and Hyrule Field 4 or 5, 2.3 s. The renderer makes and uploads a texture at the first draw that samples it, so the area's 800 to 1,200 textures all come in those frames, although the game made them 5 to 60 seconds before, during the loading screen, where nobody would notice the work.

This does that work on the loading screen. It is for the arrival after a save is loaded only: it does nothing at an area change in play (measured below), which is #1069's subject.

What changed

With RX_VK_TEX_AHEAD=1 the renderer remembers the textures a draw sampled soon after the game made them, and the next time the game makes one of them it is made and uploaded during a light frame, before its first draw. Off by default: without the switch nothing is remembered, nothing is prepared and no file is written.

  • rules: gpu/vk/texture_ahead.h (new, no Vulkan in it). signature() tells a texture by its shape and eight runs of 64 bytes of its storage; place() ties it to where the game put it (kept by signature alone, every area prepared what any area had drawn: 1,910 textures for the 770 Hyrule Field draws, 0.8 GB more video memory); learnable() keeps only a texture first drawn within 90 s of its making (one met minutes later in play would be prepared at every load); allowance_ns() lets a frame prepare only after a frame of under 200 draws (a loading screen has 5, the title and the menus under 100, play over 1,000: told by draws, not by time, so a fast PC does not prepare in play); room() keeps 256 MB free under the texture cache's budget, so a texture prepared never pushes another out; Queue holds what the game has made, oldest first, a second after its making and for two minutes at most; remember() bounds the list at 32,768 entries (256 KB), starting it again when full; load_drawn() / save_drawn() keep it in the game folder's cache/longshot_textures_drawn.bin, written through a file beside it.
  • vk: gpu/vk/vk_texture.cpp: texture_ahead_made() and texture_ahead_gone() take the host's announcements (block-compressed textures in the game's own memory only: ahead_wanted()); upload() notes a draw's first upload (ahead_learn()); texture_ahead_frame() sets the next frame's allowance from the frame's draws and writes the list when it changed (every 300 frames at most); texture_ahead_run() takes textures from the queue and, for the ones in the list, calls texture_get() as a draw's first use would, up to 12 ms a frame (RX_VK_TEX_AHEAD_MS).
  • vk: gpu/vk/vk_replay.cpp: texture_created_of() and texture_released_of() pass the announcements on; run_submit() calls texture_ahead_run() once a recording has begun, before the submission's commands, so the uploads go into that recording; status_tick() gives texture_ahead_frame() the frame's draws.
  • tools: scripts/dev_packs.py counts longshot_textures_drawn.bin among the game folder's caches.
  • checks: tests/test_texture_ahead.py compiles and runs the rules (tests/test_texture_ahead.cpp) and reads the renderer for where they are used (cut with tests/srccut.py).
  • docs: docs/development.md has the switch's row; a run file in docs/tested/.

Measurements

Verdict: it helps the arrival after a save is loaded, on a Steam Deck OLED: the frames of 150 ms or more in the first 600 frames of play go from 3.35 s to 1.22 s in Kokiri Forest (7 or 8 frames to 2 or 3) and from 2.30 s to 1.41 s in Hyrule Field, the runs of the two sides not overlapping; the 1% low goes from 1.9 to 3.6 fps and from 2.4 to 3.5 fps, the frame rate over those 600 frames from 20.7 to 22.5 fps and from 23.6 to 24.5. The first load of a save only fills the list and is as main. It does not help an area change in play (last table). Cost: 35 to 100 MiB more GPU memory, nothing measurable on the time to reach play. Passed: no error in 16 runs. Not looked at on a screen (the Deck ran headless).

Hardware: SteamOS 3.9.5 (kernel 7.2.7-valve2), Steam Deck OLED: AMD Custom APU 0932 (4 cores, 8 threads), RADV VANGOGH, Mesa 26.2.0-devel, 16 GB shared with the GPU; the GPU's clock fixed at 1600 MHz
Scene: a save in Kokiri Forest (about 2,600 draws a frame) and one in Hyrule Field (about 1,600), standing still; no screen (headless), handheld profile, Minimum preset, the game's own upscaler, no frame generation, no cap
Method: the back end built alone from each commit (clang, ThinLTO, the play profile main commits, x86-64-v3), in a game built from main c167ec67. Each run starts the game with RX_VK_FRAME_TRACE=1, loads the save by script, and stops after 600 presents in play. Read in longshot_frames.csv: the arrival is the first frame of play after the loading screen (the first frame after a run of 60 frames or more that spend under 2 ms in draws), and the numbers are over the 600 frames from it: the frames of 150 ms or more, the frame rate (600 over their time), the 1% low (the mean of the 6 slowest, as fps), the median and 99th percentile frame time, and the uploads the draws asked for (the trace's uploads and upload_mb). In each area: a warm-up of each side, then main, this PR, main, this PR; this PR's list was empty at the start, so its warm-up is the load that fills it. Two runs a side: both are given, with their mean. GPU memory: the process's drm-memory-gtt + drm-memory-vram at the end of the run
How to reproduce: a save in an area, RX_VK_FRAME_TRACE=1, load it twice with RX_VK_TEX_AHEAD=1 (the first load fills the list) and compare the frames after the loading screen with a load without the switch; the log's vk: textures ahead: line says what was prepared

this PR: perf/textures-ahead @ 7d0b4ae6. Measured as b9f0ba85 (on the fork as measured/textures-ahead-b9f0ba85), the same patch on main 5f131218, the last commit a game built from c167ec67 can load (#1102, the next one, takes the renderer interface to 25). git range-diff 5f131218..b9f0ba85 f9a2195c..7d0b4ae6 shows the patch unchanged but for 8 lines of comments in texture_ahead.h. The six commits of main since (#1102 the microphone test, #1107 RX_VK_TEST_VRAM_MB, #360 the builder, #311 DLSS's feature size, #1110 the release's CI, #903 the pipeline cache written before the title) touch none of the renderer files this PR changes, and the rebase had no conflict: not measured again on f9a2195c.

the 600 frames after the loading screen Before: main @ 5f131218 After: this PR @ b9f0ba85, RX_VK_TEX_AHEAD=1 Δ
Kokiri Forest: frames of 150 ms or more 7, 8 3, 2
Kokiri Forest: their time 3.35 s (3.34, 3.35) 1.22 s (1.27, 1.16) -2.13 s
Kokiri Forest: frames a second 20.71 (20.75, 20.67) 22.46 (22.44, 22.48) +1.75
Kokiri Forest: 1% low 1.95 fps (1.89, 2.00) 3.61 fps (3.60, 3.61) +1.66
Kokiri Forest: frame time, median 38.7 ms (38.3, 39.1) 38.8 ms (38.7, 38.8) +0.1 ms
Kokiri Forest: frame time, 99th percentile 236.0 ms (263.9, 208.0) 122.3 ms (122.9, 121.6) -113.7 ms
Kokiri Forest: uploads at draws 1,189 and 1,194 (474, 475 MB) 214 and 247 (142, 143 MB)
Kokiri Forest: GPU memory of the process 4,476 MiB (4,450, 4,501) 4,511 MiB (4,527, 4,495) +35 MiB
Hyrule Field: frames of 150 ms or more 5, 4 3, 3
Hyrule Field: their time 2.30 s (2.29, 2.30) 1.41 s (1.38, 1.44) -0.89 s
Hyrule Field: frames a second 23.58 (23.76, 23.40) 24.50 (24.27, 24.73) +0.92
Hyrule Field: 1% low 2.41 fps (2.46, 2.35) 3.48 fps (3.53, 3.43) +1.07
Hyrule Field: frame time, median 36.6 ms (36.3, 36.9) 36.8 ms (37.1, 36.5) +0.2 ms
Hyrule Field: frame time, 99th percentile 129.0 ms (146.9, 111.0) 94.6 ms (96.7, 92.5) -34.4 ms
Hyrule Field: uploads at draws 784 and 789 (479, 492 MB) 368 and 330 (298, 293 MB)
Hyrule Field: GPU memory of the process 3,881 MiB (3,890, 3,871) 3,980 MiB (4,020, 3,939) +99 MiB

What it does not change, from the same runs:

  • The first frame of play stays at 0.8 to 1.0 s on both sides (Kokiri Forest 904 and 894 ms on main, 817 and 873 with this PR; Hyrule Field 960 and 1,018, then 932 and 986): the uploads were a part of it, not the whole.
  • The load that fills the list is as main: 8 frames and 3.60 s in Kokiri Forest, 4 frames and 1.73 s in Hyrule Field.
  • This PR's build with the switch off, Kokiri Forest, one run: 8 frames, 3.48 s, 20.54 fps, 1,195 uploads at draws: as main.
  • The loading screen's own long frames (the 600 frames before the arrival): Kokiri Forest none and one of 1.58 s on main, one of 1.45 and one of 1.48 s with this PR, one of 1.54 s with the switch off; Hyrule Field 2.04 and 0.95 s on main, 1.73 and 1.29 s with this PR: inside main's own spread.
  • The time from the game's start to play: 35 and 39 s on main, 34 and 35 s with this PR in Kokiri Forest; 38 and 38, then 39 and 39 in Hyrule Field (read every half second).
  • Between 80 and 260 of the textures an arrival draws were not in the list from the load before (at another place than that time, or not drawn then): they are uploaded at their first draw as on main, which is most of what is left in "uploads at draws".

An area change in play, the same two builds, one tour each: the Kokiri Forest save, then four teleports through the control bridge (Hyrule Field, Kokiri Forest, Hyrule Field, Kokiri Forest), 25 s in each, the texture budget at 4,000 MB as in every run here. Frames of 150 ms or more from each teleport to the next:

area change in play Before: main @ 5f131218 After: this PR @ b9f0ba85, RX_VK_TEX_AHEAD=1
to Hyrule Field (first visit) 7 frames, 1.82 s, 843 uploads at draws 7 frames, 1.79 s, 849 uploads, 8 prepared
back to Kokiri Forest 1 frame, 0.26 s, 263 uploads 2 frames, 0.51 s, 238 uploads, 30 prepared
back to Hyrule Field 4 frames, 1.04 s, 483 uploads 4 frames, 1.00 s, 441 uploads, 32 prepared
back to Kokiri Forest 0 frames, 149 uploads 0 frames, 158 uploads, 60 prepared

Nothing gained there, and it cannot be with this design: on this route the game keeps both areas' textures (it makes about 100 to 150 again at each change, none of the area's own), so nothing is announced for the renderer to prepare; what a return uploads is what the texture cache's budget let go. With a 2,400 MB budget the returns cost 0.9 to 1.9 s each on this Deck (the comment on #1069 has those numbers).

[k-main-1] arrival at frame 1539, 600 frames, 28.9 s: 20.75 fps, 1% low 1.89 fps; frame time median 38.3 ms, p99 263.9 ms; frames of 150 ms or more: 7, 3.34 s (904 1080 163 320 264 281 326); uploads at draws 1189 (474 MB); in the 600 frames before: 4 uploads (0 MB), 0 frames of 150 ms or more (0.00 s)
[k-pr-1]   arrival at frame 1169, 600 frames, 26.7 s: 22.44 fps, 1% low 3.60 fps; frame time median 38.7 ms, p99 122.9 ms; frames of 150 ms or more: 3, 1.27 s (817 156 302); uploads at draws 214 (142 MB); in the 600 frames before: 334 uploads (127 MB), 1 frames of 150 ms or more (1.45 s)
[k-main-2] arrival at frame 1312, 600 frames, 29.0 s: 20.67 fps, 1% low 2.00 fps; frame time median 39.1 ms, p99 208.0 ms; frames of 150 ms or more: 8, 3.35 s (894 208 1000 324 315 158 193 255); uploads at draws 1194 (475 MB); in the 600 frames before: 4 uploads (0 MB), 1 frames of 150 ms or more (1.58 s)
[k-pr-2]   arrival at frame 1276, 600 frames, 26.7 s: 22.48 fps, 1% low 3.61 fps; frame time median 38.8 ms, p99 121.6 ms; frames of 150 ms or more: 2, 1.16 s (873 284); uploads at draws 247 (143 MB); in the 600 frames before: 167 uploads (80 MB), 1 frames of 150 ms or more (1.48 s)
[k-pr-off] arrival at frame 1254, 600 frames, 29.2 s: 20.54 fps, 1% low 1.93 fps; frame time median 38.0 ms, p99 226.2 ms; frames of 150 ms or more: 8, 3.48 s (938 208 994 172 351 312 226 283); uploads at draws 1195 (475 MB); in the 600 frames before: 4 uploads (0 MB), 1 frames of 150 ms or more (1.54 s)
[f-main-1] arrival at frame 1360, 600 frames, 25.2 s: 23.76 fps, 1% low 2.46 fps; frame time median 36.3 ms, p99 146.9 ms; frames of 150 ms or more: 5, 2.29 s (960 163 769 242 159); uploads at draws 784 (479 MB); in the 600 frames before: 4 uploads (0 MB), 2 frames of 150 ms or more (2.04 s)
[f-pr-1]   arrival at frame 1311, 600 frames, 24.7 s: 24.27 fps, 1% low 3.53 fps; frame time median 37.1 ms, p99 96.7 ms; frames of 150 ms or more: 3, 1.38 s (932 267 181); uploads at draws 368 (298 MB); in the 600 frames before: 49 uploads (12 MB), 3 frames of 150 ms or more (1.73 s)
[f-main-2] arrival at frame 1329, 600 frames, 25.6 s: 23.40 fps, 1% low 2.35 fps; frame time median 36.9 ms, p99 111.0 ms; frames of 150 ms or more: 4, 2.30 s (1018 808 191 285); uploads at draws 789 (492 MB); in the 600 frames before: 4 uploads (0 MB), 2 frames of 150 ms or more (0.95 s)
[f-pr-2]   arrival at frame 1317, 600 frames, 24.3 s: 24.73 fps, 1% low 3.43 fps; frame time median 36.5 ms, p99 92.5 ms; frames of 150 ms or more: 3, 1.44 s (986 285 167); uploads at draws 330 (293 MB); in the 600 frames before: 64 uploads (15 MB), 2 frames of 150 ms or more (1.29 s)

[k-pr-1] vk: textures ahead: 1054 prepared so far (994 MB of images, 1614 ms); a draw's first uploads: 79 new to the list, 0 known and not prepared in time, 0 drawn too long after they were made to be kept; made and never drawn before 1991, let go for their age 0; 2391 waiting, 1175 in the list; the cache had no room at times
[k-pr-2] vk: textures ahead: 977 prepared so far (981 MB of images, 1584 ms); a draw's first uploads: 156 new to the list, 0 known and not prepared in time, 0 drawn too long after they were made to be kept; made and never drawn before 2068, let go for their age 0; 1959 waiting, 1331 in the list; the cache had no room at times
[f-pr-1] vk: textures ahead: 458 prepared so far (436 MB of images, 587 ms); a draw's first uploads: 258 new to the list, 0 known and not prepared in time, 0 drawn too long after they were made to be kept; made and never drawn before 3680, let go for their age 0; 1174 waiting, 2222 in the list; the cache had no room at times
[f-pr-2] vk: textures ahead: 538 prepared so far (461 MB of images, 668 ms); a draw's first uploads: 176 new to the list, 0 known and not prepared in time, 0 drawn too long after they were made to be kept; made and never drawn before 3610, let go for their age 0; 1174 waiting, 2398 in the list; the cache had no room at times

Flags and settings

Two new switches, both read by the renderer only.

Flag What it is Before this PR After this PR Effect Helps / doesn't help / untested Recommendation
RX_VK_TEX_AHEAD=1 Textures a draw sampled soon after a load are remembered (cache/longshot_textures_drawn.bin) and, the next time the game makes them, made and uploaded during the loading screen not there off Fewer long frames after a save is loaded, from the second load of that save on Helps: a Steam Deck OLED, the arrival after a save is loaded (tables above). Doesn't help: an area change in play. Untested: any other hardware, Windows, a card that samples ASTC itself off for now: measured on one machine; worth turning on by default once a desktop card has shown the same
RX_VK_TEX_AHEAD_MS=<n> What a light frame may spend preparing, in ms not there 12 A larger value prepares more before a short loading screen ends, and makes the loading screen's frames longer Only the default was measured leave unset; for testing

The measured runs used the player's settings on both sides: Minimum preset (RX_VK_LOW_SPEC=1), handheld profile (HOS_HANDHELD=1), RX_VK_READBACK_LATE=newest,3980, RX_VK_VRAM_MB=4000, RX_VK_TEX_MAX_DIM=1024, RX_VK_TEX_MAX_MB=128, RX_VK_TEX_SKIP_MB=4, RX_VK_IMAGE_BLOCK_MB=32, RX_VK_DESC_POOL_DIV=4, RX_VK_DESC_SLOTGEN=1, RX_VK_MESH_OPT=1, RX_VK_MASK_BLEND=0, RX_VK_FSR_FG=0, RX_VK_FRAMEGEN_MULT=2, RX_VK_LOAD=create, HOS_RESERVE_CORE=0.

Testing

Tested:

  • python -I -B tests/run_all.py on macOS with the Vulkan headers given, on this branch (ff04d32e): 578 passed, 55 failed, 44 skipped; main f9a2195c on that machine in the same session: 577 passed, the same 55 failed, 44 skipped. Every check that fails here fails on main there (no /proc, no Linux headers such as linux/futex.h and SOCK_CLOEXEC, Python 3.9's write_text); none reads this change. The one more that passes is tests/test_texture_ahead.py. The checks that read vk_texture.cpp, vk_replay.cpp and dev_packs.py pass as they are, none changed (tests/test_dev_packs.py among them); tests/test_tested_configurations.py passes with Python 3.13.
  • In the game, a Steam Deck OLED, without a screen: the 16 runs of the measurement (7 of this PR with the switch on, 1 with it off, 8 of main), no error, no device lost, no GPU timeout in the kernel log.
  • In the game, by a person: the same mechanism with an earlier form of its rules (a frame light by its replay time, the list unbounded), in a build with other renderer-only changes, played on that Steam Deck OLED on 2026-11-15 (an hour and a half) and 2026-11-16: nothing wrong reported on screen. The first of those sessions is what showed the list growing without end and each load preparing 0.5 to 1 GB too much; the 90 s rule, the place and the bound come from it, and the tables above are after them.
  • Linux: the back end builds from b9f0ba85 (clang, on the Steam Deck). Windows: longshot_vk.dll cross-built from this branch's head ff04d32e with llvm-mingw 20261104, as .forgejo/workflows/build-windows.yml does it: 0 failed, no warning in the new code. Not run on Windows. The list's path is cache_path()'s, opened as the other cache files are; tests/test_utf8_paths.py passes.

Not tested:

  • This exact commit looked at on a screen: the measured runs were headless. What it changes is when a texture is made and uploaded, through the same texture_get() a draw uses.
  • Windows, run: built only (above).
  • A desktop card, and a card that samples ASTC itself (no decode: less to gain).
  • A machine fast enough for the loading screen to end before the list's textures are prepared: the rest is then uploaded at its first draw, as on main.
  • More than about 20 loads on one list: the bound (32,768 entries) was not reached in the game; tests/test_texture_ahead.cpp covers it.

Must be tested:

  • None to merge it off by default.
  • Before it is on by default, a desktop card (windows or linux, nvidia or amd): load a save in Kokiri Forest twice with RX_VK_TEX_AHEAD=1 and once without, expecting fewer frames of 150 ms or more in the first seconds of play on the second load, the same picture, and no more than about 100 MB more video memory (Test Farm: @Beanstalk a save loaded in Kokiri Forest twice with RX_VK_TEX_AHEAD=1 and once without, the frames over 150 ms in the first 20 s of play).

Risks

What could break: with the switch off, nothing: its five entry points return at once, and status_tick() reads the draw counters once a frame. With it on: a texture is made and uploaded up to a minute earlier than on main, from the same memory and through the same code; if the game wrote its storage again after that, the upload a draw's first use does on main for a written texture happens as on main (the dirty tracking is not touched). A texture prepared and never drawn holds video memory until the cache lets it go: measured at 35 to 100 MiB here, and never within 256 MB of the budget. A wrong match (two textures with the same shape, the same sampled bytes and the same address) only prepares a texture that was not needed. The list is a file in cache/: a cut-off or foreign file is not read, and a write goes through a file beside it.

Turning it off: it is off; set, RX_VK_TEX_AHEAD=0 or removing it. Deleting cache/longshot_textures_drawn.bin starts the list again.

Compatibility: Nothing changes without the switch. With it, one new file in the game folder's cache/. Saves and longshot_options.ini are untouched, no shader or pipeline cache is rebuilt (no stamped file is touched), MKWVK_API_VERSION is as it was (the host's announcement nvn_texture_created exists already).

Issues

See #1069

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported.
  • Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value.
  • A file in docs/tested/ for each new measured run (format in docs/tested-configurations.md).
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • Docs updated.
**Type:** perf · **Risk:** low · **Tested on:** Linux (SteamOS), Steam Deck OLED (RADV VANGOGH) · **Needs:** none to merge it off; a desktop card (NVIDIA or AMD, Windows or Linux) before it is on by default ## Why After a save is loaded, the first seconds in the area stutter: on a Steam Deck, Kokiri Forest has 7 or 8 frames of 150 ms or more in its first 600, 3.3 s of them in all, and Hyrule Field 4 or 5, 2.3 s. The renderer makes and uploads a texture at the first draw that samples it, so the area's 800 to 1,200 textures all come in those frames, although the game made them 5 to 60 seconds before, during the loading screen, where nobody would notice the work. This does that work on the loading screen. It is for the arrival after a save is loaded only: it does nothing at an area change in play (measured below), which is #1069's subject. ## What changed With `RX_VK_TEX_AHEAD=1` the renderer remembers the textures a draw sampled soon after the game made them, and the next time the game makes one of them it is made and uploaded during a light frame, before its first draw. Off by default: without the switch nothing is remembered, nothing is prepared and no file is written. - rules: `gpu/vk/texture_ahead.h` (new, no Vulkan in it). `signature()` tells a texture by its shape and eight runs of 64 bytes of its storage; `place()` ties it to where the game put it (kept by signature alone, every area prepared what any area had drawn: 1,910 textures for the 770 Hyrule Field draws, 0.8 GB more video memory); `learnable()` keeps only a texture first drawn within 90 s of its making (one met minutes later in play would be prepared at every load); `allowance_ns()` lets a frame prepare only after a frame of under 200 draws (a loading screen has 5, the title and the menus under 100, play over 1,000: told by draws, not by time, so a fast PC does not prepare in play); `room()` keeps 256 MB free under the texture cache's budget, so a texture prepared never pushes another out; `Queue` holds what the game has made, oldest first, a second after its making and for two minutes at most; `remember()` bounds the list at 32,768 entries (256 KB), starting it again when full; `load_drawn()` / `save_drawn()` keep it in the game folder's `cache/longshot_textures_drawn.bin`, written through a file beside it. - vk: `gpu/vk/vk_texture.cpp`: `texture_ahead_made()` and `texture_ahead_gone()` take the host's announcements (block-compressed textures in the game's own memory only: `ahead_wanted()`); `upload()` notes a draw's first upload (`ahead_learn()`); `texture_ahead_frame()` sets the next frame's allowance from the frame's draws and writes the list when it changed (every 300 frames at most); `texture_ahead_run()` takes textures from the queue and, for the ones in the list, calls `texture_get()` as a draw's first use would, up to 12 ms a frame (`RX_VK_TEX_AHEAD_MS`). - vk: `gpu/vk/vk_replay.cpp`: `texture_created_of()` and `texture_released_of()` pass the announcements on; `run_submit()` calls `texture_ahead_run()` once a recording has begun, before the submission's commands, so the uploads go into that recording; `status_tick()` gives `texture_ahead_frame()` the frame's draws. - tools: `scripts/dev_packs.py` counts `longshot_textures_drawn.bin` among the game folder's caches. - checks: `tests/test_texture_ahead.py` compiles and runs the rules (`tests/test_texture_ahead.cpp`) and reads the renderer for where they are used (cut with `tests/srccut.py`). - docs: `docs/development.md` has the switch's row; a run file in `docs/tested/`. ## Measurements **Verdict:** it helps the arrival after a save is loaded, on a Steam Deck OLED: the frames of 150 ms or more in the first 600 frames of play go from 3.35 s to 1.22 s in Kokiri Forest (7 or 8 frames to 2 or 3) and from 2.30 s to 1.41 s in Hyrule Field, the runs of the two sides not overlapping; the 1% low goes from 1.9 to 3.6 fps and from 2.4 to 3.5 fps, the frame rate over those 600 frames from 20.7 to 22.5 fps and from 23.6 to 24.5. The first load of a save only fills the list and is as main. It does not help an area change in play (last table). Cost: 35 to 100 MiB more GPU memory, nothing measurable on the time to reach play. Passed: no error in 16 runs. Not looked at on a screen (the Deck ran headless). Hardware: SteamOS 3.9.5 (kernel 7.2.7-valve2), Steam Deck OLED: AMD Custom APU 0932 (4 cores, 8 threads), RADV VANGOGH, Mesa 26.2.0-devel, 16 GB shared with the GPU; the GPU's clock fixed at 1600 MHz Scene: a save in Kokiri Forest (about 2,600 draws a frame) and one in Hyrule Field (about 1,600), standing still; no screen (headless), handheld profile, Minimum preset, the game's own upscaler, no frame generation, no cap Method: the back end built alone from each commit (clang, ThinLTO, the play profile main commits, x86-64-v3), in a game built from main c167ec67. Each run starts the game with `RX_VK_FRAME_TRACE=1`, loads the save by script, and stops after 600 presents in play. Read in `longshot_frames.csv`: the arrival is the first frame of play after the loading screen (the first frame after a run of 60 frames or more that spend under 2 ms in draws), and the numbers are over the 600 frames from it: the frames of 150 ms or more, the frame rate (600 over their time), the 1% low (the mean of the 6 slowest, as fps), the median and 99th percentile frame time, and the uploads the draws asked for (the trace's `uploads` and `upload_mb`). In each area: a warm-up of each side, then main, this PR, main, this PR; this PR's list was empty at the start, so its warm-up is the load that fills it. Two runs a side: both are given, with their mean. GPU memory: the process's `drm-memory-gtt` + `drm-memory-vram` at the end of the run How to reproduce: a save in an area, `RX_VK_FRAME_TRACE=1`, load it twice with `RX_VK_TEX_AHEAD=1` (the first load fills the list) and compare the frames after the loading screen with a load without the switch; the log's `vk: textures ahead:` line says what was prepared this PR: perf/textures-ahead @ 7d0b4ae6. Measured as b9f0ba85 (on the fork as `measured/textures-ahead-b9f0ba85`), the same patch on main 5f131218, the last commit a game built from c167ec67 can load (#1102, the next one, takes the renderer interface to 25). `git range-diff 5f131218..b9f0ba85 f9a2195c..7d0b4ae6` shows the patch unchanged but for 8 lines of comments in `texture_ahead.h`. The six commits of main since (#1102 the microphone test, #1107 `RX_VK_TEST_VRAM_MB`, #360 the builder, #311 DLSS's feature size, #1110 the release's CI, #903 the pipeline cache written before the title) touch none of the renderer files this PR changes, and the rebase had no conflict: not measured again on f9a2195c. | the 600 frames after the loading screen | Before: main @ 5f131218 | After: this PR @ b9f0ba85, `RX_VK_TEX_AHEAD=1` | Δ | |---|---|---|---| | Kokiri Forest: frames of 150 ms or more | 7, 8 | 3, 2 | | | Kokiri Forest: their time | 3.35 s (3.34, 3.35) | 1.22 s (1.27, 1.16) | -2.13 s | | Kokiri Forest: frames a second | 20.71 (20.75, 20.67) | 22.46 (22.44, 22.48) | +1.75 | | Kokiri Forest: 1% low | 1.95 fps (1.89, 2.00) | 3.61 fps (3.60, 3.61) | +1.66 | | Kokiri Forest: frame time, median | 38.7 ms (38.3, 39.1) | 38.8 ms (38.7, 38.8) | +0.1 ms | | Kokiri Forest: frame time, 99th percentile | 236.0 ms (263.9, 208.0) | 122.3 ms (122.9, 121.6) | -113.7 ms | | Kokiri Forest: uploads at draws | 1,189 and 1,194 (474, 475 MB) | 214 and 247 (142, 143 MB) | | | Kokiri Forest: GPU memory of the process | 4,476 MiB (4,450, 4,501) | 4,511 MiB (4,527, 4,495) | +35 MiB | | Hyrule Field: frames of 150 ms or more | 5, 4 | 3, 3 | | | Hyrule Field: their time | 2.30 s (2.29, 2.30) | 1.41 s (1.38, 1.44) | -0.89 s | | Hyrule Field: frames a second | 23.58 (23.76, 23.40) | 24.50 (24.27, 24.73) | +0.92 | | Hyrule Field: 1% low | 2.41 fps (2.46, 2.35) | 3.48 fps (3.53, 3.43) | +1.07 | | Hyrule Field: frame time, median | 36.6 ms (36.3, 36.9) | 36.8 ms (37.1, 36.5) | +0.2 ms | | Hyrule Field: frame time, 99th percentile | 129.0 ms (146.9, 111.0) | 94.6 ms (96.7, 92.5) | -34.4 ms | | Hyrule Field: uploads at draws | 784 and 789 (479, 492 MB) | 368 and 330 (298, 293 MB) | | | Hyrule Field: GPU memory of the process | 3,881 MiB (3,890, 3,871) | 3,980 MiB (4,020, 3,939) | +99 MiB | What it does not change, from the same runs: - The first frame of play stays at 0.8 to 1.0 s on both sides (Kokiri Forest 904 and 894 ms on main, 817 and 873 with this PR; Hyrule Field 960 and 1,018, then 932 and 986): the uploads were a part of it, not the whole. - The load that fills the list is as main: 8 frames and 3.60 s in Kokiri Forest, 4 frames and 1.73 s in Hyrule Field. - This PR's build with the switch off, Kokiri Forest, one run: 8 frames, 3.48 s, 20.54 fps, 1,195 uploads at draws: as main. - The loading screen's own long frames (the 600 frames before the arrival): Kokiri Forest none and one of 1.58 s on main, one of 1.45 and one of 1.48 s with this PR, one of 1.54 s with the switch off; Hyrule Field 2.04 and 0.95 s on main, 1.73 and 1.29 s with this PR: inside main's own spread. - The time from the game's start to play: 35 and 39 s on main, 34 and 35 s with this PR in Kokiri Forest; 38 and 38, then 39 and 39 in Hyrule Field (read every half second). - Between 80 and 260 of the textures an arrival draws were not in the list from the load before (at another place than that time, or not drawn then): they are uploaded at their first draw as on main, which is most of what is left in "uploads at draws". An area change in play, the same two builds, one tour each: the Kokiri Forest save, then four teleports through the control bridge (Hyrule Field, Kokiri Forest, Hyrule Field, Kokiri Forest), 25 s in each, the texture budget at 4,000 MB as in every run here. Frames of 150 ms or more from each teleport to the next: | area change in play | Before: main @ 5f131218 | After: this PR @ b9f0ba85, `RX_VK_TEX_AHEAD=1` | |---|---|---| | to Hyrule Field (first visit) | 7 frames, 1.82 s, 843 uploads at draws | 7 frames, 1.79 s, 849 uploads, 8 prepared | | back to Kokiri Forest | 1 frame, 0.26 s, 263 uploads | 2 frames, 0.51 s, 238 uploads, 30 prepared | | back to Hyrule Field | 4 frames, 1.04 s, 483 uploads | 4 frames, 1.00 s, 441 uploads, 32 prepared | | back to Kokiri Forest | 0 frames, 149 uploads | 0 frames, 158 uploads, 60 prepared | Nothing gained there, and it cannot be with this design: on this route the game keeps both areas' textures (it makes about 100 to 150 again at each change, none of the area's own), so nothing is announced for the renderer to prepare; what a return uploads is what the texture cache's budget let go. With a 2,400 MB budget the returns cost 0.9 to 1.9 s each on this Deck (the comment on #1069 has those numbers). ``` [k-main-1] arrival at frame 1539, 600 frames, 28.9 s: 20.75 fps, 1% low 1.89 fps; frame time median 38.3 ms, p99 263.9 ms; frames of 150 ms or more: 7, 3.34 s (904 1080 163 320 264 281 326); uploads at draws 1189 (474 MB); in the 600 frames before: 4 uploads (0 MB), 0 frames of 150 ms or more (0.00 s) [k-pr-1] arrival at frame 1169, 600 frames, 26.7 s: 22.44 fps, 1% low 3.60 fps; frame time median 38.7 ms, p99 122.9 ms; frames of 150 ms or more: 3, 1.27 s (817 156 302); uploads at draws 214 (142 MB); in the 600 frames before: 334 uploads (127 MB), 1 frames of 150 ms or more (1.45 s) [k-main-2] arrival at frame 1312, 600 frames, 29.0 s: 20.67 fps, 1% low 2.00 fps; frame time median 39.1 ms, p99 208.0 ms; frames of 150 ms or more: 8, 3.35 s (894 208 1000 324 315 158 193 255); uploads at draws 1194 (475 MB); in the 600 frames before: 4 uploads (0 MB), 1 frames of 150 ms or more (1.58 s) [k-pr-2] arrival at frame 1276, 600 frames, 26.7 s: 22.48 fps, 1% low 3.61 fps; frame time median 38.8 ms, p99 121.6 ms; frames of 150 ms or more: 2, 1.16 s (873 284); uploads at draws 247 (143 MB); in the 600 frames before: 167 uploads (80 MB), 1 frames of 150 ms or more (1.48 s) [k-pr-off] arrival at frame 1254, 600 frames, 29.2 s: 20.54 fps, 1% low 1.93 fps; frame time median 38.0 ms, p99 226.2 ms; frames of 150 ms or more: 8, 3.48 s (938 208 994 172 351 312 226 283); uploads at draws 1195 (475 MB); in the 600 frames before: 4 uploads (0 MB), 1 frames of 150 ms or more (1.54 s) [f-main-1] arrival at frame 1360, 600 frames, 25.2 s: 23.76 fps, 1% low 2.46 fps; frame time median 36.3 ms, p99 146.9 ms; frames of 150 ms or more: 5, 2.29 s (960 163 769 242 159); uploads at draws 784 (479 MB); in the 600 frames before: 4 uploads (0 MB), 2 frames of 150 ms or more (2.04 s) [f-pr-1] arrival at frame 1311, 600 frames, 24.7 s: 24.27 fps, 1% low 3.53 fps; frame time median 37.1 ms, p99 96.7 ms; frames of 150 ms or more: 3, 1.38 s (932 267 181); uploads at draws 368 (298 MB); in the 600 frames before: 49 uploads (12 MB), 3 frames of 150 ms or more (1.73 s) [f-main-2] arrival at frame 1329, 600 frames, 25.6 s: 23.40 fps, 1% low 2.35 fps; frame time median 36.9 ms, p99 111.0 ms; frames of 150 ms or more: 4, 2.30 s (1018 808 191 285); uploads at draws 789 (492 MB); in the 600 frames before: 4 uploads (0 MB), 2 frames of 150 ms or more (0.95 s) [f-pr-2] arrival at frame 1317, 600 frames, 24.3 s: 24.73 fps, 1% low 3.43 fps; frame time median 36.5 ms, p99 92.5 ms; frames of 150 ms or more: 3, 1.44 s (986 285 167); uploads at draws 330 (293 MB); in the 600 frames before: 64 uploads (15 MB), 2 frames of 150 ms or more (1.29 s) [k-pr-1] vk: textures ahead: 1054 prepared so far (994 MB of images, 1614 ms); a draw's first uploads: 79 new to the list, 0 known and not prepared in time, 0 drawn too long after they were made to be kept; made and never drawn before 1991, let go for their age 0; 2391 waiting, 1175 in the list; the cache had no room at times [k-pr-2] vk: textures ahead: 977 prepared so far (981 MB of images, 1584 ms); a draw's first uploads: 156 new to the list, 0 known and not prepared in time, 0 drawn too long after they were made to be kept; made and never drawn before 2068, let go for their age 0; 1959 waiting, 1331 in the list; the cache had no room at times [f-pr-1] vk: textures ahead: 458 prepared so far (436 MB of images, 587 ms); a draw's first uploads: 258 new to the list, 0 known and not prepared in time, 0 drawn too long after they were made to be kept; made and never drawn before 3680, let go for their age 0; 1174 waiting, 2222 in the list; the cache had no room at times [f-pr-2] vk: textures ahead: 538 prepared so far (461 MB of images, 668 ms); a draw's first uploads: 176 new to the list, 0 known and not prepared in time, 0 drawn too long after they were made to be kept; made and never drawn before 3610, let go for their age 0; 1174 waiting, 2398 in the list; the cache had no room at times ``` ### Flags and settings Two new switches, both read by the renderer only. | Flag | What it is | Before this PR | After this PR | Effect | Helps / doesn't help / untested | Recommendation | |---|---|---|---|---|---|---| | `RX_VK_TEX_AHEAD=1` | Textures a draw sampled soon after a load are remembered (`cache/longshot_textures_drawn.bin`) and, the next time the game makes them, made and uploaded during the loading screen | not there | off | Fewer long frames after a save is loaded, from the second load of that save on | Helps: a Steam Deck OLED, the arrival after a save is loaded (tables above). Doesn't help: an area change in play. Untested: any other hardware, Windows, a card that samples ASTC itself | off for now: measured on one machine; worth turning on by default once a desktop card has shown the same | | `RX_VK_TEX_AHEAD_MS=<n>` | What a light frame may spend preparing, in ms | not there | 12 | A larger value prepares more before a short loading screen ends, and makes the loading screen's frames longer | Only the default was measured | leave unset; for testing | The measured runs used the player's settings on both sides: Minimum preset (`RX_VK_LOW_SPEC=1`), handheld profile (`HOS_HANDHELD=1`), `RX_VK_READBACK_LATE=newest,3980`, `RX_VK_VRAM_MB=4000`, `RX_VK_TEX_MAX_DIM=1024`, `RX_VK_TEX_MAX_MB=128`, `RX_VK_TEX_SKIP_MB=4`, `RX_VK_IMAGE_BLOCK_MB=32`, `RX_VK_DESC_POOL_DIV=4`, `RX_VK_DESC_SLOTGEN=1`, `RX_VK_MESH_OPT=1`, `RX_VK_MASK_BLEND=0`, `RX_VK_FSR_FG=0`, `RX_VK_FRAMEGEN_MULT=2`, `RX_VK_LOAD=create`, `HOS_RESERVE_CORE=0`. ## Testing **Tested:** - `python -I -B tests/run_all.py` on macOS with the Vulkan headers given, on this branch (ff04d32e): 578 passed, 55 failed, 44 skipped; main f9a2195c on that machine in the same session: 577 passed, the same 55 failed, 44 skipped. Every check that fails here fails on main there (no `/proc`, no Linux headers such as `linux/futex.h` and `SOCK_CLOEXEC`, Python 3.9's `write_text`); none reads this change. The one more that passes is `tests/test_texture_ahead.py`. The checks that read `vk_texture.cpp`, `vk_replay.cpp` and `dev_packs.py` pass as they are, none changed (`tests/test_dev_packs.py` among them); `tests/test_tested_configurations.py` passes with Python 3.13. - In the game, a Steam Deck OLED, without a screen: the 16 runs of the measurement (7 of this PR with the switch on, 1 with it off, 8 of main), no error, no device lost, no GPU timeout in the kernel log. - In the game, by a person: the same mechanism with an earlier form of its rules (a frame light by its replay time, the list unbounded), in a build with other renderer-only changes, played on that Steam Deck OLED on 2026-11-15 (an hour and a half) and 2026-11-16: nothing wrong reported on screen. The first of those sessions is what showed the list growing without end and each load preparing 0.5 to 1 GB too much; the 90 s rule, the place and the bound come from it, and the tables above are after them. - Linux: the back end builds from b9f0ba85 (clang, on the Steam Deck). Windows: `longshot_vk.dll` cross-built from this branch's head ff04d32e with llvm-mingw 20261104, as `.forgejo/workflows/build-windows.yml` does it: 0 failed, no warning in the new code. Not run on Windows. The list's path is `cache_path()`'s, opened as the other cache files are; `tests/test_utf8_paths.py` passes. **Not tested:** - This exact commit looked at on a screen: the measured runs were headless. What it changes is when a texture is made and uploaded, through the same `texture_get()` a draw uses. - Windows, run: built only (above). - A desktop card, and a card that samples ASTC itself (no decode: less to gain). - A machine fast enough for the loading screen to end before the list's textures are prepared: the rest is then uploaded at its first draw, as on main. - More than about 20 loads on one list: the bound (32,768 entries) was not reached in the game; `tests/test_texture_ahead.cpp` covers it. **Must be tested:** - None to merge it off by default. - Before it is on by default, a desktop card (`windows` or `linux`, `nvidia` or `amd`): load a save in Kokiri Forest twice with `RX_VK_TEX_AHEAD=1` and once without, expecting fewer frames of 150 ms or more in the first seconds of play on the second load, the same picture, and no more than about 100 MB more video memory (Test Farm: `@Beanstalk a save loaded in Kokiri Forest twice with RX_VK_TEX_AHEAD=1 and once without, the frames over 150 ms in the first 20 s of play`). ## Risks **What could break:** with the switch off, nothing: its five entry points return at once, and `status_tick()` reads the draw counters once a frame. With it on: a texture is made and uploaded up to a minute earlier than on main, from the same memory and through the same code; if the game wrote its storage again after that, the upload a draw's first use does on main for a written texture happens as on main (the dirty tracking is not touched). A texture prepared and never drawn holds video memory until the cache lets it go: measured at 35 to 100 MiB here, and never within 256 MB of the budget. A wrong match (two textures with the same shape, the same sampled bytes and the same address) only prepares a texture that was not needed. The list is a file in `cache/`: a cut-off or foreign file is not read, and a write goes through a file beside it. **Turning it off:** it is off; set, `RX_VK_TEX_AHEAD=0` or removing it. Deleting `cache/longshot_textures_drawn.bin` starts the list again. **Compatibility:** Nothing changes without the switch. With it, one new file in the game folder's `cache/`. Saves and `longshot_options.ini` are untouched, no shader or pipeline cache is rebuilt (no stamped file is touched), `MKWVK_API_VERSION` is as it was (the host's announcement `nvn_texture_created` exists already). ## Issues See #1069 ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported. - [x] Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value. - [x] A file in `docs/tested/` for each new measured run (format in `docs/tested-configurations.md`). - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] Docs updated.
The renderer makes and uploads a texture at the first draw that samples it, so after a save is loaded its area's
textures all come in the first frames after the loading screen: 700 to 1200 of them, two frames of about a second each
on a Steam Deck. The host announces each texture when the game makes it, 5 to 60 seconds before.

With RX_VK_TEX_AHEAD=1 a block-compressed texture first drawn within 90 s of the game making it is remembered, with
where the game put it, in the game folder's cache/longshot_textures_drawn.bin; the next time the game makes it there, it
is made and uploaded during a light frame (under 200 draws: a loading screen, a menu), up to 12 ms a frame
(RX_VK_TEX_AHEAD_MS), never within 256 MB of the texture cache's budget. The rules are in gpu/vk/texture_ahead.h, with
no Vulkan in them, and tests/test_texture_ahead.py runs them.

It does nothing at an area change in play: there the game keeps its textures, none is announced again, and what a
return uploads is what the cache's budget let go.

Assisted-by: Claude Fable 5.2
Co-Authored-By: Claude Fable 5.2 <[email protected]>
docs(tested): textures prepared ahead on a Steam Deck OLED, arrivals after a save is loaded and area changes in play
Some checks are pending
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Conventional Commit title (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval needs a second approval (sensitive paths)
PR description / Description follows the template (pull_request_target) Successful in 4s
ff04d32e36
Assisted-by: Claude Fable 5.2
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Author
Contributor

Tested in game: Steam Deck OLED (RADV VANGOGH, Mesa 26.2.0-devel, SteamOS 3.9.5), without a screen: 16 runs, a save loaded in Kokiri Forest and one in Hyrule Field, then four teleports between the two areas. With RX_VK_TEX_AHEAD=1 the second load of a save has 2 or 3 frames of 150 ms or more in its first 600 frames of play where main has 7 or 8 (Kokiri Forest), and 3 where main has 4 or 5 (Hyrule Field); the log's "vk: textures ahead" line counts 977 to 1,054 textures prepared on the loading screen in Kokiri Forest. No error, no device lost, no GPU timeout in the kernel log. This form of it was not looked at on a screen; an earlier form of the same mechanism was played on that Deck for an hour and a half on 2026-11-15 and again on 2026-11-16, nothing wrong reported.

Tested in game: Steam Deck OLED (RADV VANGOGH, Mesa 26.2.0-devel, SteamOS 3.9.5), without a screen: 16 runs, a save loaded in Kokiri Forest and one in Hyrule Field, then four teleports between the two areas. With RX_VK_TEX_AHEAD=1 the second load of a save has 2 or 3 frames of 150 ms or more in its first 600 frames of play where main has 7 or 8 (Kokiri Forest), and 3 where main has 4 or 5 (Hyrule Field); the log's "vk: textures ahead" line counts 977 to 1,054 textures prepared on the loading screen in Kokiri Forest. No error, no device lost, no GPU timeout in the kernel log. This form of it was not looked at on a screen; an earlier form of the same mechanism was played on that Deck for an hour and a half on 2026-11-15 and again on 2026-11-16, nothing wrong reported.
Owner

Let's make this on by default

Also @Beanstalk

Let's make this on by default Also @Beanstalk
Member

@HumanBean approval of ff04d32 recorded. This diff touches sensitive paths, so a second member of BigBeans must approve it too.

@HumanBean approval of `ff04d32` recorded. This diff touches sensitive paths, so a second member of `BigBeans` must approve it too.
Member

Beanstalk test farm

Commit ff04d32 · tier untrusted · approved by HumanBean · dashboard

This diff touches sensitive paths, so it needs two members of BigBeans: scripts/dev_packs.py

A member of BigBeans can review this commit and comment @Beanstalk to test it.

<!-- beanstalk:sticky --> ### Beanstalk test farm Commit `ff04d32` · tier **untrusted** · approved by HumanBean · [dashboard](https://beanstalk.magicbean.dev/prs/1122) This diff touches sensitive paths, so it needs two members of `BigBeans`: `scripts/dev_packs.py` A member of `BigBeans` can review this commit and comment `@Beanstalk` to test it.
Author
Contributor

Windows: longshot_vk.dll cross-built from the head ff04d32e with llvm-mingw 20261104, as build-windows.yml does it: 0 failed. The description has it under Testing, with its box; the status line's risk is the one word the check asks for.

Windows: `longshot_vk.dll` cross-built from the head ff04d32e with llvm-mingw 20261104, as build-windows.yml does it: 0 failed. The description has it under Testing, with its box; the status line's risk is the one word the check asks for.
Author
Contributor

@HumanBean happy to make it on by default once the farm has confirmed the gain on other hardware: so far it is measured on one Steam Deck only.

For this run, two things the farm needs to know, since the switch is off in ff04d32:

  • this PR's side has to run with RX_VK_TEX_AHEAD=1, or the two sides are the same code path;
  • the same save loaded twice on that side: the first load only fills the list (cache/longshot_textures_drawn.bin), the gain shows from the second.

What to compare: the frames of 150 ms or more in the first 20 s of play after the loading screen (Kokiri Forest is the heaviest here), and the log's vk: textures ahead: line, which says how many textures were prepared. An area change in play is expected to show no difference.

If the farm cannot set a switch, tell me and I will push the default on first so that it can run.

@HumanBean happy to make it on by default once the farm has confirmed the gain on other hardware: so far it is measured on one Steam Deck only. For this run, two things the farm needs to know, since the switch is off in ff04d32: - this PR's side has to run with `RX_VK_TEX_AHEAD=1`, or the two sides are the same code path; - the same save loaded twice on that side: the first load only fills the list (`cache/longshot_textures_drawn.bin`), the gain shows from the second. What to compare: the frames of 150 ms or more in the first 20 s of play after the loading screen (Kokiri Forest is the heaviest here), and the log's `vk: textures ahead:` line, which says how many textures were prepared. An area change in play is expected to show no difference. If the farm cannot set a switch, tell me and I will push the default on first so that it can run.
Some checks are pending
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Conventional Commit title (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval needs a second approval (sensitive paths)
PR description / Description follows the template (pull_request_target) Successful in 4s
This pull request has changes conflicting with the target branch.
  • docs/development.md
  • gpu/vk/vk_replay.cpp
Some workflows are waiting to be reviewed.
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'perf/textures-ahead:p0lux-perf/textures-ahead'
git switch 'p0lux-perf/textures-ahead'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!1122
No description provided.