Engine: native preset L (rrlite unfolded input, expansion and reconstruction stages)

This commit is contained in:
woutermans committed 2026-10-10 23:58:18 +02:00
1 parent de37ca5869
commit 653460f7b2
22 files changed
+1109 -237

No files matched your search

+5 -4
View File
@@ -86,11 +86,12 @@ Settings
PreferAccuracy = true. This uses original translated enc1/enc2 layers while retaining other
native acceleration. It reduced trails in a captured Townfall sequence on RX 7700 XT and costs
some GPU time. Restart after changing it; other scenes and RDNA4 hardware still need testing.
- [Engine] Enabled = true (experimental, off by default) runs DLSS 4 (K) and 4.5 (M) on d4r's own Vulkan
inference engine: the upscale is recorded into the game's own frame instead of going through CUDA
- [Engine] Enabled = true (experimental, off by default) runs DLSS 4 (K) and 4.5 (M and L) on d4r's own
Vulkan inference engine: the upscale is recorded into the game's own frame instead of going through CUDA
emulation. It needs Mesa RADV with VK_KHR_cooperative_matrix and the models in d4r/engine/k (K),
d4r/engine/k-ldr (K in games without HDR), d4r/engine/m and d4r/engine/m-ldr (M). Games and settings
it does not cover (other models, display-resolution motion vectors with M) keep using the normal path,
d4r/engine/k-ldr (K in games without HDR), d4r/engine/m and d4r/engine/m-ldr (M), d4r/engine/l and
d4r/engine/l-ldr (L). Games and settings it does not cover (other models, display-resolution motion
vectors with L or M) keep using the normal path,
and d4r/d4r_nvngx.log says which one ran and why. Tested in one game so far.
This zip has only the engine's shaders in d4r/engine/k. The weights (weights.bin, offsets.bin,
lut.bin) are read from your own nvngx_dlss.dll with the tools in d4r's source repository
+2
View File
@@ -1,5 +1,7 @@
# Unreleased
- Native engine, preset L (DLSS 4.5, render preset 12): the engine now runs L ([Engine] Enabled, models in `engine/l` and `engine/l-ldr`, built by `engine/compile_m.py` from a capture of preset L; `scripts/install_d4r_runtime.sh` stages `D4R_ENGINE_MODEL_L` / `D4R_ENGINE_MODEL_L_LDR`). Every stage, `d4r-m` on captured frames and the D3D12 harness are byte-identical to the CUDA backend running NVIDIA's translated kernels, apart from isolated single-frame knife edges (96-122 dB). 1280x720 -> 3840x2160 takes 3.8 ms on an RX 9070 XT. Display-resolution motion vectors keep the CUDA backend, as for M. Details: `engine/L_NOTES.md`.
- Native engine fixes found with L, which also apply to M (rebuild M packages with the current `compile_m.py`): the encoders' patch merge is clamped to ±2π as NVIDIA's kernels do; the automatic exposure is measured on NGX's grid at Ultra Performance (half the render size, at least 256, when the output is more than twice the render size; half the output was used, which changed every value downstream); the downsample's filter weights are exact (glslang rounded them toward zero: 92% of the output values were identical, now all); and the network uses the summation order of NVIDIA's kernels as ZLUDA runs them. M is now byte-identical to that CUDA backend in the harness too, where it measured 36-41 dB.
- `scripts/check_redistributable.py` refuses NVIDIA's binaries, NGX SDK headers, PTX and code objects, d4r's PTX translations and the engine's model data. `scripts/package_release.sh` runs it on every release before zipping, and `git config core.hooksPath scripts/git-hooks` runs it before each commit.
- Native engine fixes: the K adapter now passes the game's exposure scale to the exposure shader (it was silently ignored); the HIP network's shared buffers are reused across feature recreation instead of leaking their ROCm mapping (21 → 6 imports over seven K features in the harness); `hipnet.bin` must belong to the preset being created; an M-only game no longer loads the K model; `scripts/install_d4r_runtime.sh` stages `engine/k-ldr` and each model's `hip/` folder.
- Native engine, preset K: output is now byte-identical to the CUDA reference over an eleven-frame sequence at Quality (1706×960 → 2560×1440, native HIP network, RX 9070 XT), where later frames previously fell to 47–51 dB. The engine now selects NGX's reconstruction table by upscaling ratio instead of using one table for every ratio, and two rounding-order differences in the input and output stages are gone. K models must be rebuilt (`prepare_k.py`, `compile_k.py`); older packages still load and behave as before.
+2 -2
View File
@@ -61,9 +61,9 @@ ElideNgxSync = true
DirectOutput = auto
[Engine]
; Experimental. Runs DLSS 4 and 4.5 (models K and M) on d4r's own Vulkan inference engine instead of NVIDIA's
; Experimental. Runs DLSS 4 and 4.5 (models K, L and M) on d4r's own Vulkan inference engine instead of NVIDIA's
; kernels: the game shows the result of the frame it just rendered and [Latency] / [Interop] do not apply.
; Needs Mesa RADV with VK_KHR_cooperative_matrix and the models in d4r\engine\k, k-ldr, m and m-ldr
; Needs Mesa RADV with VK_KHR_cooperative_matrix and the models in d4r\engine\k, k-ldr, m, m-ldr, l and l-ldr
; (see D4R_README.txt). Games or settings it does not cover use the normal path; d4r_nvngx.log says why.
Enabled = false
; Another model K folder for games with the HDR flag (a path relative to the d4r folder, or a Windows path