Add OpenVR runtime override as a setting, add --early-active-runtime to test this (rv2)

I ran into some trouble debugging issues with Vivecraft because my OpenVR runtime setup was being automatically overridden by WiVRn.

It would be nice to attach a UI to this option, but I'm not sure on the details there and I'd like to keep the PR small and easily reviewed.

Being able to set the compat path is more useful than simply disabling compat override because of things like pressure-vessel bypass, which are finicky to get right.
This commit is contained in:
t20kdc
2025-03-21 22:40:48 +01:00
committed by xytovl
parent c23c0ed8e8
commit 0e9b72c776
6 changed files with 38 additions and 3 deletions
+7
View File
@@ -18,6 +18,7 @@
*/
#include "active_runtime.h"
#include "driver/configuration.h"
#include "utils/flatpak.h"
#include "utils/xdg_base_directory.h"
#include "wivrn_config.h"
@@ -48,6 +49,12 @@ std::filesystem::path active_runtime::manifest_path()
std::filesystem::path active_runtime::openvr_compat_path()
{
// config can override compat path (i.e. to debug changes to OpenComposite)
std::optional<std::string> path_override = configuration::read_user_configuration().openvr_compat_path;
if (path_override.has_value())
return std::filesystem::path(path_override.value());
// otherwise, prefer flatpak copy if present or otherwise try to find it on the system
if (auto path = flatpak_key(flatpak::section::instance, "app-path"))
return std::filesystem::path(*path) / "OpenComposite";
for (auto path: std::ranges::split_view(std::string_view(OVR_COMPAT_SEARCH_PATH), std::string_view(":")))