ASI add-on for existing OptiScaler installs

Add an optional D4R_INSTALL_MODE=asi release (d4r-<version>-asi.zip)
holding only d4r.asi and a companion d4r/ folder, to drop into an
existing OptiScaler plugin directory.

- Shim: export InitializeASI. It identifies OptiScaler by its PE export
  name to find the active INI, then launches d4r-setup.exe out of
  process (no GPU or network work under the loader lock). The .asi
  build loads its runtime and config from the companion d4r/ folder.

- tools/d4r_asi_setup.cpp: native helper. It waits for the game to
  exit, installs the D3D12 wrapper and the private d4r12core.dll beside
  the EXE, and merges the NGX route into the loader's INI (including
  GE-Proton's prefix-local INI) with backups. Unchanged launches do
  nothing. It skips Proton helpers and background utilities and runs
  setup for one plugin install at a time.

- scripts/private_d3d12_core.py: points vkd3d's d3d12.dll forwarder at
  d4r12core.dll without moving code addresses.

- install.sh runs from inside the ASI's d4r/ as well as the proxy
  release root. d4r-check.sh checks ASI installs (loader, plugin path,
  LoadAsiPlugins, HookOriginalNvngxOnly, Wine drive paths).

- Packaging, build script, docs, ASI_README.txt and tests.
This commit is contained in:
ayo committed 2026-10-12 17:36:01 -04:00
1 parent 85175e0b27
commit d5c8be25c8
16 files changed
+1091 -39

No files matched your search

+19
View File
@@ -126,6 +126,25 @@ When updating, replace `d3d12.dll` and `d3d12core.dll` together with `d4r/nvngx.
ROCm does not need to be installed: the zip includes its runtime (from AMD's Ubuntu 22.04 packages, which run under Steam's container runtime on any distribution). The downloaded NVIDIA files and the bundled kernels built from NVIDIA's code are not covered by this repository's license (see [NOTICE](NOTICE)). The Proton prefix and the system are not changed. [packaging/D4R_README.txt](packaging/D4R_README.txt) is the full guide that ships in the zip; `scripts/package_release.sh` builds the zip (see [docs/building.md](docs/building.md#7-package-a-release)).
### Existing OptiScaler: ASI add-on
The optional `d4r-<version>-asi.zip` contains only `d4r.asi` and a companion
`d4r/` folder. Drop both into your existing OptiScaler plugin folder, then run
`bash install.sh` inside that `d4r/` folder once for NVIDIA's DLLs. Keep the Steam
launch options above and ensure `[Plugins] LoadAsiPlugins=true` is already enabled.
On the first game launch, the ASI starts its native setup helper. Close the game
at the setup message; the helper installs the D3D12 wrapper and private core beside the EXE
and configures OptiScaler after the game exits, with backups. Launch again when
the ready message appears. Unrelated settings, other plugins and the existing
OptiScaler loader are preserved. The rest of the runtime stays beside the ASI
in its companion folder. No Python or configuration command is needed.
Use OptiScaler 0.9.4 through its game-local proxy or GE-Proton's built-in loader;
setup finds the active loader's INI even when it lives in the prefix. OptiScaler's
`nvngx.dll` mode does not load ASIs. See [the ASI installation guide](packaging/ASI_README.txt)
for custom plugin paths, updating and removal. ASI loading still needs game testing.
## Requirements (building from source)
- Linux with an AMD RDNA3 or RDNA4 GPU. The native kernels use gfx11 or gfx12 WMMA. `scripts/package_release.sh` builds network kernels for gfx1100–gfx1103 and gfx1200–gfx1201 by default; `D4R_GPU_ARCH` selects one target for a standalone `kernels/build.sh` invocation. Runtime support outside the RX 7700 XT remains unverified on hardware (see [GPU support](#gpu-support)).