Add xrizer support
This commit is contained in:
+2
-2
@@ -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)
|
||||
|
||||
@@ -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@"
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user