mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-20 03:59:59 -04:00
Try an FSR 3.1 context creation once more after the GPU is past the contexts let go of, instead of failing the run.
The review of 09027478 found that FSR 3.1 lost its fallback for a refused creation. Up to 0.10.1, vk_ffx.cpp context_for waited for the device and destroyed the other render size's or the least recently used context before create_counted, so their video memory was free for the new one. Since 09027478 they only go into g_dead, and the drain in vk_upscaler_let_go destroys those whose last upscale the GPU is past. When it is still behind and the library refuses the new context for want of memory, context_for returned nullptr, vk_ffx_upscale 0, and evaluate's dl_fail turned DLAA off for the run. DLSS (evaluate) and FSR 4 (context_for) already wait for the GPU to pass what they let go of and try again. context_for now does the same when the creation is refused and FSR 3.1's or FSR 4's list of contexts let go of is not empty: vk_upscaler_gpu_wait (a timeline wait for those submissions, not the device's idle; the device with upscaler_idle_wait = 1), vk_ffx_dead_take, and a second create_counted when something was destroyed. A line says the refusal, the wait and the outcome. upscaler_idle_check now also fails when vk_dlaa.c evaluate or vk_ffx.cpp or vk_ffx4.cpp context_for has no vk_upscaler_gpu_wait (a scratch copy without the retry fails it), and docs/building.md says so. Not reproduced before the change (found by review). Checks that passed: vk_ffx.cpp compiles with -Wall -Wextra and no warning, upscaler_idle_check, tools/check_content.py --staged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,9 @@ It fails when:
|
||||
- one of the places that let something go (vk_dlaa.c free_size, free_snap, stale_sizes, release_kept, hudless_from,
|
||||
pb_images, retire_idle and evaluate, vk_ffx.cpp and vk_ffx4.cpp context_for) does not call vk_upscaler_let_go, which
|
||||
frees what the GPU is past and which the rollback switch turns into a wait for the device;
|
||||
- one of the places that create a DLSS feature or an FSR context (vk_dlaa.c evaluate, vk_ffx.cpp and vk_ffx4.cpp
|
||||
context_for) does not call vk_upscaler_gpu_wait: a creation refused while what was let go of is still in flight
|
||||
then fails for want of its video memory, where the wait for the device of 0.10.1 had freed it first;
|
||||
- NX2NAVI_UPSCALER_IDLE_WAIT has no sections[] entry in cfg.c or no line in nx2navi.ini.example (its known[] name and
|
||||
its metas[] row, and a // that would hide them, are tests/cfg_rows_check.py's);
|
||||
- perf.c's mark_name has another count of names than host.h has PERF_M_* kinds: a kind without a name prints a null
|
||||
@@ -35,6 +38,11 @@ LET_GO = { # functions that let something go and must call vk_upscaler_let_go
|
||||
'vk_ffx.cpp': ['context_for'],
|
||||
'vk_ffx4.cpp': ['context_for'],
|
||||
}
|
||||
REFUSED = { # functions that create a feature or context and must retry a refusal after vk_upscaler_gpu_wait
|
||||
'vk_dlaa.c': ['evaluate'],
|
||||
'vk_ffx.cpp': ['context_for'],
|
||||
'vk_ffx4.cpp': ['context_for'],
|
||||
}
|
||||
# A function definition: at column 0, a return type, the name, the parameters and the body's brace (the runtime's
|
||||
# style); declarations end with ';' before any '{'. Read in code whose string literals are blanked: extern "C" is
|
||||
# extern " " there.
|
||||
@@ -141,6 +149,14 @@ def main():
|
||||
fails.append(f'{f}: no function {name}')
|
||||
elif not re.search(r'\bvk_upscaler_let_go\s*\(', b):
|
||||
fails.append(f'{f} {name}: lets something go without vk_upscaler_let_go')
|
||||
for f, names in REFUSED.items():
|
||||
code, funcs = sources[f]
|
||||
for name in names:
|
||||
b = body(code, funcs, name)
|
||||
if b is None:
|
||||
fails.append(f'{f}: no function {name}')
|
||||
elif not re.search(r'\bvk_upscaler_gpu_wait\s*\(', b):
|
||||
fails.append(f'{f} {name}: no retry of a refused creation after vk_upscaler_gpu_wait')
|
||||
|
||||
key = 'UPSCALER_IDLE_WAIT'
|
||||
cfg = (rt / 'cfg.c').read_text(encoding='utf-8-sig')
|
||||
|
||||
Reference in New Issue
Block a user