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
This commit is contained in:
Joshua Ashton 2023-08-25 13:07:17 +01:00 committed by Rémi Bernon
parent e727a79f3b
commit 5209dad54b

12
proton
View File

@ -803,7 +803,7 @@ class CompatData:
use_wined3d = "wined3d" in g_session.compat_config use_wined3d = "wined3d" in g_session.compat_config
use_dxvk_dxgi = not use_wined3d and \ use_dxvk_dxgi = not use_wined3d and \
not ("WINEDLLOVERRIDES" in g_session.env and "dxgi=b" in g_session.env["WINEDLLOVERRIDES"]) 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", builtin_dll_copy = os.environ.get("PROTON_DLL_COPY",
#dxsetup redist #dxsetup redist
@ -1429,6 +1429,7 @@ class Session:
self.check_environment("PROTON_NO_XIM", "noxim") self.check_environment("PROTON_NO_XIM", "noxim")
self.check_environment("PROTON_HEAP_DELAY_FREE", "heapdelayfree") self.check_environment("PROTON_HEAP_DELAY_FREE", "heapdelayfree")
self.check_environment("PROTON_ENABLE_NVAPI", "enablenvapi") self.check_environment("PROTON_ENABLE_NVAPI", "enablenvapi")
self.check_environment("PROTON_FORCE_NVAPI", "forcenvapi")
self.check_environment("PROTON_ENABLE_AMD_AGS", "enableamdags") self.check_environment("PROTON_ENABLE_AMD_AGS", "enableamdags")
if "noesync" in self.compat_config: if "noesync" in self.compat_config:
@ -1473,7 +1474,7 @@ class Session:
self.env["WINE_HIDE_VANGOGH_GPU"] = "1" self.env["WINE_HIDE_VANGOGH_GPU"] = "1"
# enablenvapi beats hidenvgpu # 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" self.env["WINE_HIDE_NVIDIA_GPU"] = "1"
if "usenativexinput13" in self.compat_config: if "usenativexinput13" in self.compat_config:
@ -1549,9 +1550,14 @@ class Session:
if "nativevulkanloader" in self.compat_config: if "nativevulkanloader" in self.compat_config:
self.dlloverrides["vulkan-1"] = "n" 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" 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: if "enableamdags" in self.compat_config:
self.dlloverrides["amd_ags_x64"] = "b" self.dlloverrides["amd_ags_x64"] = "b"