mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-05 12:35:42 +00:00
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.)
This commit is contained in:
1 parent
e5d7bddfdb
commit
04a67aa765
1 file changed
+8
-3
@@ -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():
|
||||
|
||||
Reference in new issue
Block a user