mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-17 04:59:57 -04:00
Count a frame's submissions atomically: several guest threads submit at once from the pause menu's first frame on.
With a lost count the frame's first submission could go without its wait for the GPU, which is there against frames drawn with the next frame's data. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -708,7 +708,9 @@ NVN_API(nvnQueueSubmitCommands) {
|
||||
finish_mask = e && *e ? strtoll(e, NULL, 0) : 1;
|
||||
if (e && *e && finish_mask == 1 && !(e[0] == '0' && (e[1] == 'x' || e[1] == 'X'))) finish_mask = -1; // "1": all
|
||||
}
|
||||
int idx = nvn_submits_in_frame++;
|
||||
// several guest threads submit at once (the pause menu's first frame on): a plain ++ lost counts, and with one the
|
||||
// frame's first submission went without its wait, or a later one waited
|
||||
int idx = __atomic_fetch_add(&nvn_submits_in_frame, 1, __ATOMIC_RELAXED);
|
||||
if (finish_mask && f && (finish_mask == -1 || (idx < 63 && (finish_mask >> idx & 1)))) gfx_backend()->exec_wait(f, UINT64_MAX);
|
||||
nvn_call_note(0, (uintptr_t)q, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user