-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Thanks to @GloriousEggroll for the wined3d patches squashing
- Loading branch information
Showing
7 changed files
with
1,791 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
From 5c5a18438870d10c31933061b2721477658931c9 Mon Sep 17 00:00:00 2001 | ||
From: Tk-Glitch <[email protected]> | ||
Date: Mon, 3 Feb 2020 07:17:25 +0100 | ||
Subject: proton-tkg: initial vr support | ||
|
||
|
||
diff --git a/proton b/proton | ||
index 811de5e..028e7dd 100755 | ||
--- a/proton | ||
+++ b/proton | ||
@@ -333,6 +333,15 @@ class CompatData: | ||
os.remove(dstfile) | ||
try_copy(steamdir + "/legacycompat/" + f, dstfile) | ||
|
||
+ #copy openvr files into place | ||
+ dst = self.prefix_dir + "/drive_c/vrclient/bin/" | ||
+ makedirs(dst) | ||
+ try_copy(g_proton.lib_dir + "wine/fakedlls/vrclient.dll", dst) | ||
+ try_copy(g_proton.lib64_dir + "wine/fakedlls/vrclient_x64.dll", dst) | ||
+ | ||
+ try_copy(g_proton.lib_dir + "wine/dxvk/openvr_api_dxvk.dll", self.prefix_dir + "/drive_c/windows/syswow64/") | ||
+ try_copy(g_proton.lib64_dir + "wine/dxvk/openvr_api_dxvk.dll", self.prefix_dir + "/drive_c/windows/system32/") | ||
+ | ||
dxvkfiles = ("d3d11", "d3d10", "d3d10core", "d3d10_1") | ||
def make_dxvk_links(dll_dir, link_dir): | ||
for f in dxvkfiles: | ||
@@ -696,6 +705,79 @@ class Session: | ||
else: | ||
self.env["WINEDLLOVERRIDES"] = s | ||
|
||
+ def setup_vr(self): | ||
+ #parse linux openvr config and present it in win32 format to the app. | ||
+ #logic from openvr's CVRPathRegistry_Public::GetPaths | ||
+ | ||
+ #check environment for overrides | ||
+ vr_runtime = None | ||
+ if "VR_OVERRIDE" in self.env: | ||
+ vr_runtime = self.env["VR_OVERRIDE"] | ||
+ self.env.pop("VR_OVERRIDE") | ||
+ | ||
+ vr_config = None | ||
+ if "VR_CONFIG_PATH" in self.env: | ||
+ vr_config = self.env["VR_CONFIG_PATH"] | ||
+ self.env.pop("VR_CONFIG_PATH") | ||
+ | ||
+ vr_log = None | ||
+ if "VR_LOG_PATH" in self.env: | ||
+ vr_log = self.env["VR_LOG_PATH"] | ||
+ self.env.pop("VR_LOG_PATH") | ||
+ | ||
+ #load from json if needed | ||
+ if vr_runtime is None or \ | ||
+ vr_config is None or \ | ||
+ vr_log is None: | ||
+ try: | ||
+ path = os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config") | ||
+ path = path + "/openvr/openvrpaths.vrpath" | ||
+ | ||
+ with open(path, "r") as jfile: | ||
+ j = json.load(jfile) | ||
+ | ||
+ if vr_runtime is None: | ||
+ vr_runtime = j["runtime"][0] | ||
+ | ||
+ if vr_config is None: | ||
+ vr_config = j["config"][0] | ||
+ | ||
+ if vr_log is None: | ||
+ vr_log = j["log"][0] | ||
+ except (TypeError, ValueError, OSError): | ||
+ #log("Missing or invalid openvrpaths.vrpath file! " + str(sys.exc_info()[1])) | ||
+ pass | ||
+ | ||
+ makedirs(g_compatdata.prefix_dir + "/drive_c/users/steamuser/Local Settings/Application Data/openvr") | ||
+ | ||
+ #remove existing file | ||
+ vrpaths_name = g_compatdata.prefix_dir + "/drive_c/users/steamuser/Local Settings/Application Data/openvr/openvrpaths.vrpath" | ||
+ if os.path.exists(vrpaths_name): | ||
+ os.remove(vrpaths_name) | ||
+ | ||
+ #dump new file | ||
+ if not vr_runtime is None: | ||
+ try: | ||
+ self.env["PROTON_VR_RUNTIME"] = vr_runtime | ||
+ | ||
+ j = { "runtime": [ "C:\\vrclient\\", "C:\\vrclient" ] } | ||
+ | ||
+ if not vr_config is None: | ||
+ win_vr_config = subprocess.check_output([g_proton.wine_bin, "winepath", "-w", vr_config], env=self.env, stderr=self.log_file).decode("utf-8") | ||
+ j["config"] = [ win_vr_config.strip() ] | ||
+ | ||
+ if not vr_log is None: | ||
+ win_vr_log = subprocess.check_output([g_proton.wine_bin, "winepath", "-w", vr_log], env=self.env, stderr=self.log_file).decode("utf-8") | ||
+ j["log"] = [ win_vr_log.strip() ] | ||
+ | ||
+ j["version"] = 1 | ||
+ j["jsonid"] = "vrpathreg" | ||
+ | ||
+ with open(vrpaths_name, "w") as vfile: | ||
+ json.dump(j, vfile, indent=2) | ||
+ except (ValueError, OSError): | ||
+ log("Unable to write VR config! " + str(sys.exc_info()[1])) | ||
+ | ||
def dump_dbg_env(self, f): | ||
f.write("PATH=\"" + self.env["PATH"] + "\" \\\n") | ||
f.write("\tTERM=\"xterm\" \\\n") #XXX | ||
@@ -804,6 +886,7 @@ class Session: | ||
subprocess.call(args, env=local_env, stderr=self.log_file, stdout=self.log_file) | ||
|
||
def run(self): | ||
+ self.setup_vr() | ||
if "PROTON_DUMP_DEBUG_COMMANDS" in self.env and nonzero(self.env["PROTON_DUMP_DEBUG_COMMANDS"]): | ||
try: | ||
self.dump_dbg_scripts() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Integrity checks (md5) differ in size from the source array.