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

+14
View File
@@ -137,6 +137,20 @@ D4R_ZLUDA_DIR=~/.cache/d4r-zluda-current D4R_VKD3D_DIR=~/.cache/d4r-vkd3d-d4r D4
scripts/package_release.sh # -> dist/d4r-<version>.zip
```
Set `D4R_INSTALL_MODE=asi` to build `d4r-<version>-asi.zip` for an existing
game-local OptiScaler installation. Its only top-level entries are `d4r.asi`
and `d4r/`, ready to extract into the configured plugin folder. It omits
OptiScaler's DLL/INI and does not require `D4R_OPTISCALER`. The runtime and
`install.sh` are inside `d4r/`; the NVIDIA installer also accepts its original
proxy-package layout. The native `d4r/d4r-setup.exe` helper installs the supplied
D3D12 pair beside the game EXE and merges the NGX route into the active loader's
INI (including GE-Proton's prefix-local INI) with backups, after
waiting for the invoking game process to exit. Subsequent unchanged launches do
nothing. `InitializeASI` launches setup without GPU work under the loader lock.
The build writes `build/d4r.asi` and `build/d4r-setup.exe`.
See [ASI_README.txt](../packaging/ASI_README.txt).
The script:
- builds the shim, the bridge and both fast and accuracy network-layer kernels for gfx1100–gfx1103 and gfx1200–gfx1201 by default (`D4R_GPU_ARCHS` can select fewer targets); each gfx12 target also gets an `<arch>-fp8` variant;
- writes the kernel manifest from the DLLs you list (it records hashes of their PTX, nothing else);