Run a parallel group's pass hooks once, at its first chunk's first pass.

With Helpers take small jobs on (replay_small, with replay_pipe) the whole scene flashed for single frames under
DLSS, with the interface intact. The pass hooks keep what the last pass that ran them left: the upscaler's light
target is the one of the last scene pass before the output pass. A group's hooks run in its first chunk, and a pass
that chunk began again (after a barrier, or a texture lookup that waited for its turn) ran them a second time. With
the submitting thread already past the group, that came after the hooks of later passes and put the group's own
target back, so the upscaler took an earlier image of the frame for that frame. The log showed it: the light target
changed to another image and back at each flash.

The rule is in runtime/vk_pass_hooks.h, with tests/pass_hooks_check, which fails against the old rule.

Measured by replaying a bug capture in Kakariko (DLSS Performance, 3 workers, replay_pipe = 4, replay_small = 16,
100 s a run): 51 and 52 flash frames as installed, none with replay_small = 0, none with the helpers off, 52 with the
render target reuse off. Two copies of the installed build made the same way, one with this change and one without:
no flash frame in two runs with it, 373 in one run without.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-14 06:44:38 -05:00
parent 7a8bbad47e
commit 1d0327acd1
5 changed files with 159 additions and 4 deletions

View File

@@ -55,6 +55,11 @@ cards).
- **Flashing or white foliage on cards that take the mesh shader fallback** (reported on a Radeon RX 580): the numbers
each such draw goes by were written in an order the graphics card was free to change, and about half the draws got
the wrong ones. Each is now written exactly once (by Tobim6).
- **The whole scene flashing for single frames with *Helpers take small jobs* on** (`replay_small`, with *Helpers work
ahead*; the interface stayed as it was), under DLSS or FSR 3.1: a helper thread could name an earlier image of the
frame as the scene after a later one had been named, and the upscaler then took that image for one frame. At one
place in Kakariko with both settings as a tester had them, 51 and 52 frames flashed in two runs of 100 seconds, and
none with the fix. Both settings stay off by default.
- **Crashes and hangs found in a review of the whole runtime**; none was seen in our own play, and each fix has a check
of its own:
- a crash when the game read memory the lazy write-back was just handing to the GPU (NVIDIA and Intel cards);