From 5209dad54b7eedfcfc498d5397990fe3c4bbb40a Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Fri, 25 Aug 2023 13:07:17 +0100 Subject: [PATCH] proton: Add forcenvapi To allow titles like Tony Hawk's Pro Skater 1+2 to support HDR on SteamOS by default. These games use statically linked AMD AGS. CW-Bug-Id: #23140 --- proton | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/proton b/proton index 081c6226..abab320a 100755 --- a/proton +++ b/proton @@ -803,7 +803,7 @@ class CompatData: use_wined3d = "wined3d" in g_session.compat_config use_dxvk_dxgi = not use_wined3d and \ not ("WINEDLLOVERRIDES" in g_session.env and "dxgi=b" in g_session.env["WINEDLLOVERRIDES"]) - use_nvapi = 'enablenvapi' in g_session.compat_config + use_nvapi = 'enablenvapi' in g_session.compat_config or 'forcenvapi' in g_session.compat_config builtin_dll_copy = os.environ.get("PROTON_DLL_COPY", #dxsetup redist @@ -1429,6 +1429,7 @@ class Session: self.check_environment("PROTON_NO_XIM", "noxim") self.check_environment("PROTON_HEAP_DELAY_FREE", "heapdelayfree") self.check_environment("PROTON_ENABLE_NVAPI", "enablenvapi") + self.check_environment("PROTON_FORCE_NVAPI", "forcenvapi") self.check_environment("PROTON_ENABLE_AMD_AGS", "enableamdags") if "noesync" in self.compat_config: @@ -1473,7 +1474,7 @@ class Session: self.env["WINE_HIDE_VANGOGH_GPU"] = "1" # enablenvapi beats hidenvgpu - if "hidenvgpu" in self.compat_config and "enablenvapi" not in self.compat_config: + if "hidenvgpu" in self.compat_config and "enablenvapi" not in self.compat_config and "forcenvapi" not in self.compat_config: self.env["WINE_HIDE_NVIDIA_GPU"] = "1" if "usenativexinput13" in self.compat_config: @@ -1549,9 +1550,14 @@ class Session: if "nativevulkanloader" in self.compat_config: self.dlloverrides["vulkan-1"] = "n" - if "enablenvapi" in self.compat_config: + if "enablenvapi" in self.compat_config or "forcenvapi" in self.compat_config: self.env["DXVK_ENABLE_NVAPI"] = "1" + if "forcenvapi" in self.compat_config: + self.env["DXVK_NVAPI_ALLOW_OTHER_DRIVERS"] = "1" + self.env["DXVK_NVAPI_DRIVER_VERSION"] = "99999" + self.env["WINE_HIDE_AMD_GPU"] = "1" + if "enableamdags" in self.compat_config: self.dlloverrides["amd_ags_x64"] = "b"