The in-place frame ahead merges every mirror write-back by words, is refused with import memory, and the probe checks its pending-write list

Without shadow storage a plain GPU copy back into a mirrored range lands after the game, told the value is done a
frame early, may have written other words of that range for the next frame; with TOTK_SYNC_AHEAD_WBMERGE (1 by
default) the copies' and updates' write-backs go through the word merge as a shader's do. With memory = import the
GPU reads vertex, index and storage data in place, and a check run on the islands saw the game rewrite about 10 KiB of
them a frame after the wait, so the switch is refused there unless shadow storage is on. --probe-vkmem checks the
pending-write list (newest writer below a bound, pruning, joining when full). The one-off readback rule copied from
Savage Wind gets its THIRD_PARTY_NOTICES.md row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Valiantsin DzerakhandClaude Opus 5.5 committed 2026-11-21 14:43:45 +03:00
1 parent b558317a7a
commit 54b4e092cd
10 files changed
+79 -16

No files matched your search

+8
View File
@@ -509,6 +509,14 @@ static int sync_mode(void) {
if (mode < 0) {
const char *v = cfg_value("TOTK_SYNC_AHEAD");
int on = strcmp(v, "0") != 0 && strcmp(v, "check") != 0, check = !strcmp(v, "check");
// In place (no shadow storage) the guards cover the VRAM mirrors' copies; with memory = import the GPU reads
// vertex, index and storage data straight from the game's memory, and a check run (TOTK_MEMORY=import,
// islands) saw the game rewrite ~10 KiB of them a frame after the wait, particles mostly.
if (on && !vk_mem_shadow_on() && !vk_mem_mirror_on()) {
rt_log("nvn: TOTK_SYNC_AHEAD needs shadow storage or the VRAM mirrors (memory = import reads the game's "
"vertex and storage data in place); the game waits for the GPU as before");
on = 0;
}
if ((on || check) && !frame_wait_lr()) {
rt_log("nvn: TOTK_SYNC_AHEAD: no frame wait site is known for this game version; the game waits for the "
"GPU as before");