mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-18 15:19:58 -04:00
Download the pinned Streamline runtime for DLSS Frame Generation, and let the build kit carry it too.
make_launcher.py --dlssg needed --streamline, a Streamline SDK folder unpacked by hand, and make_kit.py could not carry DLSS Frame Generation at all, so a game built from the kit always left it off. tools/streamline_pin.py now pins the Streamline 2.14.16 SDK release (its archive's size and SHA-256, and the SHA-256 of each file the game loads): without --streamline the scripts download the archive once, check it, keep only sl.interposer.dll, sl.common.dll, sl.dlss_g.dll, sl.pcl.dll, sl.reflex.dll, nvngx_dlssg.dll and the two licence texts, each checked, and delete the archive. A folder given with --streamline must hold the pinned files. The bin/dlssg/ assembly moves from make_launcher.py into streamline_pin.place, so the release and the kit write the same set and the same dlssg-NOTICE.txt: a kit made with --dlssg and the 0.6.0 release's nx2navi_dlssg.dll has a bin/dlssg/ identical to the 0.6.0 release's, byte for byte. make_kit.py takes --dlssg [--streamline] like the launcher. nx2navi_dlssg.dll itself still comes from tools/build_dlssg.py. tests/launcher_test.py test_streamline_pin covers the extraction, the cache, refused archives and folders, and the notice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -21,8 +21,10 @@ The release folder (--out) holds:
|
||||
bin/nvngx_dlss.dll and its notice (NVIDIA DLSS at the version tools/dlss_pin.py
|
||||
pins, downloaded from NVIDIA's DLSS SDK repository and checked, or --dlss; not with
|
||||
--no-dlss),
|
||||
bin/dlssg/ with --dlssg and --streamline (DLSS Frame Generation: nx2navi_dlssg.dll,
|
||||
Streamline's runtime DLLs and nvngx_dlssg.dll, their licences and a notice),
|
||||
bin/dlssg/ with --dlssg (DLSS Frame Generation: nx2navi_dlssg.dll, Streamline's
|
||||
runtime DLLs and nvngx_dlssg.dll at the version tools/streamline_pin.py pins,
|
||||
downloaded from NVIDIA's Streamline SDK release and checked, or --streamline; their
|
||||
licences and a notice),
|
||||
lib/libnx2navirt.a (the runtime, prebuilt with the release's compiler),
|
||||
prompt-art/ with --prompt-art (the button art make_game.py draws the Xbox,
|
||||
PlayStation and keyboard and mouse prompts from, tools/prompt_art.py art_files),
|
||||
@@ -58,6 +60,7 @@ sys.path.insert(0, str(ROOT / 'tools'))
|
||||
import check_content # noqa: E402
|
||||
import dlss_pin # noqa: E402
|
||||
import prompt_art # noqa: E402
|
||||
import streamline_pin # noqa: E402
|
||||
from launcher import toolchain # noqa: E402
|
||||
from launcher.paths import Layout # noqa: E402
|
||||
|
||||
@@ -172,50 +175,6 @@ def build_python(py):
|
||||
|
||||
# ---------------------------------------------------------------- app/<version>/
|
||||
|
||||
# DLSS Frame Generation: the files tools/make_game.py DLSSG_FILES names, put beside the game from bin/dlssg/.
|
||||
DLSSG_FILES = ('nx2navi_dlssg.dll', 'sl.interposer.dll', 'sl.common.dll', 'sl.dlss_g.dll', 'sl.pcl.dll', 'sl.reflex.dll',
|
||||
'nvngx_dlssg.dll')
|
||||
DLSSG_NOTICE = 'dlssg-NOTICE.txt'
|
||||
|
||||
|
||||
def place_dlssg(dll, sdk, dest):
|
||||
"""DLSS Frame Generation into dest (the release's bin/dlssg/): nx2navi_dlssg.dll (tools/build_dlssg.py), NVIDIA
|
||||
Streamline's interposer and the plugins it loads, and NGX's nvngx_dlssg.dll, unmodified from the Streamline SDK's
|
||||
bin/x64, with Streamline's licence (MIT), the NVIDIA RTX SDKs License that covers nvngx_dlssg.dll, and a notice
|
||||
naming each file's sha256."""
|
||||
sdk_bin = sdk / 'bin' / 'x64'
|
||||
srcs = {n: (dll if n == 'nx2navi_dlssg.dll' else sdk_bin / n) for n in DLSSG_FILES}
|
||||
texts = {'streamline-LICENSE.txt': sdk / 'license.txt',
|
||||
'nvidia-rtx-sdks-LICENSE.txt': sdk_bin / 'nvngx_dlss.license.txt'}
|
||||
missing = [str(p) for p in (*srcs.values(), *texts.values()) if not p.is_file()]
|
||||
if missing:
|
||||
sys.exit(f'DLSS Frame Generation: {", ".join(missing)} missing')
|
||||
dest.mkdir(parents=True, exist_ok=True)
|
||||
lines = ['DLSS Frame Generation for NX2navi. nx2navi_dlssg.dll is NX2navi\'s own code (runtime/dlssg/), built',
|
||||
'with the Streamline SDK\'s headers. The other files are NVIDIA\'s own builds, unmodified, from the',
|
||||
f'{streamline_version(sdk)} SDK (https://github.com/NVIDIA-RTX/Streamline): the sl.*.dll files under its',
|
||||
'MIT licence (streamline-LICENSE.txt), nvngx_dlssg.dll under the NVIDIA RTX SDKs License',
|
||||
'(nvidia-rtx-sdks-LICENSE.txt), which licenses it only for use on systems with NVIDIA GPUs. They are not',
|
||||
'part of NX2navi and NX2navi\'s licence does not cover them.', '']
|
||||
for n, p in srcs.items():
|
||||
shutil.copy2(p, dest / n)
|
||||
lines.append(f'{n} sha256 {sha256_file(p)}')
|
||||
for n, p in texts.items():
|
||||
shutil.copy2(p, dest / n)
|
||||
(dest / DLSSG_NOTICE).write_text('\n'.join(lines) + '\n', encoding='utf-8')
|
||||
|
||||
|
||||
def streamline_version(sdk):
|
||||
"""'Streamline 2.14.16' from the SDK's README title line, or 'Streamline' when it names none."""
|
||||
try:
|
||||
for line in (sdk / 'README.md').read_text(encoding='utf-8', errors='replace').splitlines()[:5]:
|
||||
if 'Version' in line:
|
||||
return 'Streamline ' + line.rsplit('Version', 1)[1].strip()
|
||||
except OSError:
|
||||
pass
|
||||
return 'Streamline'
|
||||
|
||||
|
||||
def build_app(app, ver, xlate, feed_repo, lock, ffx=None, dlss=None, art=None, dlssg=None):
|
||||
copy_tree(ROOT / 'launcher', app / 'launcher')
|
||||
for d in ('runtime', 'recomp'):
|
||||
@@ -237,7 +196,7 @@ def build_app(app, ver, xlate, feed_repo, lock, ffx=None, dlss=None, art=None, d
|
||||
if dlss: # DLSS: NGX loads it from beside the game (runtime/vk_dlaa.c); make_game.py copies it there
|
||||
dlss_pin.place(dlss, app / 'bin')
|
||||
if dlssg: # DLSS Frame Generation (runtime/vk_dlssg.c): make_game.py place_dlssg copies it beside the game
|
||||
place_dlssg(dlssg[0], dlssg[1], app / 'bin' / 'dlssg')
|
||||
streamline_pin.place(dlssg[0], dlssg[1], app / 'bin' / 'dlssg')
|
||||
if art: # make_game.py draws the button prompts from it (its prompts step)
|
||||
n, size = prompt_art.copy_art(art, app / prompt_art.FOLDER)
|
||||
say(f'button art: {n} pictures, {size / 1e6:.1f} MB')
|
||||
@@ -354,9 +313,10 @@ def main():
|
||||
"downloading it from NVIDIA's DLSS SDK repository")
|
||||
ap.add_argument('--no-dlss', action='store_true', help='leave NVIDIA DLSS out of the release')
|
||||
ap.add_argument('--dlssg', type=Path, metavar='DLL',
|
||||
help='nx2navi_dlssg.dll (tools/build_dlssg.py) for DLSS Frame Generation, with --streamline')
|
||||
help='nx2navi_dlssg.dll (tools/build_dlssg.py) for DLSS Frame Generation')
|
||||
ap.add_argument('--streamline', type=Path, metavar='SDK',
|
||||
help='the Streamline SDK folder whose bin/x64 gives the Streamline and nvngx_dlssg.dll files')
|
||||
help=f'the Streamline {streamline_pin.VERSION} SDK folder whose bin/x64 gives the Streamline and '
|
||||
'nvngx_dlssg.dll files, instead of downloading the SDK release with --dlssg')
|
||||
ap.add_argument('--prompt-art', type=Path, nargs='+', metavar='FOLDER',
|
||||
help='the button art: folders holding XGamepad, P5Gamepad and Keyboard_Mouse, or those folders')
|
||||
ap.add_argument('--out', type=Path, default=MAIN_ROOT / 'build' / 'launcher-release')
|
||||
@@ -386,10 +346,10 @@ def main():
|
||||
+ (f' (CLANG64 clang left out: {lock["fast_skipped"]})' if lock.get('fast_skipped') else ''))
|
||||
dlss = None if a.no_dlss else dlss_pin.resolve(a.dlss, DL)
|
||||
say(f'NVIDIA DLSS {dlss_pin.VERSION}: {dlss}' if dlss else 'NVIDIA DLSS left out (--no-dlss)')
|
||||
if bool(a.dlssg) != bool(a.streamline):
|
||||
sys.exit('--dlssg and --streamline go together')
|
||||
dlssg = (a.dlssg, a.streamline) if a.dlssg else None
|
||||
say(f'DLSS Frame Generation: {a.dlssg}, {streamline_version(a.streamline)}' if dlssg
|
||||
if a.streamline and not a.dlssg:
|
||||
sys.exit('--streamline goes with --dlssg')
|
||||
dlssg = (a.dlssg, streamline_pin.resolve(a.streamline, DL)) if a.dlssg else None
|
||||
say(f'DLSS Frame Generation: {a.dlssg}, Streamline {streamline_pin.VERSION}: {dlssg[1]}' if dlssg
|
||||
else 'DLSS Frame Generation left out (no --dlssg)')
|
||||
build_app(folder / 'app' / ver, ver, a.xlate, a.feed, lock, a.ffx, dlss, a.prompt_art, dlssg)
|
||||
(folder / 'app' / 'current.txt').write_text(ver + '\n', encoding='utf-8')
|
||||
|
||||
Reference in New Issue
Block a user