From 04a67aa765010dcfd3ee1efbae421940191a63f5 Mon Sep 17 00:00:00 2001 From: The412Banner Date: Sat, 5 Dec 2026 02:40:10 -0500 Subject: [PATCH] game-env: DLSS mode puts nvapi64.dll and NGX's DLLs into system32 DLSS games load nvapi64.dll and NGX's core from system32 only (NGXCore FullPath), which the bridge folder on WINEDLLPATH does not answer. Wine copies the bridges there only when a prefix is created with the upscaler already on. Bright Memory: Infinite's prefix predated it: "Failed to initialize NVAPI", then NGX "failed to load C:\windows\system32\_nvngx.dll". With nvapi64.dll, _nvngx.dll, nvngx.dll and nvngx_dlss.dll in its system32, the signature-fix hooks install and NGX reports "DLSS supported 1" with all quality modes (Red Magic 12 Pro). DLSS mode now copies the four there (copies, so writes into the prefix never reach DroidDeck's staged bridges) and refreshes them when their contents change; other modes remove them again when they are ours. (Supersedes 73442ad3, which placed only the two NGX core files and was reverted.) --- .../linuxfs/overlay/usr/local/bin/droiddeck-game-env | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/linuxfs/overlay/usr/local/bin/droiddeck-game-env b/tools/linuxfs/overlay/usr/local/bin/droiddeck-game-env index 82d877f8d8..cbe96fa3ce 100755 --- a/tools/linuxfs/overlay/usr/local/bin/droiddeck-game-env +++ b/tools/linuxfs/overlay/usr/local/bin/droiddeck-game-env @@ -1190,8 +1190,9 @@ def time_now(): return time.time() -def upscale_link(source, target): - """target = source's bytes: a hard link when both are on one file system, else a copy. Kept when equal.""" +def upscale_link(source, target, hard_link=True): + """target = source's bytes: a hard link when both are on one file system (and hard_link), else a copy. Kept when + equal.""" if os.path.isfile(target) and os.path.getsize(target) == os.path.getsize(source): with open(source, "rb") as a, open(target, "rb") as b: if a.read() == b.read(): @@ -1200,6 +1201,8 @@ def upscale_link(source, target): if os.path.lexists(staged): os.unlink(staged) try: + if not hard_link: + raise OSError("copy wanted") os.link(source, staged) except OSError: with open(source, "rb") as src, open(staged, "wb") as dst: @@ -1230,7 +1233,9 @@ def upscale_ngx_files(prefix, bridges, dlss): if not os.path.isfile(source): continue if dlss: - upscale_link(source, target) + # A copy, not a hard link: something writing over the prefix's nvapi64.dll in place must not change + # DroidDeck's staged bridge. + upscale_link(source, target, hard_link=False) elif os.path.isfile(target) and os.path.getsize(target) == os.path.getsize(source): with open(source, "rb") as a, open(target, "rb") as b: if a.read() == b.read():