Windows: drag-in install with a per-game d4r.ini

Players extract one ZIP into the game folder, copy their two NVIDIA
DLLs, and start the game from Steam, Epic or a shortcut. No launcher
script is needed; settings live in d4r\d4r.ini.

- Shim player mode: when the launcher has not set D4R_HIP_ROOT and
  d4r.ini sits beside the shim, derive the backend environment from it.
  Codegen flags stay at the Windows-validated values. NVIDIA DLLs must
  match an exact SHA256 in dll-pins.txt, with "you have X, you need Y"
  errors. Rejects a vkd3d/Wine d3d12.dll and code objects built for
  another GPU. [DLSS] Model accepts K or M and is applied by rewriting
  the render preset hints.

- d4r.ini exposes only options that exist on Windows: Model, AsyncInterop,
  ValidateOutput, Log, CacheDir. Invalid values fall back with a note in
  d4r_nvngx.log.

- d4r_nvngx_loader: one _nvngx.dll for all GPUs. It matches the game's
  adapter by LUID and loads _nvngx_<arch>.dll from the same folder.

- OptiScaler patch 0006: relative NvngxPath/NvngxDlssPath/
  NvngxFeaturePath resolve against OptiScaler's folder.

- package-windows-release.ps1 builds the release from the per-target
  game packages and refuses mixed targets or differing shared runtimes.

- Tests: test-player-config.ps1 (ini and DLL-pin decisions, loader
  selection on the local GPU) and test-windows-release-package.ps1.
This commit is contained in:
ayo committed 2026-10-03 03:10:19 -04:00
1 parent 7ab56d42fc
commit 65ab1460a8
13 files changed
+1004 -1

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
; d4r settings for this game (Windows). This file lives in the game's d4r folder and applies to
; this game only. Edit it with Notepad, save, and restart the game. Mistakes are reported in
; d4r\d4r_nvngx.log and by d4r-check.ps1; an invalid value falls back to the default shown here.
;
; Only settings that exist and are checked on Windows are listed. The Linux settings for other
; models, kernels and interop are not available here.
[DLSS]
; DLSS model:
;
; Model | DLSS | Recommended modes | Notes
; ------+------+----------------------------+--------------------------------------
; K | 4 | DLAA / Quality / Balanced | Default; faster
; M | 4.5 | Performance | More demanding
;
; Select the quality mode (Quality, Performance, ...) in the game or the OptiScaler menu (Insert).
; Models E and L are not available on Windows.
Model = K
[Interop]
; Experimental: lets the game continue while DLSS runs on the GPU instead of waiting for it.
; Requires a game that uses one D3D12 command queue. Off is the tested setting. Whether it is
; faster depends on the game and has not been measured broadly; turn it off if the game crashes,
; stutters or shows a wrong image.
AsyncInterop = false
[Debug]
; Check every DLSS output for invalid values (NaN/Inf) on the GPU. Costs some speed; use it only
; when reporting a problem.
ValidateOutput = false
; normal: errors and a summary in d4r\d4r_nvngx.log. verbose: every API call and kernel launch
; (large log; use it only when asked for a bug report).
Log = normal
[Paths]
; Folder for the compiled DLSS kernels. auto = %LOCALAPPDATA%\d4r\cache. The first launch fills it
; and can take several minutes; later launches are quick.
CacheDir = auto