Free fork of NotProton: Windows Steam games in Mac Steam, on CodeWeavers' Wine and Apple's Game Porting Toolkit
Swift apple-silicond3dmetaldxmtdxvkgame-porting-toolkitgptkmac-gamingmacosmetalfxrosetta-2steamsteam-playwinewinecx
feat(dlss): DLSS_FG gamefix key reports hardware GPU scheduling
raymondchins6e781b86f909
diff --git a/docs/GAMEFIXES.md b/docs/GAMEFIXES.mdindex 2f3de83..acb61c7 100644--- a/docs/GAMEFIXES.md+++ b/docs/GAMEFIXES.md@@ -32,6 +32,7 @@ logged, when:| `FRAMEGEN_FALLBACK` | `0`, `1` | Same as `NOTPROTON_FRAMEGEN_FALLBACK`, Fast-motion fallback: skips generated frames that would smear. On when unset || `FRAMEGEN_ENGINE` | `own`, `metalfx` | Same as `NOTPROTON_FRAMEGEN_ENGINE`: the built-in optical flow (`own`, the default) or MetalFX frame interpolation || `NVAPI` | `0`, `1` | `1` turns on Apple's `nvapi64` and `nvngx` (DLSS on MetalFX) on an engine with a linked Game Porting Toolkit, for `d3dmetal` only, and makes D3DMetal report an NVIDIA GeForce RTX 4090 (`D3DM_VENDOR_ID=0x10de`, `D3DM_DEVICE_ID=0x2684`, `D3DM_DEVICE_DESCRIPTION`; a `D3DM_*` from a conf or the launch options wins), since games offer DLSS only on an NVIDIA adapter. Off by default, since an nvapi that answers sends some games down NVIDIA-only paths |+| `DLSS_FG` | `0`, `1` | With `NVAPI=1` on `d3dmetal`, `1` sets `CX_ACTIVE_GRAPHICS_BACKEND=d3dmetal` so WineCX reports hardware GPU scheduling, which DLSS frame generation requires. Off by default: [frankea/Whisky#231](https://github.com/frankea/Whisky/pull/231) saw MetalFX frame interpolation on an M5 with D3DMetal 4.0b2 hang WindowServer || `DXMT_*`, `DXVK_*`, `MVK_*`, `VKD3D_*`, `D3DM_*`, `STAGING_*` | any | Exported as is || `MTL_HUD_ENABLED`, `WINEDEBUG`, `WINE_LARGE_ADDRESS_AWARE`, `WINE_CPU_TOPOLOGY` | any | Exported as is |diff --git a/dylib/feats/compat_run.sh b/dylib/feats/compat_run.shindex a15e3fb..5e73c64 100755--- a/dylib/feats/compat_run.sh+++ b/dylib/feats/compat_run.sh@@ -225,6 +225,7 @@ gamefix_backend=""gamefix_dlloverrides=""gamefix_msync=""gamefix_nvapi=""+gamefix_dlss_fg=""gamefix_args=""gamefix_log() {@@ -256,7 +257,7 @@ gamefix_reason() {case "$1" inBACKEND)case "$2" in dxmt|dxvk|wined3d|d3dmetal) ;; *) echo "not dxmt, dxvk, wined3d or d3dmetal" ;; esac ;;- MSYNC|RETINA|NVAPI|FRAMEGEN_UI|FRAMEGEN_FALLBACK|STEAMDECK)+ MSYNC|RETINA|NVAPI|DLSS_FG|FRAMEGEN_UI|FRAMEGEN_FALLBACK|STEAMDECK)case "$2" in 0|1) ;; *) echo "not 0 or 1" ;; esac ;;FRAMEGEN)# 1 is the 2x of the first release.@@ -339,6 +340,7 @@ load_gamefixes() {gamefix_log "DLLOVERRIDES=$value from the $from conf, launch options still win per DLL" ;;MSYNC) gamefix_msync=$value; gamefix_log "MSYNC=$value from the $from conf" ;;NVAPI) gamefix_nvapi=$value; gamefix_log "NVAPI=$value from the $from conf" ;;+ DLSS_FG) gamefix_dlss_fg=$value; gamefix_log "DLSS_FG=$value from the $from conf" ;;ARGS)if [ "$verb" = waitforexitandrun ]; thengamefix_args=$value@@ -699,6 +701,13 @@ activate_backend() {# Streamline loads an NGX core only when it is NVIDIA-signed; the engine's crypt32 and# wintrust answer for Apple's bridge from a signed Streamline module (ngx-signer-patch/).export NOTPROTON_NGX_SIGNER=1+ # DLSS frame generation wants hardware GPU scheduling; winecx's win32u reports it on+ # only for CX_ACTIVE_GRAPHICS_BACKEND=d3dmetal (CW HACK 24905). Opt-in: frank Whisky+ # #231 saw MetalFX frame interpolation on an M5 with D3DMetal 4.0b2 hang WindowServer.+ if [ "$gamefix_dlss_fg" = 1 ]; then+ export CX_ACTIVE_GRAPHICS_BACKEND=d3dmetal+ graphics_log "DLSS_FG=1: hardware GPU scheduling reported on for DLSS frame generation"+ figraphics_log "NVAPI=1: $nv_dlls on, adapter $D3DM_VENDOR_ID:$D3DM_DEVICE_ID ($D3DM_DEVICE_DESCRIPTION)"else[ "$gamefix_nvapi" != 1 ] || graphics_log "NVAPI=1 not applied, $backend is not d3dmetal"@@ -2138,7 +2147,7 @@ elseecho "=== client staged no overlay renderer, overlay disabled ===" >> "$log" 2>&1 || truefiset -- --args "$shim_exe" "$@"-for name in $(env | sed -nE 's/^(CX_APPLEGPTK_LIBD3DSHARED_PATH|SDL_GAMECONTROLLERCONFIG(_FILE)?|SDL_JOYSTICK_MFI|WINE_LARGE_ADDRESS_AWARE|WINE_CPU_TOPOLOGY|Steam[A-Za-z0-9]*|(CX_GRAPHICS|D3DM_|DXMT_|DXVK_|MVK_|VKD3D_|STAGING_|MTL_|ROSETTA_)[A-Z0-9_]*|NOTPROTON_FRAMEGEN(_[A-Z]+)?|NOTPROTON_NGX_SIGNER)=.*/\1/p'); do+for name in $(env | sed -nE 's/^(CX_APPLEGPTK_LIBD3DSHARED_PATH|SDL_GAMECONTROLLERCONFIG(_FILE)?|SDL_JOYSTICK_MFI|WINE_LARGE_ADDRESS_AWARE|WINE_CPU_TOPOLOGY|Steam[A-Za-z0-9]*|(CX_GRAPHICS|D3DM_|DXMT_|DXVK_|MVK_|VKD3D_|STAGING_|MTL_|ROSETTA_)[A-Z0-9_]*|NOTPROTON_FRAMEGEN(_[A-Z]+)?|NOTPROTON_NGX_SIGNER|CX_ACTIVE_GRAPHICS_BACKEND)=.*/\1/p'); doeval "value=\$$name"# shellcheck disable=SC2154 # eval assigns value on the line aboveset -- --env "$name=$value" "$@"diff --git a/dylib/tests/gamefixescheck.sh b/dylib/tests/gamefixescheck.shindex 281b646..5f7426e 100644--- a/dylib/tests/gamefixescheck.sh+++ b/dylib/tests/gamefixescheck.sh@@ -99,7 +99,7 @@ launch() {STEAM_COMPAT_DATA_PATH="$case_dir/data" WINEPREFIX="$case_dir/data/pfx" \sh -ec 'eval "$functions"- gamefix_keys="" gamefix_backend="" gamefix_dlloverrides="" gamefix_msync="" gamefix_nvapi="" gamefix_args=""+ gamefix_keys="" gamefix_backend="" gamefix_dlloverrides="" gamefix_msync="" gamefix_nvapi="" gamefix_dlss_fg="" gamefix_args=""backend_root="$CX_ROOT/lib/notproton-backends"load_gamefixes || trueresolve_msync@@ -112,7 +112,7 @@ launch() {eval "$bridge_line"for v in backend WINEDLLOVERRIDES WINEMSYNC msync_from NOTPROTON_RETINA NOTPROTON_FRAMEGEN \NOTPROTON_FRAMEGEN_QUALITY NOTPROTON_FRAMEGEN_UI NOTPROTON_FRAMEGEN_FALLBACK NOTPROTON_FRAMEGEN_ENGINE CX_GRAPHICS_BACKEND \- DXVK_HUD VKD3D_CONFIG WINEDEBUG MTL_HUD_ENABLED D3DM_VENDOR_ID D3DM_DEVICE_ID D3DM_DEVICE_DESCRIPTION gamefix_args; do+ DXVK_HUD VKD3D_CONFIG WINEDEBUG MTL_HUD_ENABLED D3DM_VENDOR_ID D3DM_DEVICE_ID D3DM_DEVICE_DESCRIPTION NOTPROTON_NGX_SIGNER CX_ACTIVE_GRAPHICS_BACKEND gamefix_args; doeval "printf \"%s=%s\\n\" \$v \"\${$v-<unset>}\""done' launch "$target" > "$case_dir/out" 2>&1 || echo "launch exited $?" >> "$case_dir/out"@@ -384,6 +384,11 @@ is "and D3DMetal reports an NVIDIA adapter" "0x10de 0x2684 NVIDIA GeForce RTX 40user_conf 'NVAPI=1' 'D3DM_DEVICE_ID=0x2704'launch waitforexitandrun "$case_dir/game/game.exe"is "a conf's D3DM_DEVICE_ID wins over the default" "0x10de 0x2704" "$(got D3DM_VENDOR_ID) $(got D3DM_DEVICE_ID)"+is "NVAPI=1 lets Streamline load Apple's NGX bridge" "1" "$(got NOTPROTON_NGX_SIGNER)"+is "and leaves hardware scheduling alone" "<unset>" "$(got CX_ACTIVE_GRAPHICS_BACKEND)"+user_conf 'NVAPI=1' 'DLSS_FG=1'+launch waitforexitandrun "$case_dir/game/game.exe"+is "DLSS_FG=1 reports hardware scheduling for DLSS frame generation" "d3dmetal" "$(got CX_ACTIVE_GRAPHICS_BACKEND)"user_conf 'NVAPI=1' 'BACKEND=dxmt'launch waitforexitandrun "$case_dir/game/game.exe"is "but not for dxmt" "d3d10core,d3d11,dxgi=n,b;d3d10,d3d12=b;nvapi64,nvngx=d;$trio" "$(got WINEDLLOVERRIDES)"diff --git a/dylib/version.h b/dylib/version.hindex 47daf5f..a408801 100644--- a/dylib/version.h+++ b/dylib/version.h@@ -2,6 +2,6 @@#ifndef NOTPROTON_VERSION_H#define NOTPROTON_VERSION_H-#define NOTPROTON_VERSION "1.1.7-winehq.1-ray.21"+#define NOTPROTON_VERSION "1.1.7-winehq.1-ray.22"#endif // NOTPROTON_VERSION_H