With sync_ahead, a timestamp the frame wait did not cover reads as the newest one written at that wait, so the dynamic resolution controller never reads a wrapped GPU time (#1123)

The game converts the end and then the begin report of a pair and subtracts them unsigned. With the frame wait one
frame late the end could be unwritten (0) or hold the value of the report before it, and the difference wrapped to
about 2^64: an over-budget frame for the controller, two in a row drop the game to its lowest quality level. Reads of
a report that holds 0, a time after the bound, or whose newest replayed report is not done read the bound instead,
so a pair in submission order never reads end < begin. Guest memory, RENDER_COND and samples-passed counts are
unchanged. TOTK_SYNC_AHEAD_TIMESTAMPS=0 turns it off, =check counts without replacing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Valiantsin DzerakhandClaude Opus 5.5 committed 2026-11-25 15:46:45 +03:00
1 parent ed8fa04034
commit 47eb44d1b2
5 files changed
+107 -5

No files matched your search

+6 -2
View File
@@ -60,8 +60,12 @@ NVN_API(nvnDeviceSetAutomaticCheckpointsMask) { (void)c; }
static uint64_t ticks_to_ns(uint64_t t) { return t / 12 * 625 + t % 12 * 625 / 12; }
// uint64_t nvnDeviceGetCurrentTimestampInNanoseconds(const NVNdevice *d)
NVN_API(nvnDeviceGetCurrentTimestampInNanoseconds) { ret_x(c, ticks_to_ns(rt_ticks())); }
// uint64_t nvnDeviceGetTimestampInNanoseconds(const NVNdevice *d, const NVNcounterData *counter)
NVN_API(nvnDeviceGetTimestampInNanoseconds) { ret_x(c, ticks_to_ns(((const NVNcounterData *)arg_p(c, 1))->timestamp)); }
// uint64_t nvnDeviceGetTimestampInNanoseconds(const NVNdevice *d, const NVNcounterData *counter): with the frame wait
// one frame late, a report that wait did not cover reads as the newest one written by then (vk_exec_xfer.c)
NVN_API(nvnDeviceGetTimestampInNanoseconds) {
const NVNcounterData *d = arg_p(c, 1);
ret_x(c, ticks_to_ns(vk_counter_timestamp((uintptr_t)d, d->timestamp)));
}
// ---------- memory pools and buffers
// size_t nvnMemoryPoolGetSize(const NVNmemoryPool *p)