mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-15 19:19:58 -04:00
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>
42 lines
1.5 KiB
Python
42 lines
1.5 KiB
Python
"""Build and run tests/pass_hooks_check.c: runtime/vk_pass_hooks.h, which pass begin runs the frame's pass hooks
|
|
(vk_exec.c vk_exec_pass_begin): a parallel group's run once, at its first chunk's first pass, so a pass begun again
|
|
later does not put its own target back as the upscaler's light target.
|
|
|
|
No GPU, no game files, any Python.
|
|
|
|
Usage: pass_hooks_check.py
|
|
"""
|
|
import os
|
|
import shutil
|
|
import subprocess
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
MSYS_BIN = Path(r'C:\msys64\ucrt64\bin')
|
|
|
|
|
|
def compiler():
|
|
"""$CC, else MSYS2 UCRT64's clang, else clang on PATH (as tests/diff/common.py picks it, without its Unicorn)."""
|
|
if os.environ.get('CC'):
|
|
return os.environ['CC']
|
|
if os.name == 'nt' and (MSYS_BIN / 'clang.exe').exists():
|
|
return str(MSYS_BIN / 'clang.exe')
|
|
return shutil.which('clang') or 'clang'
|
|
|
|
|
|
def main():
|
|
work = ROOT / 'build' / 'test' / 'pass_hooks'
|
|
work.mkdir(parents=True, exist_ok=True)
|
|
exe = work / ('pass_hooks_check.exe' if os.name == 'nt' else 'pass_hooks_check')
|
|
env = dict(os.environ)
|
|
if os.name == 'nt' and MSYS_BIN.exists():
|
|
env['PATH'] = str(MSYS_BIN) + os.pathsep + env.get('PATH', '')
|
|
subprocess.check_call([compiler(), '-std=gnu11', '-O1', '-Wall', '-Werror', '-I', str(ROOT / 'runtime'),
|
|
str(ROOT / 'tests' / 'pass_hooks_check.c'), '-o', str(exe)], env=env)
|
|
return subprocess.run([str(exe)], env=env).returncode
|
|
|
|
|
|
if __name__ == '__main__':
|
|
sys.exit(main())
|