From a3c6d666684399e3157d6ba03ef0b489e6a46639 Mon Sep 17 00:00:00 2001 From: xXJSONDeruloXx Date: Thu, 30 Jan 2025 13:06:17 -0500 Subject: feat: reqork python to install fgmod direct from bundled assets --- defaults/DisableNvidiaSignatureChecks.reg | 13 - defaults/RestoreNvidiaSignatureChecks.reg | 13 - defaults/_nvngx.dll | Bin 478976 -> 0 bytes defaults/amd_fidelityfx_dx12.dll | Bin 6475480 -> 0 bytes defaults/amd_fidelityfx_vk.dll | Bin 9188864 -> 0 bytes defaults/assets/DisableNvidiaSignatureChecks.reg | 13 + defaults/assets/RestoreNvidiaSignatureChecks.reg | 13 + defaults/assets/_nvngx.dll | Bin 0 -> 478976 bytes defaults/assets/amd_fidelityfx_dx12.dll | Bin 0 -> 6475480 bytes defaults/assets/amd_fidelityfx_vk.dll | Bin 0 -> 9188864 bytes defaults/assets/d3dcompiler_47.dll | Bin 0 -> 4346120 bytes defaults/assets/dlss-enabler-upscaler.dll | Bin 0 -> 21532160 bytes defaults/assets/dlss-enabler.dll | Bin 0 -> 1143808 bytes defaults/assets/dlssg_to_fsr3.ini | 10 + .../assets/dlssg_to_fsr3_amd_is_better-3.0.dll | Bin 0 -> 13502464 bytes defaults/assets/dlssg_to_fsr3_amd_is_better.dll | Bin 0 -> 8822272 bytes defaults/assets/dxgi.dll | Bin 0 -> 73728 bytes defaults/assets/dxvk.conf | 8 + defaults/assets/fakenvapi.ini | 16 + defaults/assets/fgmod | 113 +++++ defaults/assets/fgmod-uninstaller.sh | 2 +- defaults/assets/libxess.dll | Bin 0 -> 67095056 bytes defaults/assets/nvapi64.dll | Bin 0 -> 544256 bytes defaults/assets/nvngx-wrapper.dll | Bin 0 -> 189952 bytes defaults/assets/nvngx.ini | 546 +++++++++++++++++++++ defaults/d3dcompiler_47.dll | Bin 4346120 -> 0 bytes defaults/dlss-enabler-upscaler.dll | Bin 21532160 -> 0 bytes defaults/dlss-enabler.dll | Bin 1143808 -> 0 bytes defaults/dlssg_to_fsr3.ini | 10 - defaults/dlssg_to_fsr3_amd_is_better-3.0.dll | Bin 13502464 -> 0 bytes defaults/dlssg_to_fsr3_amd_is_better.dll | Bin 8822272 -> 0 bytes defaults/dxgi.dll | Bin 73728 -> 0 bytes defaults/dxvk.conf | 8 - defaults/fakenvapi.ini | 16 - defaults/fgmod | 113 ----- defaults/fgmod-uninstaller.sh | 105 ---- defaults/libxess.dll | Bin 67095056 -> 0 bytes defaults/nvapi64.dll | Bin 544256 -> 0 bytes defaults/nvngx-wrapper.dll | Bin 189952 -> 0 bytes defaults/nvngx.ini | 546 --------------------- main.py | 109 ++-- 41 files changed, 759 insertions(+), 895 deletions(-) delete mode 100644 defaults/DisableNvidiaSignatureChecks.reg delete mode 100644 defaults/RestoreNvidiaSignatureChecks.reg delete mode 100644 defaults/_nvngx.dll delete mode 100644 defaults/amd_fidelityfx_dx12.dll delete mode 100644 defaults/amd_fidelityfx_vk.dll create mode 100644 defaults/assets/DisableNvidiaSignatureChecks.reg create mode 100644 defaults/assets/RestoreNvidiaSignatureChecks.reg create mode 100644 defaults/assets/_nvngx.dll create mode 100644 defaults/assets/amd_fidelityfx_dx12.dll create mode 100644 defaults/assets/amd_fidelityfx_vk.dll create mode 100644 defaults/assets/d3dcompiler_47.dll create mode 100644 defaults/assets/dlss-enabler-upscaler.dll create mode 100644 defaults/assets/dlss-enabler.dll create mode 100644 defaults/assets/dlssg_to_fsr3.ini create mode 100644 defaults/assets/dlssg_to_fsr3_amd_is_better-3.0.dll create mode 100644 defaults/assets/dlssg_to_fsr3_amd_is_better.dll create mode 100644 defaults/assets/dxgi.dll create mode 100644 defaults/assets/dxvk.conf create mode 100644 defaults/assets/fakenvapi.ini create mode 100755 defaults/assets/fgmod create mode 100644 defaults/assets/libxess.dll create mode 100644 defaults/assets/nvapi64.dll create mode 100644 defaults/assets/nvngx-wrapper.dll create mode 100644 defaults/assets/nvngx.ini delete mode 100644 defaults/d3dcompiler_47.dll delete mode 100644 defaults/dlss-enabler-upscaler.dll delete mode 100644 defaults/dlss-enabler.dll delete mode 100644 defaults/dlssg_to_fsr3.ini delete mode 100644 defaults/dlssg_to_fsr3_amd_is_better-3.0.dll delete mode 100644 defaults/dlssg_to_fsr3_amd_is_better.dll delete mode 100644 defaults/dxgi.dll delete mode 100644 defaults/dxvk.conf delete mode 100644 defaults/fakenvapi.ini delete mode 100755 defaults/fgmod delete mode 100755 defaults/fgmod-uninstaller.sh delete mode 100644 defaults/libxess.dll delete mode 100644 defaults/nvapi64.dll delete mode 100644 defaults/nvngx-wrapper.dll delete mode 100644 defaults/nvngx.ini diff --git a/defaults/DisableNvidiaSignatureChecks.reg b/defaults/DisableNvidiaSignatureChecks.reg deleted file mode 100644 index 88ea81f..0000000 --- a/defaults/DisableNvidiaSignatureChecks.reg +++ /dev/null @@ -1,13 +0,0 @@ -Windows Registry Editor Version 5.00 - -; -; sl.common.dll (or any NGXCore component): -; -; Find "*** Signature override detected..." -; The call to StringFromGUID2 contains the secret GUID. -; -[HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA Corporation\Global] -"{41FCC608-8496-4DEF-B43E-7D9BD675A6FF}"=dword:00000001 - -[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\nvlddmkm] -"{41FCC608-8496-4DEF-B43E-7D9BD675A6FF}"=dword:00000001 \ No newline at end of file diff --git a/defaults/RestoreNvidiaSignatureChecks.reg b/defaults/RestoreNvidiaSignatureChecks.reg deleted file mode 100644 index b9e0529..0000000 --- a/defaults/RestoreNvidiaSignatureChecks.reg +++ /dev/null @@ -1,13 +0,0 @@ -Windows Registry Editor Version 5.00 - -; -; sl.common.dll (or any NGXCore component): -; -; Find "*** Signature override detected..." -; The call to StringFromGUID2 contains the secret GUID. -; -[HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA Corporation\Global] -"{41FCC608-8496-4DEF-B43E-7D9BD675A6FF}"=- - -[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\nvlddmkm] -"{41FCC608-8496-4DEF-B43E-7D9BD675A6FF}"=- \ No newline at end of file diff --git a/defaults/_nvngx.dll b/defaults/_nvngx.dll deleted file mode 100644 index c9dc6fd..0000000 Binary files a/defaults/_nvngx.dll and /dev/null differ diff --git a/defaults/amd_fidelityfx_dx12.dll b/defaults/amd_fidelityfx_dx12.dll deleted file mode 100644 index ddbef16..0000000 Binary files a/defaults/amd_fidelityfx_dx12.dll and /dev/null differ diff --git a/defaults/amd_fidelityfx_vk.dll b/defaults/amd_fidelityfx_vk.dll deleted file mode 100644 index 7b8c926..0000000 Binary files a/defaults/amd_fidelityfx_vk.dll and /dev/null differ diff --git a/defaults/assets/DisableNvidiaSignatureChecks.reg b/defaults/assets/DisableNvidiaSignatureChecks.reg new file mode 100644 index 0000000..88ea81f --- /dev/null +++ b/defaults/assets/DisableNvidiaSignatureChecks.reg @@ -0,0 +1,13 @@ +Windows Registry Editor Version 5.00 + +; +; sl.common.dll (or any NGXCore component): +; +; Find "*** Signature override detected..." +; The call to StringFromGUID2 contains the secret GUID. +; +[HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA Corporation\Global] +"{41FCC608-8496-4DEF-B43E-7D9BD675A6FF}"=dword:00000001 + +[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\nvlddmkm] +"{41FCC608-8496-4DEF-B43E-7D9BD675A6FF}"=dword:00000001 \ No newline at end of file diff --git a/defaults/assets/RestoreNvidiaSignatureChecks.reg b/defaults/assets/RestoreNvidiaSignatureChecks.reg new file mode 100644 index 0000000..b9e0529 --- /dev/null +++ b/defaults/assets/RestoreNvidiaSignatureChecks.reg @@ -0,0 +1,13 @@ +Windows Registry Editor Version 5.00 + +; +; sl.common.dll (or any NGXCore component): +; +; Find "*** Signature override detected..." +; The call to StringFromGUID2 contains the secret GUID. +; +[HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA Corporation\Global] +"{41FCC608-8496-4DEF-B43E-7D9BD675A6FF}"=- + +[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\nvlddmkm] +"{41FCC608-8496-4DEF-B43E-7D9BD675A6FF}"=- \ No newline at end of file diff --git a/defaults/assets/_nvngx.dll b/defaults/assets/_nvngx.dll new file mode 100644 index 0000000..c9dc6fd Binary files /dev/null and b/defaults/assets/_nvngx.dll differ diff --git a/defaults/assets/amd_fidelityfx_dx12.dll b/defaults/assets/amd_fidelityfx_dx12.dll new file mode 100644 index 0000000..ddbef16 Binary files /dev/null and b/defaults/assets/amd_fidelityfx_dx12.dll differ diff --git a/defaults/assets/amd_fidelityfx_vk.dll b/defaults/assets/amd_fidelityfx_vk.dll new file mode 100644 index 0000000..7b8c926 Binary files /dev/null and b/defaults/assets/amd_fidelityfx_vk.dll differ diff --git a/defaults/assets/d3dcompiler_47.dll b/defaults/assets/d3dcompiler_47.dll new file mode 100644 index 0000000..b120261 Binary files /dev/null and b/defaults/assets/d3dcompiler_47.dll differ diff --git a/defaults/assets/dlss-enabler-upscaler.dll b/defaults/assets/dlss-enabler-upscaler.dll new file mode 100644 index 0000000..ec58795 Binary files /dev/null and b/defaults/assets/dlss-enabler-upscaler.dll differ diff --git a/defaults/assets/dlss-enabler.dll b/defaults/assets/dlss-enabler.dll new file mode 100644 index 0000000..a43fdc2 Binary files /dev/null and b/defaults/assets/dlss-enabler.dll differ diff --git a/defaults/assets/dlssg_to_fsr3.ini b/defaults/assets/dlssg_to_fsr3.ini new file mode 100644 index 0000000..c90f1f8 --- /dev/null +++ b/defaults/assets/dlssg_to_fsr3.ini @@ -0,0 +1,10 @@ +; +; Note: this is an optional file for dlssg_to_fsr3. Normal users can safely ignore or delete this INI. +; +; +; FSR 3 developer debug options +; +[Debug] +EnableDebugOverlay=0 +EnableDebugTearLines=0 +EnableInterpolatedFramesOnly=0 \ No newline at end of file diff --git a/defaults/assets/dlssg_to_fsr3_amd_is_better-3.0.dll b/defaults/assets/dlssg_to_fsr3_amd_is_better-3.0.dll new file mode 100644 index 0000000..e8fc079 Binary files /dev/null and b/defaults/assets/dlssg_to_fsr3_amd_is_better-3.0.dll differ diff --git a/defaults/assets/dlssg_to_fsr3_amd_is_better.dll b/defaults/assets/dlssg_to_fsr3_amd_is_better.dll new file mode 100644 index 0000000..4f38e0e Binary files /dev/null and b/defaults/assets/dlssg_to_fsr3_amd_is_better.dll differ diff --git a/defaults/assets/dxgi.dll b/defaults/assets/dxgi.dll new file mode 100644 index 0000000..5475a27 Binary files /dev/null and b/defaults/assets/dxgi.dll differ diff --git a/defaults/assets/dxvk.conf b/defaults/assets/dxvk.conf new file mode 100644 index 0000000..a7d3619 --- /dev/null +++ b/defaults/assets/dxvk.conf @@ -0,0 +1,8 @@ +# dxgi.nvapiHack = False +dxgi.customVendorId = 10de +dxgi.hideAmdGpu = True +dxgi.hideNvidiaGpu = False +dxgi.customDeviceId = 2684 +dxgi.customDeviceDesc = "NVIDIA GeForce RTX 4090" + +# dxgi.maxSharedMemory = 20000 \ No newline at end of file diff --git a/defaults/assets/fakenvapi.ini b/defaults/assets/fakenvapi.ini new file mode 100644 index 0000000..f1f3c0c --- /dev/null +++ b/defaults/assets/fakenvapi.ini @@ -0,0 +1,16 @@ +[fakenvapi] +enable_logs=1 + +enable_trace_logs=0 + +; useful in native fsg fg games +force_latencyflex=0 + +; controls how latencyflex works +; 0 = conservative +; 1 = aggressive, will improve latency but in some cases will lower fps more than expected +; 2 = use reflex frame ids, some games are not compatible (i.e. cyberpunk) and will fallback to aggressive +latencyflex_mode=0 + +; 0 - follow in-game setting, 1 - force disable, 2 - force enable +force_reflex=0 \ No newline at end of file diff --git a/defaults/assets/fgmod b/defaults/assets/fgmod new file mode 100755 index 0000000..762f9bc --- /dev/null +++ b/defaults/assets/fgmod @@ -0,0 +1,113 @@ +#!/usr/bin/env bash + +error_exit() { + echo "$1" + if [[ -n $STEAM_ZENITY ]]; then + $STEAM_ZENITY --error --text "$1" + else + zenity --error --text "$1" + fi + exit 1 +} + +mod_path="/home/deck/fgmod" + +if [ "$#" -lt 1 ]; then + echo "Usage: $0 program [program_arguments...]" + exit 1 +fi + +# One arg means the command is ran standalone +if [[ $# -eq 1 ]]; then + if [[ "$1" == *.exe ]]; then + exe_folder_path=$(dirname "$1") + else + exe_folder_path=$1 + fi +else + for arg in "$@"; do + if [[ "$arg" == *.exe ]]; then + # Special cases, only FG-supported games + [[ "$arg" == *"Cyberpunk 2077"* ]] && arg=${arg//REDprelauncher.exe/bin/x64/Cyberpunk2077.exe} + [[ "$arg" == *"Witcher 3"* ]] && arg=${arg//REDprelauncher.exe/bin/x64_dx12/witcher3.exe} + [[ "$arg" == *"HITMAN 3"* ]] && arg=${arg//Launcher.exe/Retail/HITMAN3.exe} + [[ "$arg" == *"HITMAN World of Assassination"* ]] && arg=${arg//Launcher.exe/Retail/HITMAN3.exe} + [[ "$arg" == *"SYNCED"* ]] && arg=${arg//Launcher\/sop_launcher.exe/SYNCED.exe} # UE with a launcher + [[ "$arg" == *"2KLauncher"* ]] && arg=${arg//2KLauncher\/LauncherPatcher.exe/DoesntMatter.exe} # 2K launcher games + [[ "$arg" == *"Warhammer 40,000 DARKTIDE"* ]] && arg=${arg//launcher\/Launcher.exe/binaries/Darktide.exe} + [[ "$arg" == *"Warhammer Vermintide 2"* ]] && arg=${arg//launcher\/Launcher.exe/binaries_dx12/vermintide2_dx12.exe} + [[ "$arg" == *"Satisfactory"* ]] && arg=${arg//FactoryGameSteam.exe/Engine/Binaries/Win64/FactoryGameSteam-Win64-Shipping.exe} + exe_folder_path=$(dirname "$arg") + break + fi + done +fi + +# Fallback to STEAM_COMPAT_INSTALL_PATH when no path was found +if [[ ! -d $exe_folder_path ]] && [[ -n ${STEAM_COMPAT_INSTALL_PATH} ]]; then + echo "Trying the path from STEAM_COMPAT_INSTALL_PATH" + exe_folder_path=${STEAM_COMPAT_INSTALL_PATH} +fi + +# Check for UE games +if [[ -d "$exe_folder_path/Engine" ]]; then + ue_exe_path=$(find "$exe_folder_path" -maxdepth 4 -mindepth 4 -path "*Binaries/Win64/*.exe" -not -path "*/Engine/*" | head -1) + exe_folder_path=$(dirname "$ue_exe_path") +fi + +if [[ -d $exe_folder_path ]]; then + if [[ ! -w $exe_folder_path ]]; then + error_exit "No write permission to the game folder!" + fi + + original_dlls=("libxess.dll" "d3dcompiler_47.dll" "amd_fidelityfx_dx12.dll" "amd_fidelityfx_vk.dll") + + # Assume that the mod is not installed when dlss-enabler.dll is not present + if [[ ! -f "$exe_folder_path/dlss-enabler.dll" ]]; then + [[ -f "$exe_folder_path/dxgi.dll" ]] && error_exit 'dxgi.dll is already present in the game folder!\nThis script uses dxgi.dll to load required files.\nRemove the mod using dxgi.dll or install DLSS Enabler manually.' + for dll in "${original_dlls[@]}"; do + if [[ ! -f "$exe_folder_path/${dll}.b" ]]; then + mv -f "$exe_folder_path/$dll" "$exe_folder_path/${dll}.b" 2>/dev/null + fi + done + fi + + cp -f "$mod_path/fgmod-uninstaller.sh" "$exe_folder_path" || + error_exit "Couldn't copy the uninstaller!" + + cp -f "$mod_path/dlss-enabler.dll" "$exe_folder_path" && + cp -f "$mod_path/dxgi.dll" "$exe_folder_path" && + cp -f "$mod_path/nvngx-wrapper.dll" "$exe_folder_path" || + error_exit "Couldn't copy DLSS Enabler files!" + + # File is not preset on Nvidia installs so will fail on some setups on purpose + cp -f "$mod_path/nvapi64.dll" "$exe_folder_path" 2>/dev/null + + cp -f "$mod_path/_nvngx.dll" "$exe_folder_path" || + error_exit "Couldn't copy _nvngx.dll!" + + cp -f "$mod_path/dlssg_to_fsr3_amd_is_better.dll" "$exe_folder_path" && + cp -f "$mod_path/dlssg_to_fsr3_amd_is_better-3.0.dll" "$exe_folder_path" || + error_exit "Couldn't copy dlssg-to-fsr3!" + + cp -f "$mod_path/dlss-enabler-upscaler.dll" "$exe_folder_path" && + cp -f "$mod_path/amd_fidelityfx_dx12.dll" "$exe_folder_path" && + cp -f "$mod_path/amd_fidelityfx_vk.dll" "$exe_folder_path" && + cp -f "$mod_path/libxess.dll" "$exe_folder_path" && + cp -f "$mod_path/d3dcompiler_47.dll" "$exe_folder_path" || + error_exit "Couldn't copy Optiscaler files!" + + cp -n "$mod_path/nvngx.ini" "$exe_folder_path" + cp -n "$mod_path/fakenvapi.ini" "$exe_folder_path" +else + error_exit "Path doesn't exist!" +fi + +if [[ $# -gt 1 ]]; then + # Execute the original command + export SteamDeck=0 + export WINEDLLOVERRIDES="$WINEDLLOVERRIDES,dxgi=n,b" + "$@" +else + echo Done! +fi diff --git a/defaults/assets/fgmod-uninstaller.sh b/defaults/assets/fgmod-uninstaller.sh index 7bff63a..9f9c483 100755 --- a/defaults/assets/fgmod-uninstaller.sh +++ b/defaults/assets/fgmod-uninstaller.sh @@ -19,7 +19,7 @@ if [ "$#" -lt 1 ]; then fi game_path="" -mod_path="/usr/share/fgmod" +mod_path="/home/deck/fgmod" # Locate the game folder based on the first argument if [[ "$1" == *.exe ]]; then diff --git a/defaults/assets/libxess.dll b/defaults/assets/libxess.dll new file mode 100644 index 0000000..50b9a94 Binary files /dev/null and b/defaults/assets/libxess.dll differ diff --git a/defaults/assets/nvapi64.dll b/defaults/assets/nvapi64.dll new file mode 100644 index 0000000..f3d8051 Binary files /dev/null and b/defaults/assets/nvapi64.dll differ diff --git a/defaults/assets/nvngx-wrapper.dll b/defaults/assets/nvngx-wrapper.dll new file mode 100644 index 0000000..009df09 Binary files /dev/null and b/defaults/assets/nvngx-wrapper.dll differ diff --git a/defaults/assets/nvngx.ini b/defaults/assets/nvngx.ini new file mode 100644 index 0000000..ff2def0 --- /dev/null +++ b/defaults/assets/nvngx.ini @@ -0,0 +1,546 @@ +[FrameGeneration] +; Select frame generation method +; auto/fsr3 (DLSS Enabled selects best FSR 3 version for the game), fsr30, fsr31, dlssg (latter supported only by RTX cards) +Generator=auto + +; Override Reflex mode configured by the game +; on, boost, off +Reflex=on + +; EXPERIMENTAL: Enable Reflex emulation on non NVIDIA GPUs (this setting is ignored entirely NVIDIA GPUs, on which real Reflex feature is used). +; if set to auto mode it reduces the latency and stabilizes the framerates by using AntiLag2 (on AMD RDNA1 and better GPUs) or LatencyFlex (any other GPU not compatible with native Reflex feature) +; switch to "off" if you experience stuttering, unstable FPS or temporal game hanging/slowdown +; auto, on, off +ReflexEmulation=auto + +; Maximum frame rate (including the generated frames) +; off (default), vsync (experimental, might not work with VRR displays) or any number, ie 60, 144.. +FramerateLimit=off + +; EXPERIMENTAL: Controls how the frames should be generated +; auto - default behavior, dynamic - frames are generated only if GPU cannot produce real frames below the "FramerateLimit" specified in the setting above. +FrameGenerationMode=auto + + +; ------------------------------------------------------- +[Upscalers] +; ------------------------------------------------------- +; Select upscaler for Dx11 games +; fsr22 (native dx11), fsr31 (native dx11), xess (with dx12), fsr21_12 (dx11 with dx12), fsr22_12 (dx11 with dx12), fsr31_12 (dx11 with dx12), dlss - Default (auto) is fsr22 +Dx11Upscaler=auto + +; Select upscaler for Dx12 games +; xess, fsr21, fsr22, fsr31, dlss - Default (auto) is xess +Dx12Upscaler=auto + +; Select upscaler for Vulkan games +; fsr21, fsr22, fsr31, dlss - Default (auto) is fsr21 +VulkanUpscaler=auto + + + + + +; ------------------------------------------------------- +[Dx11withDx12] +; ------------------------------------------------------- +; Syncing meathods for Dx11 with Dx12 +; +; Valid values are; +; 0 - No syncing (fastest, most prone to errors) +; 1 - Fence +; 2 - Fences + Flush +; 3 - Fences + Event +; 4 - Fences + Flush + Event +; 5 - Query Only + +; Default (auto) is 1 +TextureSyncMethod=auto + +; Default (auto) is 5 +CopyBackSyncMethod=auto + +; Start output copy back sync after or before Dx12 execution +; true or false - Default (auto) is true +SyncAfterDx12=auto + +; Delay some operations during creation of D11wDx12 features to increase compatibility +; true or false - Default (auto) is false +UseDelayedInit=auto + +; Prefer using D3D11_RESOURCE_MISC_SHARED, which is lower level +; and a bit more performant and possibly less compatible +; true or false - Default (auto) is false +DontUseNTShared=auto + + + + + +; ------------------------------------------------------- +[XeSS] +; ------------------------------------------------------- +; Building pipeline for XeSS before init +; true or false - Default (auto) is true +BuildPipelines=auto + +; Creating heap objects for XeSS before init +; true or false - Default (auto) is true +CreateHeaps=auto + +;Select XeSS network model +; 0 = KPSS | 1 = Splat | 2 = Model 3 | 3 = Model 4 | 4 = Model 5 | 5 = Model 6 +; Default (auto) is 0 +NetworkModel=auto + +; Path of libxess.dll +; Default (auto) is same folder as mod dll +LibraryPath=auto + + + + + +; ------------------------------------------------------- +[FSR] +; ------------------------------------------------------- +; 0.0 to 180.0 - Default (auto) is 60.0 +VerticalFov=auto + +; If vertical fov is not defined will be used to calculate vertical fov +; 0.0 to 180.0 - Default (auto) is off +HorizontalFov=auto + +; Sets camera near value for FSR and above +; 0.0 to max float value - Default (auto) is 0.0001 +CameraNear=auto + +; Sets camera far value for FSR and above +; 0.0 to max float value - Default (auto) is 0.9999 +CameraFar=auto + +; Enables debug view for FSR3.X upscaler +; true or false - Default (auto) is false +DebugView=auto + +; Selects upscaler backend for FSR3.X +; 0 = FSR 3.1.0 | 1 = FSR 2.3.2 +; 0 or 1 (for now) - Default (auto) is 0 +UpscalerIndex=auto + +; Sets velocity factor for FSR3.1.1 and above +; 0.0 to 1.0 - Default (auto) is 1.0 +VelocityFactor=auto + +; Use raw DLSS reactive mask as transparency mask +; true or false - Default (auto) is true +UseReactiveMaskForTransparency=auto + +; Bias to apply DLSS reactive mask when using with FSR +; Higher the value, more bias on new frame +; 0.0 - 0.9 - Default (auto) is 0.45 +DlssReactiveMaskBias=auto + + + + + +; ------------------------------------------------------- +[DLSS] +; ------------------------------------------------------- +; Enables calls to original NVNGX +; true or false - Default (auto) is true +Enabled=auto + +; Path of nvngx.dll / _nvngx.dll +; Default (auto) is path defined in registry +LibraryPath=auto + +; Path of nvngx_dlss.dll +; Default (auto) is means override disabled +NVNGX_DLSS_Path=auto + +; Set this to true to enable custom render preset overrides +; true or false - Default (auto) is false +RenderPresetOverride=auto + +; Render presets for quality settings +; 0 = Default | 1 = A | 2 = B | 3 = C | 4 = D | 5 = E | 6 = F | 7 = G +; Default (auto) is 0 +RenderPresetDLAA=auto +RenderPresetUltraQuality=auto +RenderPresetQuality=auto +RenderPresetBalanced=auto +RenderPresetPerformance=auto +RenderPresetUltraPerformance=auto + + + + + +; ------------------------------------------------------- +[Menu] +; ------------------------------------------------------- +; Enables new overlay ImGui menus +; true or false - Default (auto) is when OptiScaler is nvngx.dll false otherwise true +OverlayMenu=auto + +; In-game ImGui menu scale +; 1.0 to 2.0 - Default (auto) is 1.0 +Scale=auto + +; Shortcut key for opening menu +; Integer value - Default (auto) is 45 -> VK_INSERT (0x2D), previous default key VK_HOME is 36 (0x24) +ShortcutKey=auto + +; For all keycode values you can check this address +; https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes + +; Enables advanced settings +; true or false - Default (auto) is false +AdvancedSettings=auto + +; Extends scaling ratio limits to 0.1 - 6.0 +; true or false - Default (auto) is false +ExtendedLimits=auto + + + + + +; ------------------------------------------------------- +[Hooks] +; ------------------------------------------------------- +; Skip hooking of local nvngx files and only hook nvngx at registry +; Needed for Uniscaler + FG +; true or false - Default (auto) is false +HookOriginalNvngxOnly=auto + + + + + +; ------------------------------------------------------- +[Spoofing] +; ------------------------------------------------------- +; Enables Nvidia GPU spoofing for DXGI +; true or false - Default (auto) is true +Dxgi=auto + +; Skips DXGI GPU spoofing when caller method in the list (example: slInit|slGetPluginFunction|nvapi_QueryInterface) +; Be careful this will disable spoofing for rest of the calls also does not work on Linux +; true or false - Default (auto) is disabled +DxgiBlacklist=auto + +; Spoof amount of VRAM for DXGI +; Spoofed amount in GBs - Default (auto) is disabled +DxgiVRAM=auto + +; Enables Nvidia GPU spoofing for Vulkan +; true or false - Default (auto) is false +Vulkan=auto + +; Enables Nvidia extension spoofing for Vulkan +; true or false - Default (auto) is false +VulkanExtensionSpoofing=auto + +; Spoofed GPU name +; Default (auto) is NVIDIA GeForce RTX 4090 +SpoofedGPUName=auto + + + + + +; ------------------------------------------------------- +[Plugins] +; ------------------------------------------------------- +; Path that will be searched for same filename plugins (dxgi.dll, winmm.dll, etc.) +; Default is .\plugins +Path=auto + +; Loads SpecialK64.dll from game's exe folder +; Please put a SpecialK.dxgi file next to SpecialK64.dll +; to set SpecialK's working mode otherwise it will not be activated +; true or false - Default (auto) is false +LoadSpecialK=auto + + + + +; ------------------------------------------------------- +[NvApi] +; ------------------------------------------------------- +; Override loading of nvapi64.dll +; true or false - Default (auto) is false +OverrideNvapiDll=auto + +; If nvapi override enabled and file path defined here +; will try to load it from here, otherwise will check current folder for nvapi64.dll +; true or false - Default (auto) local folder +NvapiDllPath=auto + + + + + +; ------------------------------------------------------- +[Sharpness] +; ------------------------------------------------------- +; Override DLSS sharpness paramater with fixed shapness value +; true or false - Default (auto) is false +OverrideSharpness=auto + +; Strength of sharpening, +; value range between 0.0 and 1.0 (while using upper limit is RCAS 1.3) - Default (auto) is 0.3 +Sharpness=auto + + + + + +; ------------------------------------------------------- +[OutputScaling] +; ------------------------------------------------------- +; Enable output scaling option for Dx12 and Dx11 with Dx12 backends +; true or false - Default (auto) is false +Enabled=auto + +; Output scaling ratio +; 0.5 - 3.0 - Default (auto) is 1.5 +Multiplier=auto + +; Enable FSR for upscaling & downscaling, otherwise bicubic will be used +; true or false - Default (auto) is true +UseFsr=auto + + + + + +; ------------------------------------------------------- +[CAS] +; ------------------------------------------------------- +; Enables RCAS sharpening +; true or false - Default (auto) is false +Enabled=auto + +; Enable motion sharpness +; true or false - Default (auto) is false +MotionSharpnessEnabled=auto + +; Sharpening will be added or removed according to motion length +; value range between -1.0 and 1.0 - Default (auto) is 0.8 +MotionSharpness=auto + +; How much a pixel should move before motion sharpness applied +; 0.0 - 100.0 - Default (auto) is 0.0 +MotionThreshold=auto + +; How much a pixel should move to reach maximum MotionSharpness value +; Values between MotionThreshold and this value will use be used to scale sharpness value +; 0.0 - 100.0 - Default (auto) is 10.0 +MotionScaleLimit=auto + +; Enable debug highlighting for motion sharpening +; Reddish hue for added greenish for reduced sharpness +; true or false - Default (auto) is false +MotionSharpnessDebug=auto + + + + + +; ------------------------------------------------------- +[Log] +; ------------------------------------------------------- +; Log file, if undefined OptiScaler.log file in current folder +; Default (auto) is OptiScaler.log in same folder +LogFile=auto + +; Verbosity level of file logs +; 0 = Trace / 1 = Debug / 2 = Info / 3 = Warning / 4 = Error +; Default (auto) is 2 = Info +LogLevel=auto + +; Log to console (Log level is always 2 (Info) for performance reasons) +; true or false - Default (auto) is false +LogToConsole=auto + +; Log to file +; true or false - Default (auto) is false +LogToFile=auto + +; Log to NVNGX API +; true or false - Default (auto) is false +LogToNGX=true + +; Open console window for logs +; true or false - Default (auto) is false +OpenConsole=auto + +; When set to false creates a new log file for every OptiScaler session +; true or false - Default (auto) is true +SingleFile=auto + + + + + +; ------------------------------------------------------- +[InitFlags] +; ------------------------------------------------------- +; Force add ENABLE_AUTOEXPOSURE to init flags +; Some Unreal Engine games needs this, fixes colors specially in dark areas +; true or false - Default (auto) is DLSS value +AutoExposure=auto + +; Force add HDR_INPUT_COLOR to init flags +; true or false - Default (auto) is DLSS value +HDR=auto + +; Force add INVERTED_DEPTH to init flags +; true or false - Default (auto) is DLSS value +DepthInverted=auto + +; Force add JITTERED_MV flag to init flags +; true or false - Default (auto) is DLSS value +JitterCancellation=auto + +; Force add HIGH_RES_MV flag to init flags +; true or false - Default (auto) is DLSS value +DisplayResolution=auto + +; Force remove RESPONSIVE_PIXEL_MASK from init flags +; true or false - Default (auto) is true +DisableReactiveMask=auto + + + + +; ------------------------------------------------------- +[UpscaleRatio] +; ------------------------------------------------------- +; Set this to true to enable the internal resolution override +; true or false - Default (auto) is false +UpscaleRatioOverrideEnabled=auto + +; Set the forced upscale ratio value +; Default (auto) is 1.3 +UpscaleRatioOverrideValue=auto + + + + + +; ------------------------------------------------------- +[QualityOverrides] +; ------------------------------------------------------- +; Set this to true to enable custom quality mode overrides +; true or false - Default (auto) is false +QualityRatioOverrideEnabled=auto + +; Set custom upscaling ratio for each quality mode +; +; Default (auto) values: +; DLAA : 1.0 +; Ultra Quality : 1.3 +; Quality : 1.5 +; Balanced : 1.7 +; Performance : 2.0 +; Ultra Performance : 3.0 +QualityRatioDLAA=auto +QualityRatioUltraQuality=auto +QualityRatioQuality=auto +QualityRatioBalanced=auto +QualityRatioPerformance=auto +QualityRatioUltraPerformance=auto + + + + + +; ------------------------------------------------------- +[DRS] +; ------------------------------------------------------- +; Set this to true to enable limiting DRS min resolution to rendering resolution +; true or false - Default (auto) is false +DrsMinOverrideEnabled=auto + +; Set this to true to enable limiting DRS max resolution to rendering resolution +; true or false - Default (auto) is false +DrsMaxOverrideEnabled=auto + + + + + +; ------------------------------------------------------- +[Hotfix] +; ------------------------------------------------------- +; Override mipmap lod bias for textures +; -15.0 - 15.0 - Default (auto) is disabled +MipmapBiasOverride=auto + +; Override max anisotropy for textures +; 2, 4, 8, 16 - Default (auto) is disabled +AnisotropyOverride=auto + +; Rounds internal resolutions width and height to multiple of this value +; 2, 4, 8, 16 ... - Default (auto) is disabled +RoundInternalResolution=auto + +; Skips upscaling of n frames +; n is integer number - Default (auto) is disabled +SkipFirstFrames=auto + +; Restore last used compute signature after upscaling +; true or false - Default (auto) is false +RestoreComputeSignature=auto + +; Restore last used graphics signature after upscaling +; true or false - Default (auto) is false +RestoreGraphicSignature=auto + +; Use precompiled shaders for RCAS, Output Scaling ans Mask Bias +; true or false - Default (auto) is true +UsePrecompiledShaders=auto + +; Color texture resource state to fix for rainbow colors on AMD cards (for mostly UE games) +; For UE engine games on AMD, set it to D3D12_RESOURCE_STATE_RENDER_TARGET (4) +; Default (auto) is state correction disabled +ColorResourceBarrier=auto + +; Default (auto) is state correction disabled +MotionVectorResourceBarrier=auto + +; Default (auto) is state correction disabled +DepthResourceBarrier=auto + +; Default (auto) is state correction disabled +ColorMaskResourceBarrier=auto + +; Default (auto) is state correction disabled +ExposureResourceBarrier=auto + +; Default (auto) is state correction disabled +OutputResourceBarrier=auto + +; These settings defines each resources initial resource +; state and add resource barrier for correct state +; +; Common resource barrier states +; ---------------------------------------------------- +; D3D12_RESOURCE_STATE_COMMON = 0, +; D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER = 1, +; D3D12_RESOURCE_STATE_INDEX_BUFFER = 2, +; D3D12_RESOURCE_STATE_RENDER_TARGET = 4, +; D3D12_RESOURCE_STATE_UNORDERED_ACCESS = 8, +; D3D12_RESOURCE_STATE_DEPTH_WRITE = 16, +; D3D12_RESOURCE_STATE_DEPTH_READ = 32, +; D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE = 64, +; D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE = 128, +;------------------------------------------------------ +; +; All state values can be checked from here +; https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ne-d3d12-d3d12_resource_states diff --git a/defaults/d3dcompiler_47.dll b/defaults/d3dcompiler_47.dll deleted file mode 100644 index b120261..0000000 Binary files a/defaults/d3dcompiler_47.dll and /dev/null differ diff --git a/defaults/dlss-enabler-upscaler.dll b/defaults/dlss-enabler-upscaler.dll deleted file mode 100644 index ec58795..0000000 Binary files a/defaults/dlss-enabler-upscaler.dll and /dev/null differ diff --git a/defaults/dlss-enabler.dll b/defaults/dlss-enabler.dll deleted file mode 100644 index a43fdc2..0000000 Binary files a/defaults/dlss-enabler.dll and /dev/null differ diff --git a/defaults/dlssg_to_fsr3.ini b/defaults/dlssg_to_fsr3.ini deleted file mode 100644 index c90f1f8..0000000 --- a/defaults/dlssg_to_fsr3.ini +++ /dev/null @@ -1,10 +0,0 @@ -; -; Note: this is an optional file for dlssg_to_fsr3. Normal users can safely ignore or delete this INI. -; -; -; FSR 3 developer debug options -; -[Debug] -EnableDebugOverlay=0 -EnableDebugTearLines=0 -EnableInterpolatedFramesOnly=0 \ No newline at end of file diff --git a/defaults/dlssg_to_fsr3_amd_is_better-3.0.dll b/defaults/dlssg_to_fsr3_amd_is_better-3.0.dll deleted file mode 100644 index e8fc079..0000000 Binary files a/defaults/dlssg_to_fsr3_amd_is_better-3.0.dll and /dev/null differ diff --git a/defaults/dlssg_to_fsr3_amd_is_better.dll b/defaults/dlssg_to_fsr3_amd_is_better.dll deleted file mode 100644 index 4f38e0e..0000000 Binary files a/defaults/dlssg_to_fsr3_amd_is_better.dll and /dev/null differ diff --git a/defaults/dxgi.dll b/defaults/dxgi.dll deleted file mode 100644 index 5475a27..0000000 Binary files a/defaults/dxgi.dll and /dev/null differ diff --git a/defaults/dxvk.conf b/defaults/dxvk.conf deleted file mode 100644 index a7d3619..0000000 --- a/defaults/dxvk.conf +++ /dev/null @@ -1,8 +0,0 @@ -# dxgi.nvapiHack = False -dxgi.customVendorId = 10de -dxgi.hideAmdGpu = True -dxgi.hideNvidiaGpu = False -dxgi.customDeviceId = 2684 -dxgi.customDeviceDesc = "NVIDIA GeForce RTX 4090" - -# dxgi.maxSharedMemory = 20000 \ No newline at end of file diff --git a/defaults/fakenvapi.ini b/defaults/fakenvapi.ini deleted file mode 100644 index f1f3c0c..0000000 --- a/defaults/fakenvapi.ini +++ /dev/null @@ -1,16 +0,0 @@ -[fakenvapi] -enable_logs=1 - -enable_trace_logs=0 - -; useful in native fsg fg games -force_latencyflex=0 - -; controls how latencyflex works -; 0 = conservative -; 1 = aggressive, will improve latency but in some cases will lower fps more than expected -; 2 = use reflex frame ids, some games are not compatible (i.e. cyberpunk) and will fallback to aggressive -latencyflex_mode=0 - -; 0 - follow in-game setting, 1 - force disable, 2 - force enable -force_reflex=0 \ No newline at end of file diff --git a/defaults/fgmod b/defaults/fgmod deleted file mode 100755 index 762f9bc..0000000 --- a/defaults/fgmod +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/env bash - -error_exit() { - echo "$1" - if [[ -n $STEAM_ZENITY ]]; then - $STEAM_ZENITY --error --text "$1" - else - zenity --error --text "$1" - fi - exit 1 -} - -mod_path="/home/deck/fgmod" - -if [ "$#" -lt 1 ]; then - echo "Usage: $0 program [program_arguments...]" - exit 1 -fi - -# One arg means the command is ran standalone -if [[ $# -eq 1 ]]; then - if [[ "$1" == *.exe ]]; then - exe_folder_path=$(dirname "$1") - else - exe_folder_path=$1 - fi -else - for arg in "$@"; do - if [[ "$arg" == *.exe ]]; then - # Special cases, only FG-supported games - [[ "$arg" == *"Cyberpunk 2077"* ]] && arg=${arg//REDprelauncher.exe/bin/x64/Cyberpunk2077.exe} - [[ "$arg" == *"Witcher 3"* ]] && arg=${arg//REDprelauncher.exe/bin/x64_dx12/witcher3.exe} - [[ "$arg" == *"HITMAN 3"* ]] && arg=${arg//Launcher.exe/Retail/HITMAN3.exe} - [[ "$arg" == *"HITMAN World of Assassination"* ]] && arg=${arg//Launcher.exe/Retail/HITMAN3.exe} - [[ "$arg" == *"SYNCED"* ]] && arg=${arg//Launcher\/sop_launcher.exe/SYNCED.exe} # UE with a launcher - [[ "$arg" == *"2KLauncher"* ]] && arg=${arg//2KLauncher\/LauncherPatcher.exe/DoesntMatter.exe} # 2K launcher games - [[ "$arg" == *"Warhammer 40,000 DARKTIDE"* ]] && arg=${arg//launcher\/Launcher.exe/binaries/Darktide.exe} - [[ "$arg" == *"Warhammer Vermintide 2"* ]] && arg=${arg//launcher\/Launcher.exe/binaries_dx12/vermintide2_dx12.exe} - [[ "$arg" == *"Satisfactory"* ]] && arg=${arg//FactoryGameSteam.exe/Engine/Binaries/Win64/FactoryGameSteam-Win64-Shipping.exe} - exe_folder_path=$(dirname "$arg") - break - fi - done -fi - -# Fallback to STEAM_COMPAT_INSTALL_PATH when no path was found -if [[ ! -d $exe_folder_path ]] && [[ -n ${STEAM_COMPAT_INSTALL_PATH} ]]; then - echo "Trying the path from STEAM_COMPAT_INSTALL_PATH" - exe_folder_path=${STEAM_COMPAT_INSTALL_PATH} -fi - -# Check for UE games -if [[ -d "$exe_folder_path/Engine" ]]; then - ue_exe_path=$(find "$exe_folder_path" -maxdepth 4 -mindepth 4 -path "*Binaries/Win64/*.exe" -not -path "*/Engine/*" | head -1) - exe_folder_path=$(dirname "$ue_exe_path") -fi - -if [[ -d $exe_folder_path ]]; then - if [[ ! -w $exe_folder_path ]]; then - error_exit "No write permission to the game folder!" - fi - - original_dlls=("libxess.dll" "d3dcompiler_47.dll" "amd_fidelityfx_dx12.dll" "amd_fidelityfx_vk.dll") - - # Assume that the mod is not installed when dlss-enabler.dll is not present - if [[ ! -f "$exe_folder_path/dlss-enabler.dll" ]]; then - [[ -f "$exe_folder_path/dxgi.dll" ]] && error_exit 'dxgi.dll is already present in the game folder!\nThis script uses dxgi.dll to load required files.\nRemove the mod using dxgi.dll or install DLSS Enabler manually.' - for dll in "${original_dlls[@]}"; do - if [[ ! -f "$exe_folder_path/${dll}.b" ]]; then - mv -f "$exe_folder_path/$dll" "$exe_folder_path/${dll}.b" 2>/dev/null - fi - done - fi - - cp -f "$mod_path/fgmod-uninstaller.sh" "$exe_folder_path" || - error_exit "Couldn't copy the uninstaller!" - - cp -f "$mod_path/dlss-enabler.dll" "$exe_folder_path" && - cp -f "$mod_path/dxgi.dll" "$exe_folder_path" && - cp -f "$mod_path/nvngx-wrapper.dll" "$exe_folder_path" || - error_exit "Couldn't copy DLSS Enabler files!" - - # File is not preset on Nvidia installs so will fail on some setups on purpose - cp -f "$mod_path/nvapi64.dll" "$exe_folder_path" 2>/dev/null - - cp -f "$mod_path/_nvngx.dll" "$exe_folder_path" || - error_exit "Couldn't copy _nvngx.dll!" - - cp -f "$mod_path/dlssg_to_fsr3_amd_is_better.dll" "$exe_folder_path" && - cp -f "$mod_path/dlssg_to_fsr3_amd_is_better-3.0.dll" "$exe_folder_path" || - error_exit "Couldn't copy dlssg-to-fsr3!" - - cp -f "$mod_path/dlss-enabler-upscaler.dll" "$exe_folder_path" && - cp -f "$mod_path/amd_fidelityfx_dx12.dll" "$exe_folder_path" && - cp -f "$mod_path/amd_fidelityfx_vk.dll" "$exe_folder_path" && - cp -f "$mod_path/libxess.dll" "$exe_folder_path" && - cp -f "$mod_path/d3dcompiler_47.dll" "$exe_folder_path" || - error_exit "Couldn't copy Optiscaler files!" - - cp -n "$mod_path/nvngx.ini" "$exe_folder_path" - cp -n "$mod_path/fakenvapi.ini" "$exe_folder_path" -else - error_exit "Path doesn't exist!" -fi - -if [[ $# -gt 1 ]]; then - # Execute the original command - export SteamDeck=0 - export WINEDLLOVERRIDES="$WINEDLLOVERRIDES,dxgi=n,b" - "$@" -else - echo Done! -fi diff --git a/defaults/fgmod-uninstaller.sh b/defaults/fgmod-uninstaller.sh deleted file mode 100755 index 9f9c483..0000000 --- a/defaults/fgmod-uninstaller.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/env bash - -set -x # Enable debugging -exec > >(tee -i /tmp/prepare.log) 2>&1 # Log output and errors - -error_exit() { - echo "$1" - if [[ -n $STEAM_ZENITY ]]; then - $STEAM_ZENITY --error --text "$1" - else - zenity --error --text "$1" - fi - exit 1 -} - -if [ "$#" -lt 1 ]; then - echo "Usage: $0 program [program_arguments...]" - exit 1 -fi - -game_path="" -mod_path="/home/deck/fgmod" - -# Locate the game folder based on the first argument -if [[ "$1" == *.exe ]]; then - exe_folder_path=$(dirname "$1") -else - for arg in "$@"; do - if [[ "$arg" == *.exe ]]; then - # Handle special cases for specific games - [[ "$arg" == *"Cyberpunk 2077"* ]] && arg=${arg//REDprelauncher.exe/bin/x64/Cyberpunk2077.exe} - [[ "$arg" == *"Witcher 3"* ]] && arg=${arg//REDprelauncher.exe/bin/x64_dx12/witcher3.exe} - [[ "$arg" == *"HITMAN 3"* ]] && arg=${arg//Launcher.exe/Retail/HITMAN3.exe} - [[ "$arg" == *"HITMAN World of Assassination"* ]] && arg=${arg//Launcher.exe/Retail/HITMAN3.exe} - [[ "$arg" == *"SYNCED"* ]] && arg=${arg//Launcher\/sop_launcher.exe/SYNCED.exe} - [[ "$arg" == *"2KLauncher"* ]] && arg=${arg//2KLauncher\/LauncherPatcher.exe/DoesntMatter.exe} - [[ "$arg" == *"Warhammer 40,000 DARKTIDE"* ]] && arg=${arg//launcher\/Launcher.exe/binaries/Darktide.exe} - [[ "$arg" == *"Warhammer Vermintide 2"* ]] && arg=${arg//launcher\/Launcher.exe/binaries_dx12/vermintide2_dx12.exe} - [[ "$arg" == *"Satisfactory"* ]] && arg=${arg//FactoryGameSteam.exe/Engine/Binaries/Win64/FactoryGameSteam-Win64-Shipping.exe} - exe_folder_path=$(dirname "$arg") - break - fi - done -fi - -# Fallback to STEAM_COMPAT_INSTALL_PATH when no path was found -if [[ ! -d $exe_folder_path ]] && [[ -n ${STEAM_COMPAT_INSTALL_PATH} ]]; then - exe_folder_path=${STEAM_COMPAT_INSTALL_PATH} -fi - -# Check for Unreal Engine game paths -if [[ -d "$exe_folder_path/Engine" ]]; then - ue_exe_path=$(find "$exe_folder_path" -maxdepth 4 -mindepth 4 -path "*Binaries/Win64/*.exe" -not -path "*/Engine/*" | head -1) - exe_folder_path=$(dirname "$ue_exe_path") -fi - -# Verify the game folder exists -if [[ ! -d $exe_folder_path ]]; then - error_exit "Unable to locate the game folder. Ensure the game is installed and the path is correct." -fi - -# Avoid operating on the uninstaller's own directory -script_dir=$(dirname "$(realpath "$0")") -if [[ "$(realpath "$exe_folder_path")" == "$script_dir" ]]; then - error_exit "The target directory matches the script's directory. Aborting to prevent accidental deletion." -fi - -# Change to the game directory -cd "$exe_folder_path" || error_exit "Failed to change directory to $exe_folder_path" - -# Verify current directory before proceeding -if [[ "$(pwd)" != "$exe_folder_path" ]]; then - error_exit "Unexpected working directory: $(pwd)" -fi - -# Log the resolved exe_folder_path for debugging -echo "Resolved exe_folder_path: $exe_folder_path" >> /tmp/fgmod-uninstaller.log - -# Perform uninstallation -rm -f "dlss-enabler.dll" "dxgi.dll" "nvngx-wrapper.dll" "_nvngx.dll" -rm -f "dlssg_to_fsr3_amd_is_better.dll" "dlssg_to_fsr3_amd_is_better-3.0.dll" -rm -f "dlss-enabler-upscaler.dll" "nvngx.ini" "libxess.dll" -rm -f "d3dcompiler_47.dll" "amd_fidelityfx_dx12.dll" "amd_fidelityfx_vk.dll" -rm -f "nvapi64.dll" "fakenvapi.ini" "OptiScaler.log" -rm -f "dlss-enabler.log" "dlssg_to_fsr3.log" "fakenvapi.log" - -# Restore original DLLs if they exist -mv -f "libxess.dll.b" "libxess.dll" 2>/dev/null -mv -f "d3dcompiler_47.dll.b" "d3dcompiler_47.dll" 2>/dev/null -mv -f "amd_fidelityfx_dx12.dll.b" "amd_fidelityfx_dx12.dll" 2>/dev/null -mv -f "amd_fidelityfx_vk.dll.b" "amd_fidelityfx_vk.dll" 2>/dev/null - -# Self-remove uninstaller (now optional for safety) -echo "Uninstaller self-removal skipped for safety. Remove manually if needed." - -echo "fgmod removed from this game." - -if [[ $# -gt 1 ]]; then - echo "Launching the game..." - export SteamDeck=0 - export WINEDLLOVERRIDES="${WINEDLLOVERRIDES},dxgi=n,b" - exec "$@" -else - echo "Uninstallation complete. No game specified to run." -fi \ No newline at end of file diff --git a/defaults/libxess.dll b/defaults/libxess.dll deleted file mode 100644 index 50b9a94..0000000 Binary files a/defaults/libxess.dll and /dev/null differ diff --git a/defaults/nvapi64.dll b/defaults/nvapi64.dll deleted file mode 100644 index f3d8051..0000000 Binary files a/defaults/nvapi64.dll and /dev/null differ diff --git a/defaults/nvngx-wrapper.dll b/defaults/nvngx-wrapper.dll deleted file mode 100644 index 009df09..0000000 Binary files a/defaults/nvngx-wrapper.dll and /dev/null differ diff --git a/defaults/nvngx.ini b/defaults/nvngx.ini deleted file mode 100644 index ff2def0..0000000 --- a/defaults/nvngx.ini +++ /dev/null @@ -1,546 +0,0 @@ -[FrameGeneration] -; Select frame generation method -; auto/fsr3 (DLSS Enabled selects best FSR 3 version for the game), fsr30, fsr31, dlssg (latter supported only by RTX cards) -Generator=auto - -; Override Reflex mode configured by the game -; on, boost, off -Reflex=on - -; EXPERIMENTAL: Enable Reflex emulation on non NVIDIA GPUs (this setting is ignored entirely NVIDIA GPUs, on which real Reflex feature is used). -; if set to auto mode it reduces the latency and stabilizes the framerates by using AntiLag2 (on AMD RDNA1 and better GPUs) or LatencyFlex (any other GPU not compatible with native Reflex feature) -; switch to "off" if you experience stuttering, unstable FPS or temporal game hanging/slowdown -; auto, on, off -ReflexEmulation=auto - -; Maximum frame rate (including the generated frames) -; off (default), vsync (experimental, might not work with VRR displays) or any number, ie 60, 144.. -FramerateLimit=off - -; EXPERIMENTAL: Controls how the frames should be generated -; auto - default behavior, dynamic - frames are generated only if GPU cannot produce real frames below the "FramerateLimit" specified in the setting above. -FrameGenerationMode=auto - - -; ------------------------------------------------------- -[Upscalers] -; ------------------------------------------------------- -; Select upscaler for Dx11 games -; fsr22 (native dx11), fsr31 (native dx11), xess (with dx12), fsr21_12 (dx11 with dx12), fsr22_12 (dx11 with dx12), fsr31_12 (dx11 with dx12), dlss - Default (auto) is fsr22 -Dx11Upscaler=auto - -; Select upscaler for Dx12 games -; xess, fsr21, fsr22, fsr31, dlss - Default (auto) is xess -Dx12Upscaler=auto - -; Select upscaler for Vulkan games -; fsr21, fsr22, fsr31, dlss - Default (auto) is fsr21 -VulkanUpscaler=auto - - - - - -; ------------------------------------------------------- -[Dx11withDx12] -; ------------------------------------------------------- -; Syncing meathods for Dx11 with Dx12 -; -; Valid values are; -; 0 - No syncing (fastest, most prone to errors) -; 1 - Fence -; 2 - Fences + Flush -; 3 - Fences + Event -; 4 - Fences + Flush + Event -; 5 - Query Only - -; Default (auto) is 1 -TextureSyncMethod=auto - -; Default (auto) is 5 -CopyBackSyncMethod=auto - -; Start output copy back sync after or before Dx12 execution -; true or false - Default (auto) is true -SyncAfterDx12=auto - -; Delay some operations during creation of D11wDx12 features to increase compatibility -; true or false - Default (auto) is false -UseDelayedInit=auto - -; Prefer using D3D11_RESOURCE_MISC_SHARED, which is lower level -; and a bit more performant and possibly less compatible -; true or false - Default (auto) is false -DontUseNTShared=auto - - - - - -; ------------------------------------------------------- -[XeSS] -; ------------------------------------------------------- -; Building pipeline for XeSS before init -; true or false - Default (auto) is true -BuildPipelines=auto - -; Creating heap objects for XeSS before init -; true or false - Default (auto) is true -CreateHeaps=auto - -;Select XeSS network model -; 0 = KPSS | 1 = Splat | 2 = Model 3 | 3 = Model 4 | 4 = Model 5 | 5 = Model 6 -; Default (auto) is 0 -NetworkModel=auto - -; Path of libxess.dll -; Default (auto) is same folder as mod dll -LibraryPath=auto - - - - - -; ------------------------------------------------------- -[FSR] -; ------------------------------------------------------- -; 0.0 to 180.0 - Default (auto) is 60.0 -VerticalFov=auto - -; If vertical fov is not defined will be used to calculate vertical fov -; 0.0 to 180.0 - Default (auto) is off -HorizontalFov=auto - -; Sets camera near value for FSR and above -; 0.0 to max float value - Default (auto) is 0.0001 -CameraNear=auto - -; Sets camera far value for FSR and above -; 0.0 to max float value - Default (auto) is 0.9999 -CameraFar=auto - -; Enables debug view for FSR3.X upscaler -; true or false - Default (auto) is false -DebugView=auto - -; Selects upscaler backend for FSR3.X -; 0 = FSR 3.1.0 | 1 = FSR 2.3.2 -; 0 or 1 (for now) - Default (auto) is 0 -UpscalerIndex=auto - -; Sets velocity factor for FSR3.1.1 and above -; 0.0 to 1.0 - Default (auto) is 1.0 -VelocityFactor=auto - -; Use raw DLSS reactive mask as transparency mask -; true or false - Default (auto) is true -UseReactiveMaskForTransparency=auto - -; Bias to apply DLSS reactive mask when using with FSR -; Higher the value, more bias on new frame -; 0.0 - 0.9 - Default (auto) is 0.45 -DlssReactiveMaskBias=auto - - - - - -; ------------------------------------------------------- -[DLSS] -; ------------------------------------------------------- -; Enables calls to original NVNGX -; true or false - Default (auto) is true -Enabled=auto - -; Path of nvngx.dll / _nvngx.dll -; Default (auto) is path defined in registry -LibraryPath=auto - -; Path of nvngx_dlss.dll -; Default (auto) is means override disabled -NVNGX_DLSS_Path=auto - -; Set this to true to enable custom render preset overrides -; true or false - Default (auto) is false -RenderPresetOverride=auto - -; Render presets for quality settings -; 0 = Default | 1 = A | 2 = B | 3 = C | 4 = D | 5 = E | 6 = F | 7 = G -; Default (auto) is 0 -RenderPresetDLAA=auto -RenderPresetUltraQuality=auto -RenderPresetQuality=auto -RenderPresetBalanced=auto -RenderPresetPerformance=auto -RenderPresetUltraPerformance=auto - - - - - -; ------------------------------------------------------- -[Menu] -; ------------------------------------------------------- -; Enables new overlay ImGui menus -; true or false - Default (auto) is when OptiScaler is nvngx.dll false otherwise true -OverlayMenu=auto - -; In-game ImGui menu scale -; 1.0 to 2.0 - Default (auto) is 1.0 -Scale=auto - -; Shortcut key for opening menu -; Integer value - Default (auto) is 45 -> VK_INSERT (0x2D), previous default key VK_HOME is 36 (0x24) -ShortcutKey=auto - -; For all keycode values you can check this address -; https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes - -; Enables advanced settings -; true or false - Default (auto) is false -AdvancedSettings=auto - -; Extends scaling ratio limits to 0.1 - 6.0 -; true or false - Default (auto) is false -ExtendedLimits=auto - - - - - -; ------------------------------------------------------- -[Hooks] -; ------------------------------------------------------- -; Skip hooking of local nvngx files and only hook nvngx at registry -; Needed for Uniscaler + FG -; true or false - Default (auto) is false -HookOriginalNvngxOnly=auto - - - - - -; ------------------------------------------------------- -[Spoofing] -; ------------------------------------------------------- -; Enables Nvidia GPU spoofing for DXGI -; true or false - Default (auto) is true -Dxgi=auto - -; Skips DXGI GPU spoofing when caller method in the list (example: slInit|slGetPluginFunction|nvapi_QueryInterface) -; Be careful this will disable spoofing for rest of the calls also does not work on Linux -; true or false - Default (auto) is disabled -DxgiBlacklist=auto - -; Spoof amount of VRAM for DXGI -; Spoofed amount in GBs - Default (auto) is disabled -DxgiVRAM=auto - -; Enables Nvidia GPU spoofing for Vulkan -; true or false - Default (auto) is false -Vulkan=auto - -; Enables Nvidia extension spoofing for Vulkan -; true or false - Default (auto) is false -VulkanExtensionSpoofing=auto - -; Spoofed GPU name -; Default (auto) is NVIDIA GeForce RTX 4090 -SpoofedGPUName=auto - - - - - -; ------------------------------------------------------- -[Plugins] -; ------------------------------------------------------- -; Path that will be searched for same filename plugins (dxgi.dll, winmm.dll, etc.) -; Default is .\plugins -Path=auto - -; Loads SpecialK64.dll from game's exe folder -; Please put a SpecialK.dxgi file next to SpecialK64.dll -; to set SpecialK's working mode otherwise it will not be activated -; true or false - Default (auto) is false -LoadSpecialK=auto - - - - -; ------------------------------------------------------- -[NvApi] -; ------------------------------------------------------- -; Override loading of nvapi64.dll -; true or false - Default (auto) is false -OverrideNvapiDll=auto - -; If nvapi override enabled and file path defined here -; will try to load it from here, otherwise will check current folder for nvapi64.dll -; true or false - Default (auto) local folder -NvapiDllPath=auto - - - - - -; ------------------------------------------------------- -[Sharpness] -; ------------------------------------------------------- -; Override DLSS sharpness paramater with fixed shapness value -; true or false - Default (auto) is false -OverrideSharpness=auto - -; Strength of sharpening, -; value range between 0.0 and 1.0 (while using upper limit is RCAS 1.3) - Default (auto) is 0.3 -Sharpness=auto - - - - - -; ------------------------------------------------------- -[OutputScaling] -; ------------------------------------------------------- -; Enable output scaling option for Dx12 and Dx11 with Dx12 backends -; true or false - Default (auto) is false -Enabled=auto - -; Output scaling ratio -; 0.5 - 3.0 - Default (auto) is 1.5 -Multiplier=auto - -; Enable FSR for upscaling & downscaling, otherwise bicubic will be used -; true or false - Default (auto) is true -UseFsr=auto - - - - - -; ------------------------------------------------------- -[CAS] -; ------------------------------------------------------- -; Enables RCAS sharpening -; true or false - Default (auto) is false -Enabled=auto - -; Enable motion sharpness -; true or false - Default (auto) is false -MotionSharpnessEnabled=auto - -; Sharpening will be added or removed according to motion length -; value range between -1.0 and 1.0 - Default (auto) is 0.8 -MotionSharpness=auto - -; How much a pixel should move before motion sharpness applied -; 0.0 - 100.0 - Default (auto) is 0.0 -MotionThreshold=auto - -; How much a pixel should move to reach maximum MotionSharpness value -; Values between MotionThreshold and this value will use be used to scale sharpness value -; 0.0 - 100.0 - Default (auto) is 10.0 -MotionScaleLimit=auto - -; Enable debug highlighting for motion sharpening -; Reddish hue for added greenish for reduced sharpness -; true or false - Default (auto) is false -MotionSharpnessDebug=auto - - - - - -; ------------------------------------------------------- -[Log] -; ------------------------------------------------------- -; Log file, if undefined OptiScaler.log file in current folder -; Default (auto) is OptiScaler.log in same folder -LogFile=auto - -; Verbosity level of file logs -; 0 = Trace / 1 = Debug / 2 = Info / 3 = Warning / 4 = Error -; Default (auto) is 2 = Info -LogLevel=auto - -; Log to console (Log level is always 2 (Info) for performance reasons) -; true or false - Default (auto) is false -LogToConsole=auto - -; Log to file -; true or false - Default (auto) is false -LogToFile=auto - -; Log to NVNGX API -; true or false - Default (auto) is false -LogToNGX=true - -; Open console window for logs -; true or false - Default (auto) is false -OpenConsole=auto - -; When set to false creates a new log file for every OptiScaler session -; true or false - Default (auto) is true -SingleFile=auto - - - - - -; ------------------------------------------------------- -[InitFlags] -; ------------------------------------------------------- -; Force add ENABLE_AUTOEXPOSURE to init flags -; Some Unreal Engine games needs this, fixes colors specially in dark areas -; true or false - Default (auto) is DLSS value -AutoExposure=auto - -; Force add HDR_INPUT_COLOR to init flags -; true or false - Default (auto) is DLSS value -HDR=auto - -; Force add INVERTED_DEPTH to init flags -; true or false - Default (auto) is DLSS value -DepthInverted=auto - -; Force add JITTERED_MV flag to init flags -; true or false - Default (auto) is DLSS value -JitterCancellation=auto - -; Force add HIGH_RES_MV flag to init flags -; true or false - Default (auto) is DLSS value -DisplayResolution=auto - -; Force remove RESPONSIVE_PIXEL_MASK from init flags -; true or false - Default (auto) is true -DisableReactiveMask=auto - - - - -; ------------------------------------------------------- -[UpscaleRatio] -; ------------------------------------------------------- -; Set this to true to enable the internal resolution override -; true or false - Default (auto) is false -UpscaleRatioOverrideEnabled=auto - -; Set the forced upscale ratio value -; Default (auto) is 1.3 -UpscaleRatioOverrideValue=auto - - - - - -; ------------------------------------------------------- -[QualityOverrides] -; ------------------------------------------------------- -; Set this to true to enable custom quality mode overrides -; true or false - Default (auto) is false -QualityRatioOverrideEnabled=auto - -; Set custom upscaling ratio for each quality mode -; -; Default (auto) values: -; DLAA : 1.0 -; Ultra Quality : 1.3 -; Quality : 1.5 -; Balanced : 1.7 -; Performance : 2.0 -; Ultra Performance : 3.0 -QualityRatioDLAA=auto -QualityRatioUltraQuality=auto -QualityRatioQuality=auto -QualityRatioBalanced=auto -QualityRatioPerformance=auto -QualityRatioUltraPerformance=auto - - - - - -; ------------------------------------------------------- -[DRS] -; ------------------------------------------------------- -; Set this to true to enable limiting DRS min resolution to rendering resolution -; true or false - Default (auto) is false -DrsMinOverrideEnabled=auto - -; Set this to true to enable limiting DRS max resolution to rendering resolution -; true or false - Default (auto) is false -DrsMaxOverrideEnabled=auto - - - - - -; ------------------------------------------------------- -[Hotfix] -; ------------------------------------------------------- -; Override mipmap lod bias for textures -; -15.0 - 15.0 - Default (auto) is disabled -MipmapBiasOverride=auto - -; Override max anisotropy for textures -; 2, 4, 8, 16 - Default (auto) is disabled -AnisotropyOverride=auto - -; Rounds internal resolutions width and height to multiple of this value -; 2, 4, 8, 16 ... - Default (auto) is disabled -RoundInternalResolution=auto - -; Skips upscaling of n frames -; n is integer number - Default (auto) is disabled -SkipFirstFrames=auto - -; Restore last used compute signature after upscaling -; true or false - Default (auto) is false -RestoreComputeSignature=auto - -; Restore last used graphics signature after upscaling -; true or false - Default (auto) is false -RestoreGraphicSignature=auto - -; Use precompiled shaders for RCAS, Output Scaling ans Mask Bias -; true or false - Default (auto) is true -UsePrecompiledShaders=auto - -; Color texture resource state to fix for rainbow colors on AMD cards (for mostly UE games) -; For UE engine games on AMD, set it to D3D12_RESOURCE_STATE_RENDER_TARGET (4) -; Default (auto) is state correction disabled -ColorResourceBarrier=auto - -; Default (auto) is state correction disabled -MotionVectorResourceBarrier=auto - -; Default (auto) is state correction disabled -DepthResourceBarrier=auto - -; Default (auto) is state correction disabled -ColorMaskResourceBarrier=auto - -; Default (auto) is state correction disabled -ExposureResourceBarrier=auto - -; Default (auto) is state correction disabled -OutputResourceBarrier=auto - -; These settings defines each resources initial resource -; state and add resource barrier for correct state -; -; Common resource barrier states -; ---------------------------------------------------- -; D3D12_RESOURCE_STATE_COMMON = 0, -; D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER = 1, -; D3D12_RESOURCE_STATE_INDEX_BUFFER = 2, -; D3D12_RESOURCE_STATE_RENDER_TARGET = 4, -; D3D12_RESOURCE_STATE_UNORDERED_ACCESS = 8, -; D3D12_RESOURCE_STATE_DEPTH_WRITE = 16, -; D3D12_RESOURCE_STATE_DEPTH_READ = 32, -; D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE = 64, -; D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE = 128, -;------------------------------------------------------ -; -; All state values can be checked from here -; https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ne-d3d12-d3d12_resource_states diff --git a/main.py b/main.py index 6f15132..fc714ba 100644 --- a/main.py +++ b/main.py @@ -22,85 +22,57 @@ class Plugin: return {"status": "success", "output": result.stdout} except subprocess.CalledProcessError as e: return {"status": "error", "message": str(e), "output": e.output} + except Exception as e: + return {"status": "error", "message": f"Unexpected error: {str(e)}"} async def run_install_fgmod(self) -> dict: try: - assets_dir = Path(decky.DECKY_PLUGIN_DIR) / "assets" - downloads_dir = Path(decky.HOME) / "Downloads" + defaults_dir = Path(decky.DECKY_PLUGIN_DIR) / "assets" + fgmod_dir = Path(decky.HOME) / "fgmod" + + if not defaults_dir.exists(): + decky.logger.error(f"Defaults directory not found: {defaults_dir}") + return {"status": "error", "message": f"Defaults directory not found: {defaults_dir}"} - if not assets_dir.exists(): - decky.logger.error(f"Assets directory not found: {assets_dir}") - return { - "status": "error", - "message": f"Assets directory not found: {assets_dir}" - } + fgmod_dir.mkdir(parents=True, exist_ok=True) - downloads_dir.mkdir(parents=True, exist_ok=True) + files_to_copy = [ + "amd_fidelityfx_dx12.dll", "dlssg_to_fsr3_amd_is_better.dll", "libxess.dll", + "amd_fidelityfx_vk.dll", "dlssg_to_fsr3.ini", + "d3dcompiler_47.dll", "dxgi.dll", "nvapi64.dll", + "DisableNvidiaSignatureChecks.reg", "dxvk.conf", "_nvngx.dll", + "dlss-enabler.dll", "fakenvapi.ini", "nvngx.ini", + "dlss-enabler-upscaler.dll", "fgmod", "nvngx-wrapper.dll", + "dlssg_to_fsr3_amd_is_better-3.0.dll", "fgmod-uninstaller.sh", "RestoreNvidiaSignatureChecks.reg" + ] - files_to_copy = ["prepare.sh", "fgmod.sh", "fgmod-uninstaller.sh"] for file_name in files_to_copy: - src = assets_dir / file_name + src = defaults_dir / file_name + dest = fgmod_dir / file_name if not src.exists(): decky.logger.error(f"Required file missing: {src}") - return { - "status": "error", - "message": f"Required file missing: {file_name}" - } - - dest = downloads_dir / file_name + return {"status": "error", "message": f"Required file missing: {file_name}"} dest.write_bytes(src.read_bytes()) dest.chmod(0o755) - prepare_script = downloads_dir / "prepare.sh" - process = subprocess.run( - ["/bin/bash", str(prepare_script)], - capture_output=True, - text=True, - timeout=300 - ) + # Ensure the uninstaller script is executable + uninstaller_script = fgmod_dir / "fgmod-uninstaller.sh" + uninstaller_script.chmod(0o755) - fgmod_path = Path(decky.HOME) / "fgmod" - fgmod_path.mkdir(parents=True, exist_ok=True) - - decky.logger.info(f"Script output:\n{process.stdout}") - decky.logger.error(f"Script errors:\n{process.stderr}") - - if "All done!" not in process.stdout: - decky.logger.error("Installation did not complete successfully") - return { - "status": "error", - "message": process.stdout + process.stderr - } - - return { - "status": "success", - "output": "You can now replace DLSS with FSR Frame Gen!" - } - - except subprocess.TimeoutExpired: - decky.logger.error("Installation script timed out") - return { - "status": "error", - "message": "Installation timed out" - } - except subprocess.CalledProcessError as e: - decky.logger.error(f"Script error: {e.stderr}") - return { - "status": "error", - "message": e.stderr - } + # Verify all files exist in fgmod directory + missing_files = [file for file in files_to_copy if not (fgmod_dir / file).exists()] + if missing_files: + return {"status": "error", "message": f"Missing files: {', '.join(missing_files)}"} + + return {"status": "success", "output": "You can now replace DLSS with FSR Frame Gen!"} except Exception as e: - decky.logger.error(f"Unexpected error: {str(e)}") - return { - "status": "error", - "message": str(e) - } + return {"status": "error", "message": f"Unexpected error: {str(e)}"} async def check_fgmod_path(self) -> dict: - path = Path(decky.HOME) / "fgmod" + fgmod_dir = Path(decky.HOME) / "fgmod" required_files = [ "amd_fidelityfx_dx12.dll", "dlssg_to_fsr3_amd_is_better.dll", "libxess.dll", - "amd_fidelityfx_vk.dll", "dlssg_to_fsr3.ini", "licenses", + "amd_fidelityfx_vk.dll", "dlssg_to_fsr3.ini", "d3dcompiler_47.dll", "dxgi.dll", "nvapi64.dll", "DisableNvidiaSignatureChecks.reg", "dxvk.conf", "_nvngx.dll", "dlss-enabler.dll", "fakenvapi.ini", "nvngx.ini", @@ -108,19 +80,16 @@ class Plugin: "dlssg_to_fsr3_amd_is_better-3.0.dll", "fgmod-uninstaller.sh", "RestoreNvidiaSignatureChecks.reg" ] - if path.exists(): - for file_name in required_files: - if not path.joinpath(file_name).exists(): - return {"exists": False} - return {"exists": True} - else: + if not fgmod_dir.exists(): return {"exists": False} - # New method to list installed Steam games + missing_files = [file for file in required_files if not (fgmod_dir / file).exists()] + return {"exists": not missing_files, "missing_files": missing_files} + async def list_installed_games(self) -> dict: try: steam_root = Path(decky.HOME) / ".steam" / "steam" - library_file = Path(steam_root) / "steamapps" / "libraryfolders.vdf" + library_file = steam_root / "steamapps" / "libraryfolders.vdf" if not library_file.exists(): return {"status": "error", "message": "libraryfolders.vdf not found"} @@ -156,4 +125,4 @@ class Plugin: return {"status": "success", "games": filtered_games} except Exception as e: - return {"status": "error", "message": str(e)} + return {"status": "error", "message": str(e)} \ No newline at end of file -- cgit v1.2.3