Add experimental preset L and fix DLSS resource lifetimes and waits

- Build L texture variants and complete older release kernel bundles.
- Add selective Swin encoder fallback to reduce L/M motion trails.
- Add opt-in GPU motion-vector dilation for thin geometry and sky gaps.
- Replace GPU input waits with cancellable readiness polling and use
  sleeping event queries for completion.
- Retain recorded resources through command allocator completion, defer
  shutdown until cleanup, and preserve unfinished output synchronization.
- Extend lifecycle harness checks and add event, model and motion tests.
- Update configuration defaults, build scripts and release documentation.
This commit is contained in:
ayo committed 2026-10-02 00:30:46 -04:00
1 parent b645ef9096
commit f66cccaf28
32 files changed
+1362 -249

No files matched your search

+8 -1
View File
@@ -37,6 +37,7 @@ Install
1. Extract everything in this zip into the folder that holds the game's main .exe. For Unreal
Engine games that is <game>/<Project>/Binaries/Win64/, next to <Project>-Win64-Shipping.exe.
You get dxgi.dll, OptiScaler.ini, d3d12.dll, d3d12core.dll, this file and an d4r folder.
When updating, replace both d3d12 DLLs with the shim: it requires their resource-lifetime extension.
If the folder already has a dxgi.dll or OptiScaler.ini (another OptiScaler install), move those
out of the way first. Also remove PROTON_USE_OPTISCALER from the game's launch options if you
used GE-Proton's built-in OptiScaler: d4r brings its own.
@@ -65,10 +66,16 @@ Settings
start may compile a separate cache. Missing accuracy variants use translated kernels, never the
fast native set. The mode aims to match NVIDIA's output, but 1:1 RTX image quality is not proven.
- d4r/d4r.ini: d4r's settings for this game. The main one is the DLSS model:
K (DLSS 4, default), E (DLSS 3 CNN, a little faster) or M (DLSS 4.5, slowest).
K (DLSS 4, default), E (DLSS 3 CNN, a little faster), M (DLSS 4.5), or L (DLSS 4.5
for Ultra Performance, especially 4K; experimental). Set Model = L and select Ultra Performance
in game or OptiScaler. Choosing the model does not change the render resolution.
- On RDNA4, [Kernels] NativeFp8 is on by default. It selects native FP8 WMMA and the matching
gfx12-fp8 kernel folder; set it to false to use f16 widening. The FP8 path has not been tested
on a real RDNA4 GPU.
- If L/M shows extra trails in motion, try [Kernels] NativeSwinEncoders = false with
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.
- OptiScaler.ini: OptiScaler's settings, such as its fps overlay and the render resolution of each
quality mode. Press Insert in game for OptiScaler's menu.
+1 -1
View File
@@ -15,7 +15,7 @@ Third-party software, unmodified or patched by d4r:
Licenses: d4r/licenses/ZLUDA-LICENSE-*.txt, d4r/licenses/LLVM-LICENSE.txt
d3d12.dll, d3d12core.dll
vkd3d-proton (GNU LGPL 2.1), https://github.com/HansKristian-Work/vkd3d-proton
commit @VKD3D_COMMIT@ with d4r/source/patches/vkd3d-proton/0001 applied,
commit @VKD3D_COMMIT@ with d4r/source/patches/vkd3d-proton/0001 and 0002 applied,
built with its build-win64.txt cross file (meson --buildtype release).
Licenses: d4r/licenses/vkd3d-proton-*.txt
d4r/rocm/lib/ ROCm 7.2.4 runtime, unmodified, from AMD's Ubuntu 22.04 packages
+24 -11
View File
@@ -3,12 +3,19 @@
; that config/d4r.ini.default in the source repository lists for it, e.g. in the game's launch options.
[DLSS]
; Which DLSS network runs:
; K DLSS 4 transformer (default)
; E DLSS 3 CNN: a little faster, softer image
; M DLSS 4.5 transformer: best image, much slower on RDNA3
; game whatever the game (or OptiScaler's preset override) asks for
; Frame rates measured on an RX 7700 XT at 2560x1440, Quality mode: see D4R_README.txt.
; DLSS model recommendations:
;
; Model | DLSS | Recommended modes | Notes
; ------+-------+---------------------------------+----------------------------------
; K | 4 | DLAA / Quality / Balanced | Default; faster alternative to M/L
; M | 4.5 | Performance | More demanding on RDNA3
; L | 4.5 | Ultra Performance | Especially 4K; experimental
; E | 3 CNN | Quality / Balanced / Performance | Legacy faster fallback
; F | 3 CNN | DLAA / Ultra Performance | Deprecated; prefer K or L
;
; Select the upscaling mode separately in game/OptiScaler. These are recommendations;
; other modes are allowed. L requires the L texture build.
; game = use the game/OptiScaler choice. Benchmarks: D4R_README.txt.
Model = K
; NVIDIA's library marks the image "DLSS SDK - DO NOT DISTRIBUTE" in this setup; d4r turns that off.
; true shows it.
@@ -25,6 +32,9 @@ FrameAge = 0
; intermediate FP8/f16 rounding and denormal handling, and keeps NGX's synchronization calls.
; Slower but aims to match RTX DLSS.
PreferAccuracy = false
; false reduces L/M motion trails by using original enc1/enc2 layers; other native kernels stay on.
; Best paired with PreferAccuracy = true; costs some GPU time. Restart after changing this.
NativeSwinEncoders = true
; Hand-written RDNA3 and RDNA4 kernels for the DLSS 4 and 4.5 networks (d4r\kernels). Each one is used
; only when your DLSS library's code for that kernel matches the code it was written for; otherwise
; that kernel is compiled from NVIDIA's code instead, which is slower but still correct.
@@ -35,10 +45,13 @@ NativeKernels = on
NativeFp8 = on
[Interop]
; These keep DLSS's inputs and output in video memory and move the waits between the game and DLSS
; onto the GPU. Leave them on unless you are chasing a problem.
; Experimental thin-feature tracking: 0 = off; 1/2 = opaque-surface dilation radius.
; Both enabled values fill sky gaps from the nearest foreground within 8 render pixels.
; Requires render- or display-resolution, unjittered motion vectors and same-frame linear VRAM inputs. Restart to change.
; Unsupported features keep original vectors; larger radii may affect disocclusion edges.
MotionVectorDilation = 0
; Keep inputs and output in video memory. Input and output readiness waits use CPU sleeps.
VramInterop = true
GpuWait = true
LinearInputs = true
ElideNgxSync = true
; Lets DLSS's last kernel write straight into the game's output buffer (DLSS 4 / K only). It takes
@@ -59,5 +72,5 @@ Profile = false
[Env]
; Extra environment variables for d4r, NAME = value.
; Use a blocking CUDA event while waiting for DLSS output.
; D4R_SHIM_BLOCKING_SYNC = 1
; Sleeping event queries are the default; 0 restores context waits for an A/B comparison.
; D4R_SHIM_BLOCKING_SYNC = 0