Skip to content

Commit

Permalink
proton: follow upstream wined3d/dxvk/vkd3d envvar usage, import upstr…
Browse files Browse the repository at this point in the history
…eam changes
  • Loading branch information
GloriousEggroll committed Jul 28, 2024
1 parent 529643b commit d2cd4be
Showing 1 changed file with 21 additions and 26 deletions.
47 changes: 21 additions & 26 deletions proton
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ from pathlib import Path
#To enable debug logging, copy "user_settings.sample.py" to "user_settings.py"
#and edit it if needed.

CURRENT_PREFIX_VERSION="GE-Proton9-10"
CURRENT_PREFIX_VERSION="GE-Proton9-11"

PFX="Proton: "
ld_path_var = "LD_LIBRARY_PATH"
Expand Down Expand Up @@ -636,6 +636,9 @@ class CompatData:
#proton 3.7 did not generate tracked_files, so copy it into place first
try_copy(g_proton.path("proton_3.7_tracked_files"), self.tracked_files_file)
self.remove_tracked_files()
path = self.prefix_dir + "/drive_c/Program Files (x86)/Ubisoft/Ubisoft Game Launcher/version.txt"
if file_exists(path, follow_symlinks=False) and os.path.isfile(path):
os.remove(path)
return

if old_proton_ver == "3.7" and old_prefix_ver == "1":
Expand Down Expand Up @@ -904,6 +907,7 @@ class CompatData:
use_dxvk_dxgi = not use_wined3d and \
not ("WINEDLLOVERRIDES" in g_session.env and "dxgi=b" in g_session.env["WINEDLLOVERRIDES"])
use_nvapi = 'disablenvapi' not in g_session.compat_config or 'forcenvapi' in g_session.compat_config
use_dxvk_d3d8 = "dxvkd3d8" in g_session.compat_config

builtin_dll_copy = os.environ.get("PROTON_DLL_COPY",
#dxsetup redist
Expand Down Expand Up @@ -954,6 +958,7 @@ class CompatData:
str(use_dxvk_dxgi),
builtin_dll_copy,
str(use_nvapi),
str(use_dxvk_d3d8),
))

# check whether any prefix config has changed
Expand Down Expand Up @@ -1027,9 +1032,9 @@ class CompatData:
if use_wined3d:
dxvkfiles = []
vkd3d_protonfiles = []
wined3dfiles = ["d3d12", "d3d11", "d3d10", "d3d10core", "d3d10_1", "d3d9", "d3d8"]
wined3dfiles = ["d3d12", "d3d11", "d3d10", "d3d10core", "d3d10_1", "d3d9"]
else:
dxvkfiles = ["d3d11", "d3d10core", "d3d9", "d3d8"]
dxvkfiles = ["d3d11", "d3d10core", "d3d9"]
vkd3d_protonfiles = ["d3d12", "d3d12core"]
wined3dfiles = []

Expand All @@ -1038,6 +1043,11 @@ class CompatData:
else:
wined3dfiles.append("dxgi")

if use_dxvk_d3d8:
dxvkfiles.append("d3d8")
else:
wined3dfiles.append("d3d8")

for f in wined3dfiles:
try_copy(g_proton.default_pfx_dir + "drive_c/windows/system32/" + f + ".dll", "drive_c/windows/system32",
prefix=self.prefix_dir, track_file=tracked_files, link_debug=True)
Expand Down Expand Up @@ -1192,6 +1202,7 @@ def default_compat_config():
"460790", #Bayonetta
"273590", #Descent 3
"834530", #Yakuza Kiwami
"714010", #Aimlabs
]:
ret.add("gamedrive")

Expand Down Expand Up @@ -1238,6 +1249,9 @@ def default_compat_config():
"109600", #Neverwinter
"9900", #Star Trek Online
"9880", #Champions Online
"202750", #Alan Wake's American Nightmare
"255220", #GRID Autosport
"44350", #GRID 2
]:
ret.add("disablenvapi")

Expand Down Expand Up @@ -1458,13 +1472,10 @@ class Session:
self.compat_config.add("wined3d")

if not self.check_environment("PROTON_USE_WINED3D", "wined3d"):
if not self.check_environment("PROTON_USE_WINED3D11", "wined3d"):
self.check_environment("PROTON_USE_WINED3D9", "wined3d9")
self.check_environment("PROTON_NO_D3D12", "nod3d12")
self.check_environment("PROTON_USE_WINED3D11", "wined3d")
self.check_environment("PROTON_DXVK_D3D8", "dxvkd3d8")
self.check_environment("PROTON_NO_D3D11", "nod3d11")
self.check_environment("PROTON_NO_D3D10", "nod3d10")
self.check_environment("PROTON_NO_D9VK", "nod3d9")
self.check_environment("PROTON_NO_D8VK", "nod3d8")
self.check_environment("PROTON_NO_ESYNC", "noesync")
self.check_environment("PROTON_NO_FSYNC", "nofsync")
self.check_environment("PROTON_FORCE_LARGE_ADDRESS_AWARE", "forcelgadd")
Expand Down Expand Up @@ -1599,14 +1610,6 @@ class Session:
if update_prefix_files:
g_compatdata.setup_prefix()

if "nativevulkanloader" in self.compat_config:
self.dlloverrides["vulkan-1"] = "n"

if "nod3d12" in self.compat_config:
self.dlloverrides["d3d12"] = ""
if "dxgi" in self.dlloverrides:
del self.dlloverrides["dxgi"]

if "nod3d11" in self.compat_config:
self.dlloverrides["d3d11"] = ""
if "dxgi" in self.dlloverrides:
Expand All @@ -1617,16 +1620,8 @@ class Session:
self.dlloverrides["d3d10"] = ""
self.dlloverrides["dxgi"] = ""

if "nod3d9" in self.compat_config:
self.dlloverrides["d3d9"] = ""
self.dlloverrides["dxgi"] = ""

if "nod3d8" in self.compat_config:
self.dlloverrides["d3d8"] = ""
self.dlloverrides["dxgi"] = ""

if "wined3d9" in self.compat_config:
self.dlloverrides["d3d9"] = "b"
if "nativevulkanloader" in self.compat_config:
self.dlloverrides["vulkan-1"] = "n"

if "disablenvapi" not in self.compat_config or "forcenvapi" in self.compat_config:
self.env["DXVK_ENABLE_NVAPI"] = "1"
Expand Down

0 comments on commit d2cd4be

Please sign in to comment.