Add xrizer support

This commit is contained in:
Sapphire
2025-02-16 13:27:26 +01:00
committed by xytovl
parent 3817dd4363
commit 5b49e2fc9f
5 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -41,8 +41,8 @@ auto_option(WIVRN_USE_X264 "Enable x264 software encoder" AUTO)
auto_option(WIVRN_USE_PIPEWIRE "Enable pipewire backend" AUTO)
auto_option(WIVRN_USE_PULSEAUDIO "Enable pulseaudio backend" AUTO)
set(OPENCOMPOSITE_SEARCH_PATH "/usr/local/lib/OpenComposite:/usr/lib/OpenComposite:/opt/OpenComposite:/opt/opencomposite"
CACHE STRING "List of places to search for OpenComposite, separated by :")
set(OVR_COMPAT_SEARCH_PATH "/usr/local/lib/OpenComposite:/usr/lib/OpenComposite:/opt/OpenComposite:/opt/opencomposite:/opt/xrizer"
CACHE STRING "List of places to search for the OpenVR compatibility layer, separated by :")
option(WIVRN_FEATURE_DEBUG_GUI "Enable Monado debug GUI" OFF)
option(WIVRN_FEATURE_RENDERDOC "Support renderdoc" OFF)
+1 -1
View File
@@ -38,4 +38,4 @@
#cmakedefine01 WIVRN_USE_LIBKTX
#define WIVRN_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@"
#define OPENCOMPOSITE_SEARCH_PATH "@OPENCOMPOSITE_SEARCH_PATH@"
#define OVR_COMPAT_SEARCH_PATH "@OVR_COMPAT_SEARCH_PATH@"
+5 -5
View File
@@ -46,11 +46,11 @@ std::filesystem::path active_runtime::manifest_path()
return std::filesystem::path(WIVRN_INSTALL_PREFIX) / install_location;
}
std::filesystem::path active_runtime::opencomposite_path()
std::filesystem::path active_runtime::openvr_compat_path()
{
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(OPENCOMPOSITE_SEARCH_PATH), std::string_view(":")))
for (auto path: std::ranges::split_view(std::string_view(OVR_COMPAT_SEARCH_PATH), std::string_view(":")))
{
if (auto res = std::string_view(path); std::filesystem::exists(res))
return res;
@@ -91,15 +91,15 @@ active_runtime::active_runtime() :
try
{
auto opencomposite = opencomposite_path();
if (not opencomposite.empty())
auto ovr_compat = openvr_compat_path();
if (not ovr_compat.empty())
{
std::filesystem::path openvr_manifest = xdg_config_home() / "openvr/openvrpaths.vrpath";
std::filesystem::create_directories(openvr_manifest.parent_path());
move_file(openvr_manifest, backup_name(openvr_manifest));
nlohmann::json manifest;
manifest["runtime"] = {opencomposite.string()};
manifest["runtime"] = {ovr_compat.string()};
manifest["version"] = 1;
std::ofstream manifest_file(openvr_manifest.c_str());
manifest_file.exceptions(std::ofstream::failbit);
+1 -1
View File
@@ -37,6 +37,6 @@ public:
~active_runtime();
static std::filesystem::path manifest_path();
static std::filesystem::path opencomposite_path();
static std::filesystem::path openvr_compat_path();
};
} // namespace wivrn
+1 -1
View File
@@ -168,7 +168,7 @@ static std::string steam_command()
if (app_path.starts_with("/var"))
pressure_vessel_filesystems_rw += ":" + app_path;
}
else if (auto p = active_runtime::opencomposite_path().string(); not p.empty())
else if (auto p = active_runtime::openvr_compat_path().string(); not p.empty())
{
// /usr cannot be shared in pressure vessel container
if (p.starts_with("/usr"))