Repository navigation
What's new
0.7.9.4: smoother first visits, less CPU, less memory, and a faster path for cards without mesh shaders. Several of
you wrote that 0.7.9.3 made loads long, frame rates drop when entering an area, and the CPU busy. Your logs showed why,
and this version fixes that first.
Before you update: this version prepares the shaders again, one time (the shaders of cards without mesh shaders
changed). The game code is built again only for the parts that changed.
Every figure below is from our PC (Ryzen 5 5500, RTX 3060 Ti, 16 GB) unless said otherwise.
Long loads, drops and a busy CPU since 0.7.9.3
Graphics pipelines are no longer built ahead of their first draw. 0.7.9.3 built, from the title screen on, the
pipelines of every program the game loaded, for every state it had ever been drawn with. In the logs you sent (#189,
#176, #66) that was 4,750 to 6,000 pipelines a session, of which only 12 to 20 % were ever drawn, for up to 463 seconds of
CPU work. Where the graphics driver keeps ReLink's pipelines in its cache that work is quick; where it does not (one
player's log shows the driver compiling them again right after the start's warm-up), every one of them is compiled again,
the CPU stays busy, and areas load slowly. Pipelines are now made at their first draw again, as before 0.7.9.3.
Measured against 0.7.9.3 on our PC: about 1 GB less video memory and 2.4 GB less RAM committed in the Market (the
shader read-ahead below takes 1.1 to 1.9 GB of that back).
RX_VK_EAGER_GRAPHICS=1 in relink_env.txt brings the old behaviour back. If you are on 0.7.9.3 and do not update
yet, RX_VK_EAGER_GRAPHICS=0 in relink_env.txt turns it off there, without preparing the shaders again.
Shaders are read while an area loads, not at their first draw. A shader was read from ReLink's shader cache only
when something first drew with it; entering an area asked for hundreds at once and they queued (105 ms on average before
they were ready, up to half a second), and what they draw was missing meanwhile. They are now read as soon as the game
loads them, on a low-priority thread. Measured on a tour of first visits (Kakariko, Hyrule Castle, Deku Tree, Hyrule Field),
two runs a side: shaders still missing at their first draw 1 and 6 instead of 1,175 and 1,240; time lost in hitches the
same; frame rate the same on 6 cores. It costs 1.1 to 1.9 GB more committed memory (the game loads more shaders than an
area draws); it stops reading ahead when the system has less than 3 GB of commit left. RX_VK_PROG_AHEAD=0 turns it off.
On 4 cores it may cost a few frames a second in some places (Kakariko and Hyrule Castle −5 % on average over two pairs,
within the runs' own spread): tell us if you see that.
Cards without mesh shaders (GTX 10 and 16 series, and the RX 6000 series since 0.7.9.3)
Those cards draw the game's mesh work through a compute path, which costs about 10 % of the frame rate on our card with
the path forced. That path is now faster: a vertex past what its meshlet produced is skipped before reading anything, and
only the meshlets the game's culling kept are run (it ran all of them and threw away the rest). Measured with the path
forced, runs taken in turn: Kakariko 69.5 → 72.2 fps (GPU 12.95 → 12.2 ms a frame), Lost Woods and Kokiri +1 to +2 %.
Pictures checked in Kakariko, the Lost Woods, Kokiri Forest and the Deku Tree. Not run on a real GTX or RX 6000 card.
Smoother play
- The neighbouring area the game unloads and loads again at an area's edge is now kept 1.5 s when you step back into
it: in the Market's edge, area reloads −73 % and time lost in hitches 12 to 29 % lower (four pairs of runs). - Fewer long submits: freeing memory and destroying the game's capture buffers no longer competes with sending frames
to the card (submits held over 1 ms 66 → 37 a run). - Mesh draws with counts written by the GPU are prepared at the game's barriers, in one batch, and the replay's parts
end at the game's own render passes: +3.1 % standing in the Lost Woods and Kokiri Forest. - Texture decoding (ASTC to BC on NVIDIA) runs several layers at a time: −21 % GPU time per decode at Hyrule Field's
arrival. - Controllers: Xbox pads are read on a thread of their own instead of the game's (empty pad slots cost the game's thread
about 0.3 ms a second on our PC). Checked with the keyboard only: tell us if your pad behaves differently. - The texture decoders are made before the game starts instead of at the title screen; texture reads and writes no longer
hold the game's CPU core.
Less memory
- The compute shaders' own code is let go once their pipelines are made: 0.3 to 0.6 GB less committed memory.
Known
- The first start prepares the shaders again (once).
RX_VK_GPL=1(graphics pipeline libraries) is still an experiment: on NVIDIA the linked pipelines alone were 8 to 20 %
slower on the GPU, so by default the full pipeline replaces them once it is built.