Compare commits

...
Author SHA1 Message Date
Vindicus999 906e6e5744 Merge remote-tracking branch 'upstream/master' 2026-02-27 02:26:53 +00:00
Patrick Nicolas bfe44c6b8d Drop norm > 0.9 assertion 2026-02-26 23:09:41 +01:00
Patrick Nicolas 9df870a7fa Project layers on the first projection one 2026-02-26 22:21:54 +01:00
Schmarni 8a7cc105cb Call openvrChanged instead of tcpOnlyChanged in set_openvr
Signed-off-by: Schmarni <marnistromer@gmail.com>
2026-02-26 15:00:39 +01:00
Schmarni 1e6937d4a4 Add port and hostname config options
Signed-off-by: Schmarni <marnistromer@gmail.com>
2026-02-26 15:00:39 +01:00
BERADQ 0f21191e9b Check NVENC intra-refresh capability before enabling the feature 2026-02-26 15:00:05 +01:00
BERADQ 6254386370 Set intra refresh period and count to fixed values. 2026-02-26 15:00:05 +01:00
BERADQ e32d3bbf36 Enable intra refresh for H264/HEVC/AV1 with period=fps and count=fps/2 2026-02-26 15:00:05 +01:00
Vindicus999 c1c703b445 Merge remote-tracking branch 'upstream/master' 2026-02-26 02:28:17 +00:00
Patrick Nicolas 63cb9ff179 Use same trigger threshold as in Monado 2026-02-25 21:08:18 +01:00
BERADQ a16a0df1c0 Update Simplified Chinese localization -> close #599 2026-02-25 14:56:26 +01:00
Vindicus999 b4d610f52a Merge remote-tracking branch 'upstream/master' 2026-02-24 02:31:10 +00:00
Patrick Nicolas f476f9a1db Default refresh rate < 100Hz 2026-02-23 19:14:44 +01:00
Vindicus999 5f6dd17149 Merge remote-tracking branch 'upstream/master' 2026-02-23 02:34:49 +00:00
Gabriel ea84391ba3 Unacceptable and deplorable typo fixed 2026-02-22 15:33:33 +01:00
Vindicus999 ed5986e83b Merge remote-tracking branch 'upstream/master' 2026-02-22 02:33:59 +00:00
Sapphire 71ee653312 Update Monado 2026-02-21 17:11:22 +01:00
Sapphire 19ac929be9 Update Monado 2026-02-21 17:11:22 +01:00
Sapphire 4ff91f1e13 Update Monado 2026-02-21 17:11:22 +01:00
Sapphire e837396944 Update Monado 2026-02-21 17:11:22 +01:00
Vindicus999 eed74ee35e Merge remote-tracking branch 'upstream/master' 2026-02-21 02:22:54 +00:00
Patrick Nicolas 51ee0b46ac Be less strict for quaternions norm 2026-02-20 23:38:43 +01:00
Patrick Nicolas eddda44def Don't recreate hand trackers on each frame 2026-02-20 17:34:31 +01:00
Patrick Nicolas f8a6db5834 vk/video: fix crash on iGPU 2026-02-20 15:56:34 +01:00
Vindicus999 45538f0e8d Merge remote-tracking branch 'upstream/master' 2026-02-20 02:28:47 +00:00
Patrick Nicolas 42c64a6569 vk/video: don't copy the whole buffer 2026-02-19 13:43:08 +01:00
Patrick Nicolas b4349767ce vk/video: properly lock queues 2026-02-19 13:43:04 +01:00
Patrick Nicolas b8e9c79180 vk/video: don't query offset, it is always 0 2026-02-19 13:43:04 +01:00
Patrick Nicolas df6667fd0d vk/video: unify encoded image copy code 2026-02-19 13:42:51 +01:00
Vindicus999 16994942e6 Merge remote-tracking branch 'upstream/master' 2026-02-19 02:33:20 +00:00
Patrick Nicolas 7732dc87df Add workaround for garbled image on Intel B580 2026-02-18 14:04:45 +01:00
Patrick Nicolas 1f42c0cfb8 CI: Update clang-format action 2026-02-18 12:17:50 +01:00
BlackCherryCat 01caa4e7c5 Update es locale 2026-02-18 09:52:37 +01:00
Patrick Nicolas e97618e99e Add try/catch when reading Steam VR manifest 2026-02-18 09:26:48 +01:00
Patrick Nicolas a651f1b252 Fix config reset when selecting app 2026-02-18 09:24:03 +01:00
Vindicus999 3ac943ec32 Merge remote-tracking branch 'upstream/master' 2026-02-18 02:34:17 +00:00
mitsuami-megane 31e98fceab update ja locale 2026-02-17 09:41:26 +01:00
Vindicus999 ddf93218b6 Merge remote-tracking branch 'upstream/master' 2026-02-16 22:36:44 +00:00
Cláudio 'Patola' Sampaio 07f50572ea Translated two messages to pt_BR 2026-02-16 23:28:31 +01:00
Patrick Nicolas a94edf52e2 Don't abort if Vulkan is not available 2026-02-16 21:54:48 +01:00
Patrick Nicolas 6b9e1e108c Update FR locale 2026-02-16 21:48:09 +01:00
Patrick Nicolas 749649d868 Add check for llvmpipe in dashboard 2026-02-16 21:47:13 +01:00
Patrick Nicolas 9353646b55 Support icons in ~/.local/share/icons 2026-02-16 20:32:34 +01:00
Patrick Nicolas 219146e763 Minimal fallback hicolor icon theme definition 2026-02-16 20:32:34 +01:00
Vindicus999 7fbd57b0d8 Merge remote-tracking branch 'upstream/master' 2026-02-16 02:34:21 +00:00
Patrick Nicolas 6c202db59e Update derived poses 1s after interaction profile
Also ignore it for hand interaction
2026-02-15 00:02:17 +01:00
Patrick Nicolas df76543fb7 Don't store poses if timesync is not ready 2026-02-14 23:34:14 +01:00
Vindicus999 fe5d70729f Merge remote-tracking branch 'upstream/master' 2026-02-14 17:56:46 +00:00
Patrick Nicolas b09af79edc Don't return valid data if too far from know times 2026-02-14 09:50:28 +01:00
Vindicus999 b16774188e Merge remote-tracking branch 'upstream/master' 2026-02-14 02:25:51 +00:00
Patrick Nicolas 627e87c144 Ensure pose quaternions are normalized 2026-02-13 23:25:45 +01:00
Guillaume Meunier 66a56dac82 Work around HTC bugs 2026-02-13 17:26:53 +01:00
Guillaume Meunier 1158afdad5 Clip the imgui layers to only the useful part 2026-02-13 17:26:53 +01:00
Guillaume Meunier b5d4f67860 Put the tooltips in a different layer 2026-02-13 17:26:53 +01:00
Guillaume Meunier 067d3a7679 Store the name of custom shaders in the glTF file 2026-02-13 17:15:21 +01:00
Guillaume Meunier fc5f0b9c6c Tweak pointer appearance 2026-02-13 17:15:21 +01:00
Guillaume Meunier 17bae9459a Use custom clipping to clip controller rays 2026-02-13 17:15:21 +01:00
Guillaume Meunier b80814adb5 Fix ray brightness in stream scene 2026-02-13 17:15:21 +01:00
Guillaume Meunier bb6280a9c3 Add ray trail 2026-02-13 17:15:21 +01:00
Guillaume Meunier a1dad6962c Allow passing extra data to the vertex/fragment shader 2026-02-13 17:15:21 +01:00
Guillaume Meunier ed433905c0 Add WIVRN_DEBUG_SHADERS option 2026-02-13 17:15:21 +01:00
Patrick Nicolas 2d45d53cc7 Remove check for visualid and glxFBconfig 2026-02-13 16:31:09 +01:00
Patrick Nicolas 4cd6862c1a Remove environment variables for foveation center 2026-02-13 15:42:51 +01:00
Guillaume Meunier b34aa59876 Use inplace_vector in scene.cpp 2026-02-13 15:42:51 +01:00
Patrick Nicolas 2f54a74b05 Use inplace_vectors in stream.cpp 2026-02-13 15:42:51 +01:00
Patrick Nicolas 0b7cf25a93 Use inplace_vector for body trackers 2026-02-13 15:42:51 +01:00
Guillaume Meunier 3bbaf8b8e2 Add inplace_vector from https://github.com/bemanproject/inplace_vector, commit 72e9bab7cca228be63294823a4809723a6580716 2026-02-13 15:42:51 +01:00
Patrick Nicolas fe46fc4545 Replace some unique_ptr with optionals 2026-02-13 15:42:51 +01:00
Patrick Nicolas 5d1ba50e92 Refactor Steam libraries 2026-02-13 14:37:03 +01:00
Patrick Nicolas 74946403f0 Only read shortcuts file for current Steam user 2026-02-13 14:36:47 +01:00
Patrick Nicolas 9af70baa58 Add utility to guess Steam user ID 2026-02-13 14:36:47 +01:00
Patrick Nicolas c0a061b4be Rename wlx-overlay-s -> WayVR in metainfo 2026-02-13 09:51:35 +01:00
Vindicus999 e9af61cdb9 Merge remote-tracking branch 'upstream/master' 2026-02-13 02:38:13 +00:00
Patrick Nicolas c19056498d Switch flatpak/native recommendations, add notes 2026-02-12 12:27:28 +01:00
Patrick Nicolas 6f6ccefbf3 Move foveation config out of "if post processing" 2026-02-12 10:52:05 +01:00
Vindicus999 b4cda7975f Merge remote-tracking branch 'upstream/master' 2026-02-12 02:36:36 +00:00
Patrick Nicolas 06d771b89e Fix flickering screen after disconnect
Deleting the stream object has to be delayed until all Vulkan work is
done.
2026-02-11 23:36:17 +01:00
Patrick Nicolas 50ae773fec Don't log "error: " in mic change for no error 2026-02-11 20:40:01 +01:00
Patrick Nicolas 6cf46a6b73 Initialize view flags to 0 2026-02-11 19:38:11 +01:00
Sapphire f0e3e8d4ad Re-enable microphone on reconnect 2026-02-11 18:33:11 +01:00
Patrick Nicolas 399477edf5 Skip some memory copies in vulkan encode 2026-02-11 14:34:06 +01:00
Patrick Nicolas 0ec0de4509 Update vulkan memory allocator to 3.3.0 2026-02-11 14:34:06 +01:00
Patrick Nicolas a8657f7f91 Fix manual foveation window position 2026-02-11 12:30:56 +01:00
Sapphire 87b11d6817 Don't send empty HEAD pose on failed xrLocateSpace 2026-02-11 09:08:05 +01:00
97 changed files with 23087 additions and 21113 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Run clang-format style check for C/C++/Protobuf programs.
uses: jidicula/clang-format-action@2c659fea724e981e94741c0e7db663982cd7d3f4
uses: jidicula/clang-format-action@v4.16.0
with:
clang-format-version: '21'
check-path: ${{ matrix.path }}
+8 -3
View File
@@ -39,7 +39,12 @@ option(WIVRN_BUILD_WIVRNCTL "Build wivrnctl" ON)
option(WIVRN_BUILD_DISSECTOR "Build Wireshark dissector" OFF)
option(WIVRN_BUILD_TEST "Build test binaries" OFF)
option(WIVRN_WERROR "Treat warnings as errors" OFF)
option(WIVRN_OPTIMIZE_SHADERS "Run siprv-opt on compiled shaders" ON)
option(WIVRN_OPTIMIZE_SHADERS "Run spirv-opt on compiled shaders" ON)
option(WIVRN_DEBUG_SHADERS "Compile shaders with debug information" OFF)
if(WIVRN_OPTIMIZE_SHADERS AND WIVRN_DEBUG_SHADERS)
message(FATAL_ERROR "WIVRN_OPTIMIZE_SHADERS and WIVRN_DEBUG_SHADERS are incompatible")
endif()
option(WIVRN_USE_NVENC "Enable nvenc (Nvidia) hardware encoder" ON)
option(WIVRN_USE_VAAPI "Enable vaapi (AMD/Intel) hardware encoder" ON)
@@ -97,9 +102,9 @@ include(VulkanVersion)
if (WIVRN_USE_SYSTEM_BOOST AND NEED_COMMON)
if (WIVRN_BUILD_DISSECTOR)
find_package(Boost 1.84.0 REQUIRED COMPONENTS locale url)
find_package(Boost 1.84.0 REQUIRED COMPONENTS locale url iostreams)
else()
find_package(Boost 1.75.0 REQUIRED COMPONENTS locale url)
find_package(Boost 1.75.0 REQUIRED COMPONENTS locale url iostreams)
endif()
endif()
+11 -7
View File
@@ -38,15 +38,19 @@ WiVRn support a wide range of VR devices:
## PC Server/Dashboard
We recommend using the flatpak package from Flathub:
We recommend using native packages if available for your distribution:
- [Arch User Repository](https://aur.archlinux.org/packages/wivrn-dashboard)
- [Fedora](https://packages.fedoraproject.org/pkgs/wivrn/wivrn/)
- [Gentoo Guru](https://gitweb.gentoo.org/repo/proj/guru.git/tree/media-libs/wivrn)
- [NixOS](https://search.nixos.org/packages?channel=25.11&show=wivrn)
For OpenVR and Steam compatibility, you also need a [compatibility library](#openvr-and-steam-games) such as xrizer or OpenComposite.
A flatpak is available on Flathub for all distributions:
[![Flathub](https://flathub.org/api/badge)](https://flathub.org/apps/io.github.wivrn.wivrn)
Alternatively, packages are available from:
- [Arch User Repositoy](https://aur.archlinux.org/packages/wivrn-dashboard)
- [Fedora](https://packages.fedoraproject.org/pkgs/wivrn/wivrn/)
- [Gentoo Guru](https://gitweb.gentoo.org/repo/proj/guru.git/tree/media-libs/wivrn)
Note that due to flatpak sandboxing some features may not be available such as Lighthouse tracked devices.
## Headset Client/App
@@ -97,7 +101,7 @@ The flatpak includes [OpenComposite](https://gitlab.com/znixian/OpenOVR/) and [x
If using Wine/Proton, it will probe for OpenVR at startup, This means even for OpenXR applications, OpenComposite or xrizer is required.
When you start the server through flatpak, it automatically configures the current OpenVR to use xrizer.
When a headset connects, wivrn-server sets the OpenVR runtime to xrizer unless manually configured differently.
### Steam Flatpak
If you're using the Steam Flatpak, you'll need to grant read only access to the following paths:
Binary file not shown.
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -1340,7 +1340,7 @@ void application::initialize()
spaces[size_t(xr::spaces::view)] = xr_session.create_reference_space(XR_REFERENCE_SPACE_TYPE_VIEW);
spaces[size_t(xr::spaces::world)] = xr_session.create_reference_space(XR_REFERENCE_SPACE_TYPE_STAGE);
config.emplace(xr_system_id);
config.emplace(xr_system_id, xr_session);
// HTC face tracker fails if created later
// we can destroy it right away, it actually stores static handles
+20 -4
View File
@@ -19,6 +19,7 @@
#include "configuration.h"
#include "application.h"
#include "utils/contains.h"
#include "utils/json_string.h"
#include "wivrn_packets.h"
@@ -29,6 +30,9 @@
#include "android/permissions.h"
#endif
// If no refresh rate is configured, don't select a too high one
static const float max_default_rate = 100;
bool configuration::check_feature(feature f) const
{
{
@@ -95,7 +99,7 @@ void configuration::set_feature(feature f, bool state)
save();
}
configuration::configuration(xr::system & system)
configuration::configuration(xr::system & system, xr::session & session)
{
passthrough_enabled = system.passthrough_supported() == xr::passthrough_type::color;
features[feature::hand_tracking] = system.hand_tracking_supported();
@@ -122,6 +126,15 @@ configuration::configuration(xr::system & system)
high_power_mode = true;
break;
}
const auto & rates = session.get_refresh_rates();
for (auto rate: rates)
{
if (rate >= max_default_rate)
break;
preferred_refresh_rate = rate;
}
try
{
simdjson::dom::parser parser;
@@ -145,7 +158,11 @@ configuration::configuration(xr::system & system)
}
if (auto val = root["preferred_refresh_rate"]; val.is_double())
preferred_refresh_rate = val.get_double();
{
float f = val.get_double();
if (f == 0 or utils::contains(rates, f))
preferred_refresh_rate = f;
}
if (auto val = root["minimum_refresh_rate"]; val.is_double())
minimum_refresh_rate = val.get_double();
@@ -285,8 +302,7 @@ void configuration::save()
std::ofstream json(application::get_config_path() / "client.json");
json << "{\"servers\":[" << servers_str << "]";
if (preferred_refresh_rate)
json << ",\"preferred_refresh_rate\":" << *preferred_refresh_rate;
json << ",\"preferred_refresh_rate\":" << preferred_refresh_rate;
if (minimum_refresh_rate)
json << ",\"minimum_refresh_rate\":" << *minimum_refresh_rate;
json << ",\"resolution_scale\":" << resolution_scale;
+5 -4
View File
@@ -31,8 +31,9 @@
namespace xr
{
class session;
class system;
}
} // namespace xr
class configuration
{
@@ -48,7 +49,7 @@ public:
};
std::map<std::string, server_data> servers;
std::optional<float> preferred_refresh_rate;
float preferred_refresh_rate = 0;
std::optional<float> minimum_refresh_rate;
float resolution_scale = 1.0;
std::optional<wivrn::video_codec> codec;
@@ -76,7 +77,7 @@ public:
std::string environment_model = "assets://ground.glb";
bool override_foveation_enable = false;
float override_foveation_pitch = 10 * M_PI / 180;
float override_foveation_pitch = -10 * M_PI / 180;
float override_foveation_distance = 3;
bool high_power_mode;
@@ -99,7 +100,7 @@ private:
void parse_openxr_post_processing_options(simdjson::simdjson_result<simdjson::dom::object> root);
public:
configuration(xr::system &);
configuration(xr::system &, xr::session &);
configuration() = default;
void save();
+7 -8
View File
@@ -40,7 +40,7 @@ constexpr int font_size_large = 75;
constexpr float scroll_ratio = 10;
// Threshold on the trigger value to register a click
constexpr float trigger_click_thd = 0.8;
constexpr float trigger_click_thd = 0.7;
// Thresholds on the distance between the fingertip and GUI layers (positive: in front of the GUI, negative: behind the GUI)
constexpr float palm_distance_close_thd_lo = 0.18; // Distance to switch between touch and aim interaction
@@ -53,9 +53,8 @@ constexpr float fingertip_distance_stick_thd = -0.02; // Max distance wher
constexpr float scroll_value_thd = 0.01;
// Pointer radius
constexpr float pointer_radius_in = 10;
constexpr float pointer_radius_out = 12;
constexpr float pointer_thickness = 4;
constexpr float pointer_thickness = 2;
constexpr float pointer_radius_in = 6;
// Pointer transparency
constexpr float pointer_alpha = 0.8;
@@ -63,8 +62,7 @@ constexpr float pointer_alpha_disabled = 0.25;
constexpr float pointer_fading_distance = 40;
// Pointer color
constexpr uint32_t pointer_color_pressed = 0xffff3300;
constexpr uint32_t pointer_color_unpressed = 0xffffffff;
constexpr uint32_t pointer_color = 0x40ffffff;
constexpr uint32_t pointer_color_border = 0xff000000;
} // namespace constants::gui
@@ -110,7 +108,8 @@ constexpr int zindex_passthrough = -2;
constexpr int zindex_lobby = -1;
constexpr int zindex_gui = 0;
constexpr int zindex_controllers = 1;
constexpr int zindex_recenter_tip = 2;
constexpr int zindex_tooltip = 2;
constexpr int zindex_recenter_tip = 3;
} // namespace constants::lobby
namespace constants::stream
@@ -131,7 +130,7 @@ constexpr float window_rounding = 10;
constexpr ImVec2 tooltip_padding = {5, 5};
constexpr float tooltip_rounding = 0;
constexpr float tooltip_distance = 10;
constexpr glm::vec3 tooltip_distance = {0, 0.004, 0.005};
constexpr ImVec2 button_size = {220, 80};
constexpr ImVec2 icon_button_size = {80, 80};
+6 -2
View File
@@ -376,10 +376,10 @@ std::pair<glm::vec3, glm::quat> controller_offset(std::string_view profile, xr::
return {{0, -0.006, -0.025}, glm::angleAxis(glm::radians(-15.f), glm::vec3{1, 0, 0})};
case xr::spaces::aim_left:
return {{-0.010, 0, 0.025}, {1, 0, 0, 0}};
return {{-0.010, 0, 0.02}, {1, 0, 0, 0}};
case xr::spaces::aim_right:
return {{0.010, 0, 0.025}, {1, 0, 0, 0}};
return {{0.010, 0, 0.02}, {1, 0, 0, 0}};
default:
break;
@@ -392,6 +392,10 @@ std::pair<glm::vec3, glm::quat> controller_offset(std::string_view profile, xr::
case xr::spaces::grip_right:
return {{0, -0.010, -0.025}, glm::angleAxis(glm::radians(-12.f), glm::vec3{1, 0, 0})};
case xr::spaces::aim_left:
case xr::spaces::aim_right:
return {{0, 0, -0.03}, {1, 0, 0, 0}};
default:
break;
}
+80 -53
View File
@@ -37,6 +37,7 @@
#include <cmath>
#include <cstddef>
#include <glm/gtc/matrix_access.hpp>
#include <glm/gtc/quaternion.hpp>
#include <imgui.h>
#include <imgui_internal.h>
#include <limits>
@@ -214,7 +215,7 @@ std::vector<std::pair<ImVec2, float>> imgui_context::ray_plane_intersection(cons
for (const auto & i: layers_)
{
if (i.space != xr::spaces::world)
if (i.space != xr::spaces::world or i.tooltip_viewport)
continue;
auto M = glm::transpose(glm::mat3_cast(i.orientation)); // world-to-plane transform
@@ -633,10 +634,6 @@ std::vector<imgui_context::controller_state> imgui_context::read_controllers_sta
auto trigger = application::read_action_float(ctrl.trigger).value_or(std::pair{0, 0});
state.trigger_value = trigger.second;
// TODO tunable
/*if (new_state.trigger_value < 0.5)
new_state.trigger_clicked = false;
else */
if (state.trigger_value > constants::gui::trigger_click_thd)
state.trigger_clicked = true;
}
@@ -920,15 +917,13 @@ std::vector<std::pair<int, XrCompositionLayerQuad>> imgui_context::end_frame()
else
alpha *= constants::gui::pointer_alpha_disabled;
ImU32 color_pressed = ImGui::GetColorU32(constants::gui::pointer_color_pressed, alpha);
ImU32 color_unpressed = ImGui::GetColorU32(constants::gui::pointer_color_unpressed, alpha);
bool pressed = controller.second.trigger_clicked || controller.second.fingertip_touching;
float radius_in = constants::gui::pointer_radius_in;
float radius_out = radius_in + constants::gui::pointer_thickness * 0.5;
ImDrawList * draw_list = ImGui::GetForegroundDrawList();
draw_list->PushClipRect(clip_rect_min, clip_rect_max);
draw_list->AddCircleFilled(*position, constants::gui::pointer_radius_in, pressed ? color_pressed : color_unpressed);
draw_list->AddCircle(*position, constants::gui::pointer_radius_out, ImGui::GetColorU32(constants::gui::pointer_color_border, alpha), 0, constants::gui::pointer_thickness);
draw_list->AddCircleFilled(*position, radius_in, ImGui::GetColorU32(constants::gui::pointer_color, alpha));
draw_list->AddCircle(*position, radius_out, ImGui::GetColorU32(constants::gui::pointer_color_border, alpha), 0, constants::gui::pointer_thickness);
draw_list->PopClipRect();
}
}
@@ -983,15 +978,47 @@ std::vector<std::pair<int, XrCompositionLayerQuad>> imgui_context::end_frame()
for (auto & i: layers_)
{
bool visible = false;
ImRect layer_rect(
i.vp_origin.x,
i.vp_origin.y,
i.vp_origin.x + i.vp_size.x,
i.vp_origin.y + i.vp_size.y);
ImRect all_windows_rect{
std::numeric_limits<float>::max(),
std::numeric_limits<float>::max(),
std::numeric_limits<float>::lowest(),
std::numeric_limits<float>::lowest(),
};
for (ImGuiWindow * window: context->Windows)
{
if (window->Active and not window->Hidden and window_intersects_viewport(window, i))
ImRect window_rect{
window->Pos.x,
window->Pos.y,
window->Pos.x + window->Size.x,
window->Pos.y + window->Size.y};
if (window->Active and not window->Hidden and layer_rect.Overlaps(window_rect))
{
visible = true;
break;
// Take the union of all visible windows in this layer
all_windows_rect.Add(window_rect);
}
}
// Take the intersection with the layer
all_windows_rect.ClipWithFull(layer_rect);
glm::vec2 pixel_size = i.size / glm::vec2(i.vp_size);
glm::vec2 all_windows_center(all_windows_rect.GetCenter().x, all_windows_rect.GetCenter().y);
glm::vec2 layer_center(layer_rect.GetCenter().x, layer_rect.GetCenter().y);
glm::vec3 new_position = i.position + i.orientation * glm::vec3((all_windows_center - layer_center) * pixel_size, 0);
glm::vec2 new_size = glm::vec2(all_windows_rect.GetWidth(), all_windows_rect.GetHeight()) * pixel_size;
if (not visible)
continue;
@@ -1006,12 +1033,12 @@ std::vector<std::pair<int, XrCompositionLayerQuad>> imgui_context::end_frame()
.swapchain = swapchain,
.imageRect = {
.offset = {
.x = i.vp_origin.x,
.y = i.vp_origin.y,
.x = int(all_windows_rect.Min.x),
.y = int(all_windows_rect.Min.y),
},
.extent = {
.width = i.vp_size.x,
.height = i.vp_size.y,
.width = int(all_windows_rect.Max.x - all_windows_rect.Min.x),
.height = int(all_windows_rect.Max.y - all_windows_rect.Min.y),
}},
},
.pose = {
@@ -1022,14 +1049,14 @@ std::vector<std::pair<int, XrCompositionLayerQuad>> imgui_context::end_frame()
.w = i.orientation.w,
},
.position = {
.x = i.position.x,
.y = i.position.y,
.z = i.position.z,
.x = new_position.x,
.y = new_position.y,
.z = new_position.z,
},
},
.size = {
.width = i.size.x,
.height = i.size.y,
.width = new_size.x,
.height = new_size.y,
},
});
}
@@ -1037,11 +1064,9 @@ std::vector<std::pair<int, XrCompositionLayerQuad>> imgui_context::end_frame()
return quads;
}
std::vector<imgui_context::viewport> imgui_context::windows()
std::vector<imgui_context::window_viewport> imgui_context::windows()
{
std::vector<imgui_context::viewport> w;
ImGuiWindow * modal_popup = ImGui::GetTopMostAndVisiblePopupModal();
std::vector<imgui_context::window_viewport> w;
for (const imgui_context::viewport & layer: layers_)
{
@@ -1052,10 +1077,7 @@ std::vector<imgui_context::viewport> imgui_context::windows()
for (ImGuiWindow * window: context->Windows)
{
if (not window->Active or window->Hidden /*or window->ParentWindowInBeginStack != nullptr*/)
continue;
if (modal_popup != nullptr and window != modal_popup and not layer.always_show_cursor)
if (not window->Active or window->Hidden or (window->Flags & ImGuiWindowFlags_ChildWindow))
continue;
if (not window_intersects_viewport(window, layer))
@@ -1066,7 +1088,7 @@ std::vector<imgui_context::viewport> imgui_context::windows()
ImVec2 min = ImMax(v.Min, window->Pos);
ImVec2 center = (min + max) / 2;
w.push_back(viewport{
w.push_back(window_viewport{
.space = layer.space,
.position = layer.position +
glm::mat3_cast(layer.orientation) *
@@ -1079,9 +1101,6 @@ std::vector<imgui_context::viewport> imgui_context::windows()
(max.x - min.x) * layer.size.x / layer.vp_size.x,
(max.y - min.y) * layer.size.y / layer.vp_size.y,
},
.vp_origin = {min.x, min.y},
.vp_size = {max.x - min.x, max.y - min.y},
.always_show_cursor = layer.always_show_cursor,
});
}
}
@@ -1241,34 +1260,32 @@ void imgui_context::tooltip(std::string_view text)
// FIXME: this is incorrect if we use the docking branch of imgui
ImGuiViewport * viewport = ImGui::GetMainViewport();
auto & current_layer = layer(ImGui::GetMousePos());
auto pos_backup = viewport->Pos;
auto size_backup = viewport->Size;
viewport->Pos = ImVec2(current_layer.vp_origin.x, current_layer.vp_origin.y);
viewport->Size = ImVec2(current_layer.vp_size.x, current_layer.vp_size.y);
ImVec2 pos{
assert(std::ranges::contains(layers_, true, &viewport::tooltip_viewport));
auto & tooltip_layer = *std::ranges::find(layers_, true, &viewport::tooltip_viewport);
// Get the item position before drawing the tooltip (top center)
ImVec2 item_position{
(ImGui::GetItemRectMin().x + ImGui::GetItemRectMax().x) / 2,
ImGui::GetItemRectMin().y - constants::style::tooltip_distance,
ImGui::GetItemRectMin().y,
};
auto pos_backup = viewport->Pos;
auto size_backup = viewport->Size;
viewport->Pos = ImVec2(tooltip_layer.vp_origin.x, tooltip_layer.vp_origin.y);
viewport->Size = ImVec2(tooltip_layer.vp_size.x, tooltip_layer.vp_size.y);
// Draw the tooltip in the tooltip layer
// Clamp position to avoid overflowing on the left or the right
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, constants::style::tooltip_padding);
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, constants::style::tooltip_rounding);
// Clamp position to avoid overflowing on the left or the right
auto & style = ImGui::GetStyle();
const ImVec2 text_size = ImGui::CalcTextSize(text.data(), text.data() + text.size(), true);
const ImVec2 size = {text_size.x + style.WindowPadding.x * 2.0f, text_size.y + style.WindowPadding.y * 2.0f};
pos.x = std::clamp<float>(pos.x, viewport->Pos.x + size.x / 2, viewport->Pos.x + viewport->Size.x - size.x / 2);
ImVec2 pivot = {0.5, 1};
const ImVec2 tooltip_size = {text_size.x + style.WindowPadding.x * 2.0f, text_size.y + style.WindowPadding.y * 2.0f};
// Move tooltip below the item if it overflows on the top
if (pos.y - size.y <= viewport->Pos.y)
{
pos.y = ImGui::GetItemRectMax().y + constants::style::tooltip_distance;
pivot.y = 0;
}
ImGui::SetNextWindowPos(pos, ImGuiCond_Always, pivot);
ImGui::SetNextWindowPos(viewport->Pos + viewport->Size * 0.5, ImGuiCond_Always, {0.5, 0.5});
ImGui::SetNextWindowSizeConstraints({0, 0}, viewport->Size);
if (ImGui::BeginTooltip())
{
ImGui::PushStyleColor(ImGuiCol_Text, 0xffffffff);
@@ -1276,11 +1293,21 @@ void imgui_context::tooltip(std::string_view text)
ImGui::PopStyleColor();
ImGui::EndTooltip();
}
ImGui::PopStyleVar(2);
viewport->Pos = pos_backup;
viewport->Size = size_backup;
// Compute the tooltip position
glm::quat tooltip_orientation = current_layer.orientation;
auto M = glm::mat3_cast(tooltip_orientation);
float pixel_size = current_layer.size.y / current_layer.vp_size.y;
glm::vec3 tooltip_position_centre = rw_from_vp(item_position) + M * (glm::vec3(0, tooltip_size.y / 2, 0) * pixel_size + constants::style::tooltip_distance);
// Position the tooltip layer
tooltip_layer.position = tooltip_position_centre;
tooltip_layer.orientation = tooltip_orientation;
}
// https://github.com/ocornut/imgui/issues/3379#issuecomment-2943903877
+11 -1
View File
@@ -136,6 +136,7 @@ public:
glm::ivec2 vp_size;
bool always_show_cursor = false; // Show the cursor in this viewport even if there is a modal popup elsewhere (eg. this is a virtual keyboard)
bool tooltip_viewport = false; // Choose this viewport to display the tooltip, ignore mouse events
int z_index = 0;
@@ -145,6 +146,15 @@ public:
}
};
struct window_viewport
{
// Position of this window in the world
xr::spaces space;
glm::vec3 position;
glm::quat orientation;
glm::vec2 size;
};
private:
uint32_t queue_family_index;
@@ -215,7 +225,7 @@ public:
return layers_;
}
std::vector<viewport> windows();
std::vector<window_viewport> windows();
viewport & layer(ImVec2 position);
+18 -4
View File
@@ -19,6 +19,7 @@
#pragma once
#include <array>
#include <inplace_vector.hpp>
#include <memory>
#include <type_traits>
#include <utility>
@@ -100,7 +101,7 @@ struct material
size_t offset;
std::string name;
std::string fragment_shader_name = "lit.frag";
std::string fragment_shader = "lit.frag";
};
struct primitive
@@ -110,7 +111,7 @@ struct primitive
uint32_t vertex_count;
vk::IndexType index_type;
vk::DeviceSize index_offset;
std::vector<vk::DeviceSize> vertex_offset; // TODO: inplace_vector
beman::inplace_vector::inplace_vector<vk::DeviceSize, 8> vertex_offset; // See VkPhysicalDeviceLimits::maxVertexInputBindings
vertex_layout layout;
glm::vec3 obb_min;
@@ -155,11 +156,24 @@ struct node
bool visible = true;
uint32_t layer_mask = -1;
std::array<glm::vec4, 4> clipping_planes;
// TODO: separate component?
std::vector<std::pair<entt::entity, glm::mat4>> joints; // Node index, inverse bind matrix of each joint
std::vector<std::byte> extra_shader_data;
template <typename T>
void set_extra_shader_data(const T & data)
{
extra_shader_data.resize(sizeof(std::decay_t<T>));
memcpy(extra_shader_data.data(), &data, sizeof(std::decay_t<T>));
}
template <typename T>
T & get_extra_shader_data()
{
assert(extra_shader_data.size() == sizeof(std::decay_t<T>));
return *reinterpret_cast<T *>(extra_shader_data.data());
}
// For internal use by the renderer
glm::mat4 transform_to_root;
bool global_visible;
+40 -12
View File
@@ -45,6 +45,9 @@
#include <limits>
#include <ranges>
#include <simdjson/dom.h>
#include <simdjson/dom/element.h>
#include <simdjson/dom/object.h>
#include <simdjson/error.h>
#include <spdlog/spdlog.h>
#include <string>
#include <vulkan/vulkan_format_traits.hpp>
@@ -513,7 +516,7 @@ struct : std::error_category
} fastgltf_error_category;
// END
fastgltf::Asset load_gltf_asset(fastgltf::GltfDataBuffer & buffer, const std::filesystem::path & directory)
fastgltf::Asset load_gltf_asset(fastgltf::GltfDataBuffer & buffer, const std::filesystem::path & directory, std::function<void(simdjson::dom::object &, std::size_t, fastgltf::Category)> extra_callback)
{
fastgltf::Parser parser(
fastgltf::Extensions::KHR_texture_basisu |
@@ -524,6 +527,12 @@ fastgltf::Asset load_gltf_asset(fastgltf::GltfDataBuffer & buffer, const std::fi
fastgltf::Options::AllowDouble |
fastgltf::Options::DecomposeNodeMatrices;
parser.setUserPointer(&extra_callback);
parser.setExtrasParseCallback([](simdjson::dom::object * extras, std::size_t object_index, fastgltf::Category category, void * user_pointer) {
auto f = reinterpret_cast<std::function<void(simdjson::dom::object &, std::size_t, fastgltf::Category)> *>(user_pointer);
(*f)(*extras, object_index, category);
});
auto expected_asset = parser.loadGltf(buffer, directory, gltf_options);
if (auto error = expected_asset.error(); error != fastgltf::Error::None)
@@ -540,7 +549,8 @@ class loader_context
vk::raii::PhysicalDevice physical_device;
vk::raii::Device & device;
thread_safe<vk::raii::Queue> & queue;
image_loader & loader;
image_loader loader;
const std::map<std::tuple<fastgltf::Category, size_t, std::string>, std::string> & extras;
std::vector<utils::mapped_file> loaded_assets;
utils::mapped_file & load_from_asset(const std::filesystem::path & path)
@@ -563,14 +573,16 @@ public:
vk::raii::PhysicalDevice physical_device,
vk::raii::Device & device,
thread_safe<vk::raii::Queue> & queue,
image_loader & loader) :
uint32_t queue_family_index,
std::map<std::tuple<fastgltf::Category, size_t, std::string>, std::string> & extras) :
base_directory(std::move(base_directory)),
name(std::move(name)),
gltf(gltf),
physical_device(physical_device),
device(device),
queue(queue),
loader(loader)
loader(device, physical_device, queue, queue_family_index),
extras(extras)
{
}
@@ -793,6 +805,8 @@ public:
materials.reserve(gltf.materials.size());
for (const fastgltf::Material & gltf_material: gltf.materials)
{
size_t material_id = materials.size();
// Copy the default material, without references to its buffer or descriptor set
auto & material = *materials.emplace_back(std::make_shared<renderer::material>(default_material));
material.name = gltf_material.name;
@@ -803,21 +817,24 @@ public:
switch (gltf_material.alphaMode)
{
case fastgltf::AlphaMode::Opaque:
material.fragment_shader_name = "lit.frag";
material.fragment_shader = "lit.frag";
material.blend_enable = false;
break;
case fastgltf::AlphaMode::Mask:
material.fragment_shader_name = "lit_mask.frag";
material.fragment_shader = "lit_mask.frag";
material.blend_enable = false;
break;
case fastgltf::AlphaMode::Blend:
material.fragment_shader_name = "lit.frag";
material.fragment_shader = "lit.frag";
material.blend_enable = true;
break;
}
if (auto it = extras.find({fastgltf::Category::Materials, material_id, "fragment_shader"}); it != extras.end())
material.fragment_shader = it->second;
renderer::material::gpu_data & material_data = material.staging;
material_data.base_color_factor = convert(gltf_material.pbrData.baseColorFactor);
@@ -870,6 +887,7 @@ public:
meshes.reserve(gltf.meshes.size());
for (const fastgltf::Mesh & gltf_mesh: gltf.meshes)
{
size_t mesh_id = meshes.size();
std::shared_ptr<renderer::mesh> & mesh_ref = meshes.emplace_back();
mesh_ref = std::make_shared<renderer::mesh>();
@@ -892,7 +910,9 @@ public:
renderer::vertex_layout & layout = primitive_ref.layout;
if (gltf_primitive.findAttribute("JOINTS_0") == gltf_primitive.attributes.cend())
if (auto it = extras.find({fastgltf::Category::Meshes, mesh_id, "vertex_shader"}); it != extras.end())
primitive_ref.vertex_shader = it->second;
else if (gltf_primitive.findAttribute("JOINTS_0") == gltf_primitive.attributes.cend())
primitive_ref.vertex_shader = "lit.vert";
else
primitive_ref.vertex_shader = "lit_skinned.vert";
@@ -1007,7 +1027,6 @@ public:
node.orientation = glm::make_quat(TRS.rotation.data());
node.scale = glm::make_vec3(TRS.scale.data());
node.visible = true;
std::ranges::fill(node.clipping_planes, glm::vec4{0, 0, 0, 1});
}
return entities;
@@ -1148,10 +1167,19 @@ std::shared_ptr<entt::registry> scene_loader::operator()(
if (auto error = data_buffer.error(); error != fastgltf::Error::None)
throw std::system_error((int)error, fastgltf_error_category);
fastgltf::Asset asset = load_gltf_asset(data_buffer.get(), parent_path);
std::map<std::tuple<fastgltf::Category, size_t, std::string>, std::string> gltf_extras;
image_loader loader{device, physical_device, queue, queue_family_index};
loader_context ctx{parent_path, name, asset, physical_device, device, queue, loader};
fastgltf::Asset asset = load_gltf_asset(data_buffer.get(), parent_path, [&](simdjson::dom::object & extras, std::size_t object_index, fastgltf::Category category) {
std::string_view value;
for (const auto & kv: extras)
{
if (kv.value.get_string().get(value) == simdjson::SUCCESS)
gltf_extras.emplace(std::tuple{category, object_index, kv.key}, value);
}
});
loader_context ctx{parent_path, name, asset, physical_device, device, queue, queue_family_index, gltf_extras};
#ifndef NDEBUG
if (auto error = fastgltf::validate(asset); error != fastgltf::Error::None)
+12 -7
View File
@@ -29,6 +29,7 @@
#include "vk/pipeline.h"
#include "vk/shader.h"
#include "vk/specialization_constants.h"
#include <algorithm>
#include <boost/pfr/core.hpp>
#include <entt/entity/entity.hpp>
#include <entt/entt.hpp>
@@ -675,8 +676,8 @@ vk::raii::Pipeline scene_renderer::create_pipeline(const pipeline_info & info)
{
spdlog::debug("Creating pipeline");
auto vertex_shader = shader_loader{device}(info.vertex_shader_name);
auto fragment_shader = shader_loader{device}(info.fragment_shader_name);
auto vertex_shader = load_shader(device, info.vertex_shader_name);
auto fragment_shader = load_shader(device, info.fragment_shader_name);
auto specialization = make_specialization_constants(
int32_t(info.nb_texcoords),
@@ -732,7 +733,7 @@ vk::raii::Pipeline scene_renderer::create_pipeline(const pipeline_info & info)
.ColorBlendState = {vk::PipelineColorBlendStateCreateInfo{}},
.ColorBlendAttachments = {vk::PipelineColorBlendAttachmentState{
.blendEnable = info.blend_enable,
.srcColorBlendFactor = vk::BlendFactor::eSrcAlpha,
.srcColorBlendFactor = vk::BlendFactor::eOne,
.dstColorBlendFactor = vk::BlendFactor::eOneMinusSrcAlpha,
.colorBlendOp = vk::BlendOp::eAdd,
.srcAlphaBlendFactor = vk::BlendFactor::eOne,
@@ -1106,8 +1107,12 @@ void scene_renderer::render(
// TODO: reuse the UBO if another primitive of the same mesh has already been drawn
vk::DeviceSize instance_ubo_offset = resources.uniform_buffer_offset;
vk::DeviceSize instance_ubo_size = sizeof(instance_gpu_data) + node.extra_shader_data.size();
instance_gpu_data & object_ubo = *reinterpret_cast<instance_gpu_data *>(ubo + resources.uniform_buffer_offset);
resources.uniform_buffer_offset += utils::align_up(buffer_alignment, sizeof(instance_gpu_data));
std::span<std::byte> extra_shader_data{reinterpret_cast<std::byte *>(ubo + resources.uniform_buffer_offset + sizeof(instance_gpu_data)), node.extra_shader_data.size()};
resources.uniform_buffer_offset += utils::align_up(buffer_alignment, sizeof(instance_gpu_data) + node.extra_shader_data.size());
vk::DeviceSize joints_ubo_offset = 0;
if (!node.joints.empty())
@@ -1130,7 +1135,7 @@ void scene_renderer::render(
object_ubo.modelview[frame_index] = frame.view * transform;
object_ubo.modelviewproj[frame_index] = viewproj[frame_index] * transform;
}
object_ubo.clipping_planes = node.clipping_planes;
std::ranges::copy(node.extra_shader_data, extra_shader_data.begin());
// Get the material
std::shared_ptr<renderer::material> material = primitive.material_ ? primitive.material_ : default_material;
@@ -1139,7 +1144,7 @@ void scene_renderer::render(
pipeline_info info{
.renderpass = rp_info,
.vertex_shader_name = primitive.vertex_shader,
.fragment_shader_name = material->fragment_shader_name,
.fragment_shader_name = material->fragment_shader,
.vertex_layout = primitive.layout,
.cull_mode = primitive.cull_mode,
.front_face = primitive.front_face,
@@ -1187,7 +1192,7 @@ void scene_renderer::render(
vk::DescriptorBufferInfo buffer_info_2{
.buffer = resources.uniform_buffer,
.offset = instance_ubo_offset,
.range = sizeof(instance_gpu_data),
.range = instance_ubo_size,
};
vk::DescriptorBufferInfo buffer_info_3{
.buffer = resources.uniform_buffer,
-1
View File
@@ -199,7 +199,6 @@ class scene_renderer
glm::mat4 model;
std::array<glm::mat4, 2> modelview;
std::array<glm::mat4, 2> modelviewproj;
std::array<glm::vec4, 4> clipping_planes;
};
struct debug_draw_vertex
+10 -16
View File
@@ -158,16 +158,10 @@ void scene::render_world(
const std::optional<xr::foveation_profile> & foveation,
bool render_debug_draws)
{
std::vector<scene_renderer::frame_info> frames;
frames.reserve(views.size());
// TODO inplace vector
std::vector<XrCompositionLayerProjectionView> composition_layer_color;
std::vector<XrCompositionLayerDepthInfoKHR> composition_layer_depth;
composition_layer_color.reserve(views.size());
if (keep_depth_buffer)
composition_layer_depth.reserve(views.size());
assert(views.size() <= layer::max_views);
beman::inplace_vector::inplace_vector<scene_renderer::frame_info, layer::max_views> frames;
beman::inplace_vector::inplace_vector<XrCompositionLayerProjectionView, layer::max_views> composition_layer_color;
beman::inplace_vector::inplace_vector<XrCompositionLayerDepthInfoKHR, layer::max_views> composition_layer_depth;
auto [color_swapchain, color_image, foveation_image] = [&]() -> std::tuple<XrSwapchain, vk::Image, vk::Image> {
xr::swapchain & color_swapchain = get_swapchain(swapchain_format, width, height, 1, views.size(), foveation);
@@ -253,8 +247,8 @@ void scene::render_world(
add_projection_layer(
XR_COMPOSITION_LAYER_BLEND_TEXTURE_SOURCE_ALPHA_BIT,
space,
std::move(composition_layer_color),
std::move(composition_layer_depth));
composition_layer_color,
composition_layer_depth);
}
xr::swapchain & scene::get_swapchain(vk::Format format, int32_t width, int32_t height, int sample_count, uint32_t array_size, const std::optional<xr::foveation_profile> & foveation)
@@ -377,8 +371,8 @@ void scene::render_start(bool passthrough, XrTime predicted_display_time_)
void scene::add_projection_layer(
XrCompositionLayerFlags flags,
XrSpace space,
std::vector<XrCompositionLayerProjectionView> && color_views,
std::vector<XrCompositionLayerDepthInfoKHR> && depth_views)
std::span<XrCompositionLayerProjectionView> color_views,
std::span<XrCompositionLayerDepthInfoKHR> depth_views)
{
layers.push_back(layer{
.composition_layer = XrCompositionLayerProjection{
@@ -389,8 +383,8 @@ void scene::add_projection_layer(
.viewCount = (uint32_t)color_views.size(),
.views = nullptr,
},
.color_views = std::move(color_views),
.depth_views = std::move(depth_views),
.color_views{color_views.begin(), color_views.end()},
.depth_views{depth_views.begin(), depth_views.end()},
});
}
+7 -5
View File
@@ -29,6 +29,7 @@
#include "xr/session.h"
#include "xr/swapchain.h"
#include "xr/system.h"
#include <inplace_vector.hpp>
#include <cstdint>
#include <entt/entity/registry.hpp>
@@ -132,11 +133,12 @@ protected:
struct layer
{
static const int max_views = 2;
std::variant<XrCompositionLayerProjection, XrCompositionLayerQuad, XrCompositionLayerBaseHeader *> composition_layer;
// TODO in place vectors
std::vector<XrCompositionLayerProjectionView> color_views; // Used by XrCompositionLayerProjection
std::vector<XrCompositionLayerDepthInfoKHR> depth_views; // Used by XrCompositionLayerProjection
beman::inplace_vector::inplace_vector<XrCompositionLayerProjectionView, max_views> color_views; // Used by XrCompositionLayerProjection
beman::inplace_vector::inplace_vector<XrCompositionLayerDepthInfoKHR, max_views> depth_views; // Used by XrCompositionLayerProjection
std::optional<XrCompositionLayerColorScaleBiasKHR> color_scale_bias;
std::optional<XrCompositionLayerDepthTestFB> depth_test;
@@ -172,8 +174,8 @@ protected:
void add_projection_layer(
XrCompositionLayerFlags flags,
XrSpace space,
std::vector<XrCompositionLayerProjectionView> && color_views,
std::vector<XrCompositionLayerDepthInfoKHR> && depth_views = {});
std::span<XrCompositionLayerProjectionView> color_views,
std::span<XrCompositionLayerDepthInfoKHR> depth_views = {});
void add_quad_layer(
XrCompositionLayerFlags flags,
+86 -54
View File
@@ -23,6 +23,8 @@
#include "render/scene_components.h"
#include "utils/mapped_file.h"
#include "xr/space.h"
#include <array>
#include <entt/entity/fwd.hpp>
#include <entt/entt.hpp>
#include <glm/gtc/matrix_access.hpp>
#include <glm/gtc/quaternion.hpp>
@@ -33,6 +35,7 @@
#include <string>
#include <unordered_map>
#include <variant>
#include <openxr/openxr.h>
namespace components
{
@@ -62,17 +65,27 @@ struct visual_response
details::node_state state;
};
} // namespace components
namespace
{
// Component added to nodes bound to an action space
struct bound_space
{
xr::spaces space;
XrDuration Δt;
};
// Component added to node clipped by the GUI
struct clipped_by_gui
{
};
struct emissive_trigger
{
XrAction action;
};
} // namespace components
namespace
{
// clang-format off
const std::unordered_map<std::string, std::string> input_mappings = {
{"xr-standard-squeeze" , "/input/squeeze/value" },
@@ -171,9 +184,21 @@ struct json_visual_response
// OpenXR component path
std::string component_subpath;
};
struct ray_extra_shader_data
{
std::array<glm::mat4, 4> window_to_world;
float emissive_factor;
};
void setup_ray_shader(entt::registry & scene, entt::entity entity, const ray_extra_shader_data & initial_data = {})
{
auto & node = scene.get<components::node>(entity);
node.set_extra_shader_data(initial_data);
}
} // namespace
input_profile::input_profile(scene & scene, const std::filesystem::path & json_profile, uint32_t layer_mask_controller, uint32_t layer_mask_ray)
input_profile::input_profile(scene & scene, const std::filesystem::path & json_profile, uint32_t layer_mask_controller, uint32_t layer_mask_ray, XrAction left_trigger, XrAction right_trigger)
{
utils::mapped_file json{json_profile};
@@ -266,7 +291,7 @@ input_profile::input_profile(scene & scene, const std::filesystem::path & json_p
auto [e, node] = scene.add_gltf(model, layer_mask_controller);
node.name = layout;
entity = e;
scene.world.emplace<bound_space>(e, space);
scene.world.emplace<components::bound_space>(e, space, 0);
spdlog::debug("Created entity {}", layout);
}
@@ -281,16 +306,32 @@ input_profile::input_profile(scene & scene, const std::filesystem::path & json_p
else
continue;
auto && [entity, node] = scene.add_gltf(controller_ray_model_name(), layer_mask_ray);
node.name = (std::string)layout.key + "_ray";
spdlog::debug("Created entity {}", node.name);
auto && [ray_entity, ray_node] = scene.add_gltf(controller_ray_model_name(), layer_mask_ray);
scene.world.emplace<bound_space>(entity, space);
ray_node.name = (std::string)layout.key + "_ray";
spdlog::debug("Created entity {}", ray_node.name);
if (layout.key == "left")
left_ray = entity;
else if (layout.key == "right")
right_ray = entity;
scene.world.emplace<components::bound_space>(find_node_by_name(scene.world, "Ray", ray_entity), space, 0);
scene.world.emplace<components::clipped_by_gui>(find_node_by_name(scene.world, "Ray", ray_entity));
scene.world.emplace<components::emissive_trigger>(find_node_by_name(scene.world, "Ray", ray_entity), layout.key == "left" ? left_trigger : right_trigger);
setup_ray_shader(scene.world, find_node_by_name(scene.world, "Ray", ray_entity));
try
{
// These nodes don't exist in the HTC version
scene.world.emplace<components::bound_space>(find_node_by_name(scene.world, "Trail", ray_entity), space, 0);
scene.world.emplace<components::bound_space>(find_node_by_name(scene.world, "Trail now", ray_entity), space, 0);
scene.world.emplace<components::bound_space>(find_node_by_name(scene.world, "Trail -10ms", ray_entity), space, -10'000'000);
scene.world.emplace<components::bound_space>(find_node_by_name(scene.world, "Trail -20ms", ray_entity), space, -20'000'000);
scene.world.emplace<components::bound_space>(find_node_by_name(scene.world, "Trail -30ms", ray_entity), space, -30'000'000);
scene.world.emplace<components::bound_space>(find_node_by_name(scene.world, "Trail -40ms", ray_entity), space, -40'000'000);
scene.world.emplace<components::clipped_by_gui>(find_node_by_name(scene.world, "Trail", ray_entity));
scene.world.emplace<components::emissive_trigger>(find_node_by_name(scene.world, "Trail", ray_entity), layout.key == "left" ? left_trigger : right_trigger);
setup_ray_shader(scene.world, find_node_by_name(scene.world, "Trail", ray_entity));
}
catch (...)
{
}
}
for (auto & json_response: json_responses)
@@ -362,41 +403,6 @@ static void apply_visual_response(components::node & node, components::details::
node.visible = value > 0.5;
}
static void set_clipping_planes(entt::registry & scene, entt::entity entity, std::span<glm::vec4> clipping_planes)
{
// If the ray starts on the wrong side of the GUI, hide it entirely
// This assumes the node is a child of the root node
components::node & node = scene.get<components::node>(entity);
for (glm::vec4 & plane: clipping_planes)
{
if (glm::dot(plane, glm::vec4(node.position, 1)) < 0)
{
scene.get<components::node>(entity).visible = false;
return;
}
}
// Apply the clipping planes on direct children of the target entity
for (auto && [child_entity, child_node]: scene.view<components::node>().each())
{
if (child_node.parent == entity)
{
size_t nb_clipping_planes = std::min(child_node.clipping_planes.size(), clipping_planes.size());
auto copy_results = std::ranges::copy_n(
clipping_planes.begin(),
nb_clipping_planes,
child_node.clipping_planes.begin());
// Disable the remaining clipping planes
std::ranges::fill_n(
copy_results.out,
child_node.clipping_planes.size() - nb_clipping_planes,
glm::vec4(0, 0, 0, 1));
}
}
}
void input_profile::apply(
entt::registry & scene,
XrSpace world_space,
@@ -405,9 +411,9 @@ void input_profile::apply(
bool hide_left_ray,
bool hide_right_controller,
bool hide_right_ray,
std::span<glm::vec4> pointer_limits)
std::span<glm::mat4> world_to_window)
{
for (auto && [entity, node, space]: scene.view<components::node, bound_space>().each())
for (auto && [entity, node, space]: scene.view<components::node, components::bound_space>().each())
{
if ((space.space == xr::spaces::grip_left and hide_left_controller) or
(space.space == xr::spaces::aim_left and hide_left_ray) or
@@ -416,7 +422,7 @@ void input_profile::apply(
{
node.visible = false;
}
else if (auto location = application::locate_controller(application::space(space.space), world_space, predicted_display_time); location)
else if (auto location = application::locate_controller(application::space(space.space), world_space, predicted_display_time + space.Δt); location)
{
node.visible = true;
@@ -495,6 +501,32 @@ void input_profile::apply(
}
}
set_clipping_planes(scene, left_ray, pointer_limits);
set_clipping_planes(scene, right_ray, pointer_limits);
for (auto && [entity, node, response]: scene.view<components::node, components::emissive_trigger>().each())
{
if (not response.action)
continue;
if (auto opt_value = application::read_action_float(response.action))
{
float value = opt_value->second * 0.9 + 0.1;
node.set_extra_shader_data(ray_extra_shader_data{{}, value});
}
}
for (auto && [entity, node]: scene.view<components::node, components::clipped_by_gui>().each())
{
auto & data = node.get_extra_shader_data<ray_extra_shader_data>();
size_t nb_windows = std::min(data.window_to_world.size(), world_to_window.size());
auto copy_results = std::ranges::copy_n(
world_to_window.begin(),
nb_windows,
data.window_to_world.begin());
// Disable the remaining clipping planes
std::ranges::fill_n(
copy_results.out,
data.window_to_world.size() - nb_windows,
glm::mat4{/* TODO */});
}
}
+2 -2
View File
@@ -37,7 +37,7 @@ struct input_profile
magic_enum::containers::array<xr::spaces, std::pair<glm::vec3, glm::quat>> offset;
input_profile(scene & scene, const std::filesystem::path & json_profile, uint32_t layer_mask_controller, uint32_t layer_mask_ray);
input_profile(scene & scene, const std::filesystem::path & json_profile, uint32_t layer_mask_controller, uint32_t layer_mask_ray, XrAction left_trigger = XR_NULL_HANDLE, XrAction right_trigger = XR_NULL_HANDLE);
// application::poll_actions() must have been called before
void apply(
@@ -48,5 +48,5 @@ struct input_profile
bool hide_left_ray,
bool hide_right_controller,
bool hide_right_ray,
std::span<glm::vec4> pointer_limits);
std::span<glm::mat4> world_to_window);
};
+21 -31
View File
@@ -626,28 +626,7 @@ std::optional<glm::vec3> scenes::lobby::check_recenter_gui(glm::vec3 head_positi
return std::nullopt;
}
// Return the vector v such that dot(v, x) > 0 iff x is on the side where the composition layer is visible
static glm::vec4 compute_ray_limits(const XrPosef & pose, float margin = 0)
{
glm::quat q{
pose.orientation.w,
pose.orientation.x,
pose.orientation.y,
pose.orientation.z,
};
glm::vec3 p{
pose.position.x,
pose.position.y,
pose.position.z,
};
glm::vec3 normal = glm::column(glm::mat3_cast(q), 2);
return glm::vec4(normal, -glm::dot(p, normal) - margin);
}
static void stick_finger_to_gui(std::array<xr::hand_tracker::joint, XR_HAND_JOINT_COUNT_EXT> & hand, const std::vector<imgui_context::viewport> & layers)
static void stick_finger_to_gui(std::array<xr::hand_tracker::joint, XR_HAND_JOINT_COUNT_EXT> & hand, const std::vector<imgui_context::window_viewport> & layers)
{
// Move XR_HAND_JOINT_INDEX_{TIP,DISTAL,INTERMEDIATE,PROXIMAL}_EXT so that:
// - Only the X rotation changes for distal and intermediate (relative to the parent bone)
@@ -667,7 +646,7 @@ static void stick_finger_to_gui(std::array<xr::hand_tracker::joint, XR_HAND_JOIN
// Compute the target position of the tip
std::vector<std::pair<glm::vec3, float>> intersections; // Target position of the finger tip, distance to the GUI plane
for (const imgui_context::viewport & layer: layers)
for (const imgui_context::window_viewport & layer: layers)
{
// Ignore layers that are not absolutely positionned
if (layer.space != xr::spaces::world)
@@ -1054,11 +1033,11 @@ void scenes::lobby::render(const XrFrameState & frame_state)
#endif
// Get the planes that limit the ray size from the composition layers
std::vector<glm::vec4> ray_limits;
for (auto & [z_index, layer]: imgui_layers)
std::vector<glm::mat4> world_to_window;
for (auto & window: imgui_ctx->windows())
{
if (z_index != constants::lobby::zindex_recenter_tip)
ray_limits.push_back(compute_ray_limits(layer.pose));
if (window.space == xr::spaces::world)
world_to_window.push_back(glm::inverse(glm::translate(window.position) * glm::mat4(glm::mat3_cast(window.orientation)) * glm::scale(glm::vec3(window.size, 1))));
}
input->apply(world,
@@ -1068,7 +1047,7 @@ void scenes::lobby::render(const XrFrameState & frame_state)
not imgui_ctx->is_aim_interaction()[0],
hide_right_controller,
not imgui_ctx->is_aim_interaction()[1],
ray_limits);
world_to_window);
renderer::animate(world, frame_state.predictedDisplayPeriod * 1.0e-9);
@@ -1168,7 +1147,9 @@ void scenes::lobby::on_focused()
*this,
"assets://controllers/" + profile + "/profile.json",
layer_controllers,
layer_rays);
layer_rays,
get_action("left_trigger").first,
get_action("right_trigger").first);
spdlog::info("Loaded input profile {}", input->id);
@@ -1264,7 +1245,17 @@ void scenes::lobby::on_focused()
.vp_origin = {0, 1000},
.vp_size = {1500, 300},
.z_index = constants::lobby::zindex_recenter_tip,
}};
},
{
// Tooltip
.space = xr::spaces::world,
.size = {0.6, 0.08},
.vp_origin = {0, 1300},
.vp_size = {1500, 200},
.tooltip_viewport = true,
.z_index = constants::lobby::zindex_tooltip,
},
};
xr::swapchain swapchain_imgui(instance, session, device, swapchain_format, 3000, 1500);
@@ -1338,7 +1329,6 @@ void scenes::lobby::on_focused()
std::ranges::sort(local_environments, std::less{});
setup_passthrough();
session.set_refresh_rate(application::get_config().preferred_refresh_rate.value_or(0));
multicast = application::get_wifi_lock().get_multicast_lock();
session.set_performance_level(XR_PERF_SETTINGS_DOMAIN_CPU_EXT, XR_PERF_SETTINGS_LEVEL_SUSTAINED_HIGH_EXT);
+6 -6
View File
@@ -257,7 +257,7 @@ void scenes::lobby::gui_connected(XrTime predicted_display_time)
if (next_scene->apps.draw_gui(*imgui_ctx, _("Disconnect")) == app_launcher::Cancel)
{
next_scene.reset();
next_scene->exit();
current_tab = tab::server_list;
}
}
@@ -576,10 +576,10 @@ void scenes::lobby::gui_settings()
const auto & refresh_rates = session.get_refresh_rates();
if (not refresh_rates.empty())
{
float active_rate = config.preferred_refresh_rate.value_or(refresh_rates.back());
float active_rate = config.preferred_refresh_rate;
if (ImGui::BeginCombo(_S("Refresh rate"), active_rate ? fmt::format("{}", active_rate).c_str() : _cS("automatic refresh rate", "Automatic")))
{
if (ImGui::Selectable(_cS("automatic refresh rate", "Automatic"), config.preferred_refresh_rate == 0, ImGuiSelectableFlags_SelectOnRelease))
if (ImGui::Selectable(_cS("automatic refresh rate", "Automatic"), active_rate == 0, ImGuiSelectableFlags_SelectOnRelease))
{
session.set_refresh_rate(0);
config.preferred_refresh_rate = 0;
@@ -589,7 +589,7 @@ void scenes::lobby::gui_settings()
imgui_ctx->tooltip(_("Select refresh rate based on measured application performance.\nMay cause flicker when a change happens."));
for (float rate: refresh_rates)
{
if (ImGui::Selectable(fmt::format("{}", rate).c_str(), rate == config.preferred_refresh_rate, ImGuiSelectableFlags_SelectOnRelease))
if (ImGui::Selectable(fmt::format("{}", rate).c_str(), rate == active_rate, ImGuiSelectableFlags_SelectOnRelease))
{
session.set_refresh_rate(rate);
config.preferred_refresh_rate = rate;
@@ -600,7 +600,7 @@ void scenes::lobby::gui_settings()
}
imgui_ctx->vibrate_on_hover();
if (config.preferred_refresh_rate == 0 and refresh_rates.size() > 2)
if (active_rate == 0 and refresh_rates.size() > 2)
{
float min_rate = config.minimum_refresh_rate.value_or(refresh_rates.front());
if (ImGui::BeginCombo(_S("Minimum refresh rate"), fmt::format("{}", min_rate).c_str()))
@@ -1034,7 +1034,7 @@ void scenes::lobby::gui_debug_node_hierarchy(entt::entity root)
primitive.vertex_count,
primitive.material_->name,
primitive.vertex_shader,
primitive.material_->fragment_shader_name);
primitive.material_->fragment_shader);
imgui_ctx->tooltip(tooltip);
}
+35 -37
View File
@@ -34,8 +34,8 @@
#include "boost/pfr/core.hpp"
#include "decoder/shard_accumulator.h"
#include "hardware.h"
#include "inplace_vector.hpp"
#include "spdlog/spdlog.h"
#include "utils/contains.h"
#include "utils/named_thread.h"
#include "utils/ranges.h"
#include "wivrn_packets.h"
@@ -51,6 +51,7 @@
#endif
using namespace wivrn;
using namespace beman::inplace_vector;
// clang-format off
static const std::unordered_map<std::string, device_id> device_ids = {
@@ -231,20 +232,8 @@ std::shared_ptr<scenes::stream> scenes::stream::create(std::unique_ptr<wivrn_ses
if (self->instance.has_extension(XR_FB_DISPLAY_REFRESH_RATE_EXTENSION_NAME))
{
info.available_refresh_rates = self->session.get_refresh_rates();
// I can't find anything in specification the ensures it won't be empty
if (not info.available_refresh_rates.empty())
{
if (config.preferred_refresh_rate and (config.preferred_refresh_rate == 0 or utils::contains(info.available_refresh_rates, *config.preferred_refresh_rate)))
{
info.settings.preferred_refresh_rate = *config.preferred_refresh_rate;
info.settings.minimum_refresh_rate = config.minimum_refresh_rate.value_or(0);
}
else
{
// Default to highest refresh rate
info.settings.preferred_refresh_rate = info.available_refresh_rates.back();
}
}
info.settings.preferred_refresh_rate = config.preferred_refresh_rate;
info.settings.minimum_refresh_rate = config.minimum_refresh_rate.value_or(0);
}
if (info.available_refresh_rates.empty())
@@ -428,7 +417,9 @@ void scenes::stream::on_focused()
*this,
"assets://controllers/" + profile + "/profile.json",
layer_controllers,
layer_rays);
layer_rays,
get_action("left_trigger").first,
get_action("right_trigger").first);
spdlog::info("Loaded input profile {}", input->id);
@@ -472,14 +463,23 @@ void scenes::stream::on_focused()
device,
swapchain_format,
1800,
1000);
1200);
imgui_context::viewport vp{
.space = xr::spaces::world,
// Position and orientation are set at each frame
.size = {1.2, 0.6666},
.vp_origin = {0, 0},
.vp_size = {1800, 1000},
std::vector<imgui_context::viewport> vps{
{
.space = xr::spaces::world,
// Position and orientation are set at each frame
.size = {1.2, 0.6666},
.vp_origin = {0, 0},
.vp_size = {1800, 1000},
},
{
.space = xr::spaces::world,
.size = {1.2, 0.1333},
.vp_origin = {0, 1000},
.vp_size = {1800, 200},
.tooltip_viewport = true,
},
};
imgui_ctx.emplace(physical_device,
@@ -488,7 +488,7 @@ void scenes::stream::on_focused()
queue,
imgui_inputs,
std::move(swapchain_imgui),
std::vector{vp},
std::move(vps),
image_cache);
if (application::get_config().enable_stream_gui)
@@ -588,8 +588,7 @@ std::array<std::shared_ptr<shard_accumulator::blit_handle>, 3> scenes::stream::c
if (decoders.empty())
return {};
std::unique_lock lock(frames_mutex);
thread_local std::vector<shard_accumulator::blit_handle *> common_frames;
common_frames.clear();
inplace_vector<shard_accumulator::blit_handle *, decoder_count> common_frames;
const bool alpha = decoders[0].latest_frames[0] and decoders[0].latest_frames[0]->view_info.alpha;
for (size_t i = 0; i < view_count + alpha; ++i)
{
@@ -602,7 +601,7 @@ std::array<std::shared_ptr<shard_accumulator::blit_handle>, 3> scenes::stream::c
else
{
// clang-format off
std::erase_if(common_frames,
erase_if(common_frames,
[this, i](auto & left)
{
return std::ranges::none_of(
@@ -615,7 +614,7 @@ std::array<std::shared_ptr<shard_accumulator::blit_handle>, 3> scenes::stream::c
// clang-format on
}
}
std::array<std::shared_ptr<shard_accumulator::blit_handle>, view_count + 1> result;
std::array<std::shared_ptr<shard_accumulator::blit_handle>, decoder_count> result;
if (not common_frames.empty())
{
auto min = std::ranges::min_element(common_frames,
@@ -769,7 +768,7 @@ void scenes::stream::render(const XrFrameState & frame_state)
last_display_time = frame_state.predictedDisplayTime;
std::shared_lock lock(decoder_mutex);
if (not frame_state.shouldRender or (decoders[0].empty() and decoders[1].empty()))
if (not frame_state.shouldRender or (decoders[0].empty() and decoders[1].empty()) or exiting)
{
// TODO: stop/restart video stream
session.begin_frame();
@@ -958,9 +957,9 @@ void scenes::stream::render(const XrFrameState & frame_state)
vk::SubmitInfo submit_info;
submit_info.setCommandBuffers(*command_buffer);
std::vector<vk::Semaphore> semaphores;
std::vector<uint64_t> semaphore_vals;
std::vector<vk::PipelineStageFlags> wait_stages;
inplace_vector<vk::Semaphore, decoder_count> semaphores;
inplace_vector<uint64_t, decoder_count> semaphore_vals;
inplace_vector<vk::PipelineStageFlags, decoder_count> wait_stages;
for (auto b: current_blit_handles)
{
if (b and b->semaphore)
@@ -985,8 +984,6 @@ void scenes::stream::render(const XrFrameState & frame_state)
#endif
swapchain.release();
std::vector<XrCompositionLayerProjectionView> layer_view(view_count);
if (use_alpha)
session.enable_passthrough(system);
else
@@ -995,6 +992,7 @@ void scenes::stream::render(const XrFrameState & frame_state)
render_start(use_alpha, frame_state.predictedDisplayTime);
// Add the layer with the streamed content
std::array<XrCompositionLayerProjectionView, view_count> layer_view;
for (uint32_t view = 0; view < view_count; view++)
{
layer_view[view] =
@@ -1016,7 +1014,7 @@ void scenes::stream::render(const XrFrameState & frame_state)
add_projection_layer(
XR_COMPOSITION_LAYER_BLEND_TEXTURE_SOURCE_ALPHA_BIT,
application::space(xr::spaces::world),
std::move(layer_view));
layer_view);
if (composition_layer_color_scale_bias_supported)
{
@@ -1069,8 +1067,8 @@ void scenes::stream::render(const XrFrameState & frame_state)
// Network operations may be blocking, do them once everything was submitted
{
// Keep a copy of the feedback packets as they can be modified if they're encrypted
std::vector<from_headset::feedback> feedbacks;
std::vector<serialization_packet> packets;
inplace_vector<from_headset::feedback, decoder_count> feedbacks;
inplace_vector<serialization_packet, decoder_count> packets;
feedbacks.reserve(current_blit_handles.size());
packets.reserve(current_blit_handles.size());
+8 -5
View File
@@ -53,6 +53,7 @@ public:
private:
static const size_t view_count = 2;
static const size_t decoder_count = view_count + 1;
struct accumulator_images
{
@@ -68,7 +69,7 @@ private:
// for frames inside accumulator images
std::mutex frames_mutex;
std::array<std::shared_ptr<wivrn::shard_accumulator::blit_handle>, view_count + 1> common_frame(XrTime display_time);
std::array<std::shared_ptr<wivrn::shard_accumulator::blit_handle>, decoder_count> common_frame(XrTime display_time);
std::unique_ptr<wivrn_session> network_session;
std::atomic<bool> exiting = false;
@@ -76,6 +77,7 @@ private:
thread_safe<to_headset::tracking_control> tracking_control{};
std::array<std::atomic<interaction_profile>, 2> interaction_profiles; // left and right hand
std::atomic<bool> interaction_profile_changed = false;
std::atomic<XrTime> scheduled_derived_pose = 0; // Tracking thread will compute derived pose when time is reached
std::atomic<bool> recenter_requested = false;
std::atomic<bool> hid_forwarding = false;
std::atomic<XrDuration> display_time_phase = 0;
@@ -86,7 +88,7 @@ private:
std::shared_mutex decoder_mutex;
std::optional<to_headset::video_stream_description> video_stream_description;
std::array<accumulator_images, view_count + 1> decoders; // Locked by decoder_mutex
std::array<accumulator_images, decoder_count> decoders; // Locked by decoder_mutex
std::optional<stream_defoveator> defoveator;
@@ -162,7 +164,7 @@ private:
void update_gui_position(xr::spaces controller);
// Keep a reference to the resources needed to blit the images until vkWaitForFences
std::array<std::shared_ptr<wivrn::shard_accumulator::blit_handle>, view_count + 1> current_blit_handles;
std::array<std::shared_ptr<wivrn::shard_accumulator::blit_handle>, decoder_count> current_blit_handles;
XrTime running_application_req = 0;
thread_safe<to_headset::running_applications> running_applications;
@@ -218,6 +220,7 @@ public:
return state_;
}
void exit();
bool alive() const
{
return !exiting;
@@ -233,10 +236,10 @@ private:
void read_actions();
void on_interaction_profile_changed(const XrEventDataInteractionProfileChanged &);
void send_derived_pose();
void setup(const to_headset::video_stream_description &);
void setup_reprojection_swapchain(uint32_t width, uint32_t height);
void exit();
vk::raii::QueryPool query_pool = nullptr;
bool query_pool_filled = false;
@@ -302,7 +305,7 @@ private:
float compact_cpu_time = 0;
float compact_gpu_time = 0;
void accumulate_metrics(XrTime predicted_display_time, const std::array<std::shared_ptr<wivrn::shard_accumulator::blit_handle>, view_count + 1> & blit_handles, const gpu_timestamps & timestamps);
void accumulate_metrics(XrTime predicted_display_time, const std::array<std::shared_ptr<wivrn::shard_accumulator::blit_handle>, decoder_count> & blit_handles, const gpu_timestamps & timestamps);
void gui_performance_metrics();
void gui_compact_view();
void gui_settings(float predicted_display_period);
+70 -86
View File
@@ -26,12 +26,13 @@
#include "imgui.h"
#include "imgui_internal.h"
#include "implot.h"
#include "utils/contains.h"
#include "utils/i18n.h"
#include "utils/ranges.h"
#include <IconsFontAwesome6.h>
#include <chrono>
#include <cmath>
#include <glm/ext.hpp>
#include <glm/ext/matrix_transform.hpp>
#include <glm/gtc/matrix_access.hpp>
#include <limits>
#include <ranges>
@@ -382,9 +383,9 @@ static void send_settings_changed_packet(xr::session & session, wivrn_session *
from_headset::settings_changed packet{
.bitrate_bps = config.bitrate_bps,
};
if (config.preferred_refresh_rate and (config.preferred_refresh_rate == 0 or utils::contains(refresh_rates, *config.preferred_refresh_rate)))
if (not refresh_rates.empty())
{
packet.preferred_refresh_rate = *config.preferred_refresh_rate;
packet.preferred_refresh_rate = config.preferred_refresh_rate;
packet.minimum_refresh_rate = config.minimum_refresh_rate.value_or(0);
}
else
@@ -407,12 +408,11 @@ void scenes::stream::gui_settings(float predicted_display_period)
const auto & refresh_rates = session.get_refresh_rates();
if (not refresh_rates.empty())
{
float active_rate = config.preferred_refresh_rate.value_or(refresh_rates.back());
float active_rate = config.preferred_refresh_rate;
if (ImGui::BeginCombo(_S("Refresh rate"), active_rate ? fmt::format("{}", active_rate).c_str() : _cS("automatic refresh rate", "Automatic")))
{
if (ImGui::Selectable(_cS("automatic refresh rate", "Automatic"), config.preferred_refresh_rate == 0, ImGuiSelectableFlags_SelectOnRelease))
if (ImGui::Selectable(_cS("automatic refresh rate", "Automatic"), active_rate == 0, ImGuiSelectableFlags_SelectOnRelease))
{
session.set_refresh_rate(0);
config.preferred_refresh_rate = 0;
send_settings_changed_packet(session, network_session.get(), config, predicted_display_period);
config.save();
@@ -421,7 +421,7 @@ void scenes::stream::gui_settings(float predicted_display_period)
imgui_ctx->tooltip(_("Select refresh rate based on measured application performance.\nMay cause flicker when a change happens."));
for (float rate: refresh_rates)
{
if (ImGui::Selectable(fmt::format("{}", rate).c_str(), rate == config.preferred_refresh_rate, ImGuiSelectableFlags_SelectOnRelease))
if (ImGui::Selectable(fmt::format("{}", rate).c_str(), rate == active_rate, ImGuiSelectableFlags_SelectOnRelease))
{
session.set_refresh_rate(rate);
config.preferred_refresh_rate = rate;
@@ -433,7 +433,7 @@ void scenes::stream::gui_settings(float predicted_display_period)
}
imgui_ctx->vibrate_on_hover();
if (config.preferred_refresh_rate == 0 and refresh_rates.size() > 2)
if (active_rate == 0 and refresh_rates.size() > 2)
{
float min_rate = config.minimum_refresh_rate.value_or(refresh_rates.front());
if (ImGui::BeginCombo(_S("Minimum refresh rate"), fmt::format("{}", min_rate).c_str()))
@@ -525,58 +525,58 @@ void scenes::stream::gui_settings(float predicted_display_period)
}
}
ImGui::Unindent();
}
bool send_packet = false;
bool save_config = false;
ImGui::Text("%s", _S("Foveation center override"));
ImGui::Indent();
bool send_packet = false;
bool save_config = false;
ImGui::Text("%s", _S("Foveation center override"));
ImGui::Indent();
{
if (ImGui::Checkbox(_S("Enable"), &override_foveation_enable))
{
if (ImGui::Checkbox(_S("Enable"), &override_foveation_enable))
{
send_packet = true;
save_config = true;
}
imgui_ctx->vibrate_on_hover();
ImGui::BeginDisabled(!override_foveation_enable);
ImGui::Text("%s", fmt::format(_F("Height {:.1f} deg"), -override_foveation_pitch * 180 / M_PI).c_str());
ImGui::Text("%s", fmt::format(_F("Distance {:.2f} m"), override_foveation_distance).c_str());
if (ImGui::Button(_S("Default")))
{
override_foveation_distance = configuration{}.override_foveation_distance;
override_foveation_pitch = configuration{}.override_foveation_pitch;
send_packet = true;
save_config = true;
}
imgui_ctx->vibrate_on_hover();
ImGui::SameLine();
if (ImGui::Button(_S("Change")))
gui_status = gui_status::foveation_settings;
imgui_ctx->vibrate_on_hover();
ImGui::EndDisabled();
send_packet = true;
save_config = true;
}
ImGui::Unindent();
imgui_ctx->vibrate_on_hover();
if (send_packet)
ImGui::BeginDisabled(!override_foveation_enable);
ImGui::Text("%s", fmt::format(_F("Height {:.1f} deg"), -override_foveation_pitch * 180 / M_PI).c_str());
ImGui::Text("%s", fmt::format(_F("Distance {:.2f} m"), override_foveation_distance).c_str());
if (ImGui::Button(_S("Default")))
{
network_session->send_control(from_headset::override_foveation_center{
.enabled = override_foveation_enable,
.pitch = override_foveation_pitch,
.distance = override_foveation_distance,
});
override_foveation_distance = configuration{}.override_foveation_distance;
override_foveation_pitch = configuration{}.override_foveation_pitch;
send_packet = true;
save_config = true;
}
imgui_ctx->vibrate_on_hover();
if (save_config)
{
auto & config = application::get_config();
config.override_foveation_enable = override_foveation_enable;
config.override_foveation_pitch = override_foveation_pitch;
config.override_foveation_distance = override_foveation_distance;
config.save();
}
ImGui::SameLine();
if (ImGui::Button(_S("Change")))
gui_status = gui_status::foveation_settings;
imgui_ctx->vibrate_on_hover();
ImGui::EndDisabled();
}
ImGui::Unindent();
if (send_packet)
{
network_session->send_control(from_headset::override_foveation_center{
.enabled = override_foveation_enable,
.pitch = override_foveation_pitch,
.distance = override_foveation_distance,
});
}
if (save_config)
{
auto & config = application::get_config();
config.override_foveation_enable = override_foveation_enable;
config.override_foveation_pitch = override_foveation_pitch;
config.override_foveation_distance = override_foveation_distance;
config.save();
}
ImGui::PopStyleVar();
}
@@ -729,27 +729,6 @@ void scenes::stream::gui_applications()
ImGui::PopStyleVar(3);
}
// Return the vector v such that dot(v, x) > 0 iff x is on the side where the composition layer is visible
static glm::vec4 compute_ray_limits(const XrPosef & pose, float margin = 0)
{
glm::quat q{
pose.orientation.w,
pose.orientation.x,
pose.orientation.y,
pose.orientation.z,
};
glm::vec3 p{
pose.position.x,
pose.position.y,
pose.position.z,
};
glm::vec3 normal = glm::column(glm::mat3_cast(q), 2);
return glm::vec4(normal, -glm::dot(p, normal) - margin);
}
void scenes::stream::draw_gui(XrTime predicted_display_time, XrDuration predicted_display_period)
{
if (not(plots_toggle_1 and plots_toggle_2))
@@ -778,8 +757,10 @@ void scenes::stream::draw_gui(XrTime predicted_display_time, XrDuration predicte
{
if (system.hand_tracking_supported())
{
left_hand = session.create_hand_tracker(XR_HAND_LEFT_EXT);
right_hand = session.create_hand_tracker(XR_HAND_RIGHT_EXT);
if (not left_hand)
left_hand = session.create_hand_tracker(XR_HAND_LEFT_EXT);
if (not right_hand)
right_hand = session.create_hand_tracker(XR_HAND_RIGHT_EXT);
}
}
else
@@ -827,7 +808,7 @@ void scenes::stream::draw_gui(XrTime predicted_display_time, XrDuration predicte
case gui_status::bitrate_settings:
case gui_status::foveation_settings:
imgui_ctx->layers()[0].orientation = head_position->second;
imgui_ctx->layers()[0].position = head_position->first + M * glm::vec3{0, -override_foveation_distance * sin(override_foveation_pitch), -override_foveation_distance};
imgui_ctx->layers()[0].position = head_position->first + M * glm::vec3{0, override_foveation_distance * sin(override_foveation_pitch), -override_foveation_distance};
break;
case gui_status::hidden:
@@ -854,7 +835,8 @@ void scenes::stream::draw_gui(XrTime predicted_display_time, XrDuration predicte
const ImGuiStyle & style = ImGui::GetStyle();
imgui_ctx->new_frame(predicted_display_time);
ImVec2 content_size{ImGui::GetMainViewport()->Size - ImVec2{tab_width, 0} - margin_around_window * 2};
ImVec2 viewport_size(imgui_ctx->layers()[0].vp_size.x, imgui_ctx->layers()[0].vp_size.y);
ImVec2 content_size{viewport_size - ImVec2{tab_width, 0} - margin_around_window * 2};
ImVec2 content_center = margin_around_window + content_size / 2 + ImVec2{tab_width, 0};
bool display_tabs, always_auto_resize;
@@ -870,7 +852,7 @@ void scenes::stream::draw_gui(XrTime predicted_display_time, XrDuration predicte
case gui_status::hidden:
case gui_status::bitrate_settings:
case gui_status::foveation_settings:
ImGui::SetNextWindowPos(ImGui::GetMainViewport()->Size / 2, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
ImGui::SetNextWindowPos(viewport_size / 2, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
always_auto_resize = true;
display_tabs = false;
break;
@@ -885,13 +867,13 @@ void scenes::stream::draw_gui(XrTime predicted_display_time, XrDuration predicte
case gui_status::settings:
case gui_status::applications:
ImGui::SetNextWindowPos(margin_around_window);
ImGui::SetNextWindowSize(ImGui::GetMainViewport()->Size - margin_around_window * 2);
ImGui::SetNextWindowSize(viewport_size - margin_around_window * 2);
always_auto_resize = false;
display_tabs = true;
break;
case gui_status::application_launcher:
ImGui::SetNextWindowPos(margin_around_window);
ImGui::SetNextWindowSize(ImGui::GetMainViewport()->Size - margin_around_window * 2);
ImGui::SetNextWindowSize(viewport_size - margin_around_window * 2);
always_auto_resize = false;
display_tabs = false;
break;
@@ -1053,10 +1035,12 @@ void scenes::stream::draw_gui(XrTime predicted_display_time, XrDuration predicte
else
recentering_context.reset();
std::vector<glm::vec4> ray_limits;
for (auto [_, layer]: layers)
ray_limits.push_back(compute_ray_limits(layer.pose));
std::vector<glm::mat4> world_to_window;
for (auto & window: imgui_ctx->windows())
{
if (window.space == xr::spaces::world)
world_to_window.push_back(glm::inverse(glm::translate(window.position) * glm::mat4(glm::mat3_cast(window.orientation)) * glm::scale(glm::vec3(window.size, 1))));
}
bool hide_left_controller = false;
bool hide_right_controller = false;
@@ -1080,7 +1064,7 @@ void scenes::stream::draw_gui(XrTime predicted_display_time, XrDuration predicte
hide_left_controller,
hide_right_controller,
hide_right_controller,
ray_limits);
world_to_window);
// Add the layer with the controllers
if (composition_layer_depth_test_supported)
+15 -8
View File
@@ -84,7 +84,7 @@ from_headset::tracking::pose locate_space(device_id device, XrSpace space, XrSpa
.flags = cast_flags(location.locationFlags, velocity.velocityFlags),
};
spdlog::warn("xrLocateSpace failed for {}: {}", magic_enum::enum_name(device), xr::to_string(res));
return {};
return {.device = device};
}
class locate_spaces_functor
@@ -622,6 +622,13 @@ void scenes::stream::tracking()
}
network_session->send_stream(std::span(packets.data(), packet_count));
XrTime old = scheduled_derived_pose;
if (old and now > old)
{
send_derived_pose();
scheduled_derived_pose.compare_exchange_strong(old, 0);
}
}
catch (std::exception & e)
{
@@ -721,6 +728,12 @@ void scenes::stream::on_interaction_profile_changed(const XrEventDataInteraction
interaction_profiles[i] = interaction_profile::none;
}
// Wait for runtime to know about the controllers before sending data
scheduled_derived_pose = instance.now() + 1'000'000'000;
}
void scenes::stream::send_derived_pose()
{
auto now = instance.now();
for (device_id target: {
device_id::LEFT_AIM,
@@ -735,14 +748,8 @@ void scenes::stream::on_interaction_profile_changed(const XrEventDataInteraction
{
// don't do derived poses for hand interaction
const bool right = (target >= device_id::RIGHT_GRIP && target <= device_id::RIGHT_PALM) || target == device_id::RIGHT_PINCH_POSE || target == device_id::RIGHT_POKE;
if (interaction_profiles[right].load() == interaction_profile::ext_hand_interaction_ext)
{
network_session->send_control(from_headset::derived_pose{
.source = target,
.target = target,
});
if (interaction_profiles[right] == interaction_profile::ext_hand_interaction_ext)
continue;
}
auto source = derived_from(target);
auto source_space = application::space(device_to_space(source));
-2
View File
@@ -1,7 +1,6 @@
// kate: hl glsl
const int nb_views = 2;
const int nb_clipping = 4;
const int nb_texcoords = 2;
const bool use_pbr = false;
@@ -20,7 +19,6 @@ layout(set = 0, binding = 1) uniform mesh_ubo
mat4 model;
mat4 modelview[nb_views];
mat4 modelviewproj[nb_views];
vec4 clipping_plane[nb_clipping];
} mesh;
layout(set = 0, binding = 2) uniform joints_ubo
-2
View File
@@ -27,7 +27,6 @@ layout (constant_id = 2) const bool alpha_cutout = false;
layout (constant_id = 3) const bool skinning = false;
const int nb_views = 2;
const int nb_clipping = 4;
layout(set = 0, binding = 0) uniform scene_ubo
{
@@ -42,7 +41,6 @@ layout(set = 0, binding = 1) uniform mesh_ubo
mat4 model;
mat4 modelview[nb_views];
mat4 modelviewproj[nb_views];
vec4 clipping_plane[nb_clipping];
} mesh;
layout(set = 0, binding = 2) uniform joints_ubo
-6
View File
@@ -34,7 +34,6 @@ layout(location = 5) in vec4 in_color;
out gl_PerVertex
{
vec4 gl_Position;
float gl_ClipDistance[nb_clipping];
};
void main()
@@ -59,9 +58,4 @@ void main()
frag_pos = mesh.modelview[gl_ViewIndex] * vec4(in_position, 1.0);
light_pos = scene.view[gl_ViewIndex] * scene.light_position;
vertex_color = in_color;
for (int i = 0; i < nb_clipping; i++)
{
gl_ClipDistance[i] = dot(mesh.clipping_plane[i], mesh.model * vec4(in_position, 1.0));
}
}
+3 -10
View File
@@ -36,7 +36,6 @@ layout(location = 7) in vec4 in_weights;
out gl_PerVertex
{
vec4 gl_Position;
float gl_ClipDistance[nb_clipping];
};
void main()
@@ -53,8 +52,8 @@ void main()
in_weights.z * joints.joint_matrices[int(in_joints.z)] +
in_weights.w * joints.joint_matrices[int(in_joints.w)];
// TODO on CPU?
mat3 mv = inverse(transpose(mat3(mesh.modelview[gl_ViewIndex])));
mat3 mv = inverse(transpose(mat3(mesh.modelview[gl_ViewIndex] * skinMatrix)));
tangent = vec4(normalize(mv * in_tangent.xyz), in_tangent.w);
if (any(isnan(tangent))) // avoid NaNs if no tangent data is provided
@@ -62,15 +61,9 @@ void main()
normal = normalize(mv * in_normal);
normal = vec3(mesh.modelview[gl_ViewIndex] * skinMatrix * vec4(in_normal, 0.0));
gl_Position = mesh.modelviewproj[gl_ViewIndex] * skinMatrix * vec4(in_position, 1.0);
frag_pos = mesh.modelview[gl_ViewIndex] * vec4(in_position, 1.0);
frag_pos = mesh.modelview[gl_ViewIndex] * skinMatrix * vec4(in_position, 1.0);
light_pos = scene.view[gl_ViewIndex] * scene.light_position;
vertex_color = in_color;
for(int i = 0; i < nb_clipping; i++)
{
gl_ClipDistance[i] = dot(mesh.clipping_plane[i], mesh.model * vec4(in_position, 1.0));
}
}
+23
View File
@@ -0,0 +1,23 @@
/*
* WiVRn VR streaming
* Copyright (C) 2026 Guillaume Meunier <guillaume.meunier@centraliens.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#version 450
#extension GL_GOOGLE_include_directive : require
#include "ray_common.glsl.inc"
+25
View File
@@ -0,0 +1,25 @@
/*
* WiVRn VR streaming
* Copyright (C) 2026 Guillaume Meunier <guillaume.meunier@centraliens.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#version 450
#extension GL_EXT_multiview : require
#extension GL_GOOGLE_include_directive : require
#define SKINNED 0
#include "ray_common.glsl.inc"
+140
View File
@@ -0,0 +1,140 @@
// kate: hl glsl
/*
* WiVRn VR streaming
* Copyright (C) 2026 Guillaume Meunier <guillaume.meunier@centraliens.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const int nb_views = 2;
const int nb_windows = 4;
layout(set = 0, binding = 1) uniform mesh_ubo
{
mat4 model;
mat4 modelview[nb_views];
mat4 modelviewproj[nb_views];
// Extra data
mat4 world_to_window[nb_windows];
float emissive_factor;
} mesh;
layout(set = 0, binding = 2) uniform joints_ubo
{
mat4 joint_matrices[32];
} joints;
layout(set = 0, binding = 6) uniform sampler2D emissive_texture;
#ifdef VERT_SHADER
// Vertex input
layout(location = 0) in vec3 in_position;
layout(location = 1) in vec2 in_texcoord;
#if SKINNED
layout(location = 2) in vec4 in_joints;
layout(location = 3) in vec4 in_weights;
#endif
#endif
#ifdef FRAG_SHADER
#define VS_TO_FS in
#else
#define VS_TO_FS out
#endif
// Vertex-to-fragment
layout(location = 0) VS_TO_FS vec2 texcoord;
#ifndef HTC_WORKAROUND
layout(location = 1) VS_TO_FS vec4 position_wrt_window[nb_windows];
layout(location = 1 + nb_windows) VS_TO_FS vec4 base_wrt_window[nb_windows];
#endif // HTC_WORKAROUND
#ifdef VERT_SHADER
out gl_PerVertex
{
vec4 gl_Position;
#ifdef HTC_WORKAROUND
float gl_ClipDistance[nb_windows];
#endif
};
void main()
{
texcoord = in_texcoord;
#if SKINNED
mat4 skinMatrix =
in_weights.x * joints.joint_matrices[int(in_joints.x)] +
in_weights.y * joints.joint_matrices[int(in_joints.y)] +
in_weights.z * joints.joint_matrices[int(in_joints.z)] +
in_weights.w * joints.joint_matrices[int(in_joints.w)];
gl_Position = mesh.modelviewproj[gl_ViewIndex] * skinMatrix * vec4(in_position, 1.0);
vec4 world_position = mesh.model * skinMatrix * vec4(in_position, 1.0);
vec4 base_position = mesh.model * skinMatrix * vec4(in_position.xy, 0.0, 1.0);
#else // SKINNED
gl_Position = mesh.modelviewproj[gl_ViewIndex] * vec4(in_position, 1.0);
vec4 world_position = mesh.model * vec4(in_position, 1.0);
vec4 base_position = mesh.model * vec4(in_position.xy, 0.0, 1.0);
#endif // SKINNED
for(uint i = 0; i < nb_windows; i++)
{
#ifdef HTC_WORKAROUND
vec4 tmp = mesh.world_to_window[i] * world_position;
gl_ClipDistance[i] = tmp.z;
#else // HTC_WORKAROUND
position_wrt_window[i] = mesh.world_to_window[i] * world_position;
base_wrt_window[i] = mesh.world_to_window[i] * base_position;
#endif // HTC_WORKAROUND
}
}
#endif // VERT_SHADER
#ifdef FRAG_SHADER
// Fragment output
layout(location = 0) out vec4 out_color;
void main()
{
#ifdef HTC_WORKAROUND
out_color = vec4(mesh.emissive_factor * texture(emissive_texture, texcoord).rgb, 1.0 / 255.0);
#else // HTC_WORKAROUND
for (uint i = 0; i < nb_windows; i++)
{
if (position_wrt_window[i].w < 0.5)
continue;
// TODO check NaN
float lambda = -base_wrt_window[i].z / (position_wrt_window[i].z - base_wrt_window[i].z);
if (lambda < 0 || lambda > 1)
continue;
vec2 intersection = base_wrt_window[i].xy + lambda * (position_wrt_window[i].xy - base_wrt_window[i].xy);
if (abs(intersection.x) < 0.5 && abs(intersection.y) < 0.5)
discard;
}
out_color = vec4(mesh.emissive_factor * texture(emissive_texture, texcoord).rgb, 0);
#endif // HTC_WORKAROUND
}
#endif // FRAG_SHADER
+25
View File
@@ -0,0 +1,25 @@
/*
* WiVRn VR streaming
* Copyright (C) 2026 Guillaume Meunier <guillaume.meunier@centraliens.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#version 450
#extension GL_GOOGLE_include_directive : require
#define HTC_WORKAROUND
#include "ray_common.glsl.inc"
+26
View File
@@ -0,0 +1,26 @@
/*
* WiVRn VR streaming
* Copyright (C) 2026 Guillaume Meunier <guillaume.meunier@centraliens.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#version 450
#extension GL_EXT_multiview : require
#extension GL_GOOGLE_include_directive : require
#define SKINNED 0
#define HTC_WORKAROUND
#include "ray_common.glsl.inc"
+25
View File
@@ -0,0 +1,25 @@
/*
* WiVRn VR streaming
* Copyright (C) 2026 Guillaume Meunier <guillaume.meunier@centraliens.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#version 450
#extension GL_EXT_multiview : require
#extension GL_GOOGLE_include_directive : require
#define SKINNED 1
#include "ray_common.glsl.inc"
+26
View File
@@ -0,0 +1,26 @@
/*
* WiVRn VR streaming
* Copyright (C) 2026 Guillaume Meunier <guillaume.meunier@centraliens.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#version 450
#extension GL_EXT_multiview : require
#extension GL_GOOGLE_include_directive : require
#define SKINNED 1
#define HTC_WORKAROUND
#include "ray_common.glsl.inc"
-6
View File
@@ -18,7 +18,6 @@
*/
#include "shader.h"
#include "utils/cache.h"
#include "wivrn_shaders.h"
#include <magic_enum.hpp>
#include <spdlog/spdlog.h>
@@ -104,8 +103,3 @@ std::shared_ptr<shader> shader_loader::operator()(const std::string & name)
return (*this)(shaders.at(name));
}
std::shared_ptr<shader> load_shader(vk::raii::Device & device, const std::string & name)
{
return shader_loader{device}(name);
}
+4 -1
View File
@@ -64,4 +64,7 @@ struct shader_loader
std::shared_ptr<shader> operator()(const std::string & name);
};
std::shared_ptr<shader> load_shader(vk::raii::Device & device, const std::string & name);
inline std::shared_ptr<shader> load_shader(vk::raii::Device & device, const std::string & name)
{
return shader_loader{device}(name);
}
+8 -1
View File
@@ -13,13 +13,20 @@ function(compile_glsl_aux shader_stage shader_name glsl_filename output target_e
}},
")
if (WIVRN_DEBUG_SHADERS)
set(SHADER_FLAGS -gVS)
else()
set(SHADER_FLAGS )
endif()
add_custom_command(
OUTPUT "${SPV_FILE}-nopt"
COMMAND Vulkan::glslangValidator -V --target-env ${target_env} -S ${shader_stage} -D${shader_stage_upper}_SHADER ${in_file} -o "${SPV_FILE}-nopt" --depfile "${SPV_FILE}.d"
COMMAND Vulkan::glslangValidator -V --target-env ${target_env} -S ${shader_stage} -D${shader_stage_upper}_SHADER ${in_file} ${SHADER_FLAGS} -o "${SPV_FILE}-nopt" --depfile "${SPV_FILE}.d"
DEPENDS "${glsl_filename}"
DEPFILE "${SPV_FILE}.d"
VERBATIM
)
if (WIVRN_OPTIMIZE_SHADERS)
add_custom_command(
OUTPUT "${SPV_FILE}-opt"
+12 -5
View File
@@ -1,7 +1,7 @@
if (WIVRN_USE_SYSTEM_BOOST)
add_library(Boost::pfr ALIAS Boost::headers)
else()
set(BOOST_INCLUDE_LIBRARIES locale url pfr)
set(BOOST_INCLUDE_LIBRARIES locale url pfr iostreams)
FetchContent_MakeAvailable(boost)
endif()
@@ -40,14 +40,17 @@ add_library(wivrn-common STATIC EXCLUDE_FROM_ALL
if (WIVRN_BUILD_DASHBOARD OR WIVRN_BUILD_SERVER)
add_library(wivrn-common-server STATIC EXCLUDE_FROM_ALL
application.cpp
utils/flatpak.cpp
utils/xdg_icon_lookup.cpp
utils/steam_app_info.cpp
utils/load_icon.cpp
utils/ini.cpp
application.cpp
utils/steam_info.cpp
utils/vdf.cpp
utils/xdg_icon_lookup.cpp
)
target_link_libraries(wivrn-common-server PRIVATE nlohmann_json::nlohmann_json PNG::PNG PkgConfig::librsvg-2.0 LibArchive::LibArchive PUBLIC wivrn-common-base)
target_link_libraries(wivrn-common-server
PRIVATE nlohmann_json::nlohmann_json PNG::PNG PkgConfig::librsvg-2.0 LibArchive::LibArchive Boost::iostreams
PUBLIC wivrn-common-base)
if (WIVRN_BUILD_TEST)
add_executable(list-apps
@@ -55,6 +58,10 @@ if (WIVRN_BUILD_DASHBOARD OR WIVRN_BUILD_SERVER)
)
target_link_libraries(list-apps wivrn-common-server)
add_executable(vdf utils/vdf.cpp)
target_compile_definitions(vdf PRIVATE WIVRN_BUILD_TEST)
target_link_libraries(vdf Boost::iostreams)
endif()
endif()
+14 -167
View File
@@ -20,13 +20,12 @@
#include "application.h"
#include "utils/flatpak.h"
#include "utils/steam_app_info.h"
#include "utils/steam_info.h"
#include "utils/xdg_base_directory.h"
#include "utils/xdg_icon_lookup.h"
#include <filesystem>
#include <fstream>
#include <iostream>
#include <nlohmann/json.hpp>
namespace wivrn
@@ -42,168 +41,6 @@ std::string read_file(const std::filesystem::path & path)
return {begin, end};
}
std::filesystem::path home()
{
auto home = std::getenv("HOME");
return home ? home : "";
}
std::pair<std::string, std::optional<std::filesystem::path>> find_steam()
{
auto h = home();
// Flatpak Steam
if (std::filesystem::exists(h / ".var/app/com.valvesoftware.Steam/.steam/steam"))
return {"flatpak run com.valvesoftware.Steam", h / ".var/app/com.valvesoftware.Steam/.steam/steam"};
// Debian Steam (accessed from flatpak)
if (std::filesystem::exists(h / ".steam/debian-installation"))
return {"steam", h / ".steam/debian-installation"};
// system Steam
if (std::filesystem::exists(xdg_data_home() / "Steam"))
return {"steam", xdg_data_home() / "Steam"};
// system Steam (accessed from flatpak)
if (std::filesystem::exists(h / ".local/share/Steam"))
return {"steam", h / ".local/share/Steam"};
return {};
}
std::string read_vr_manifest(const std::filesystem::path & root)
{
return read_file(root / "config/steamapps.vrmanifest");
}
std::unordered_map<uint32_t, wivrn::steam_icon> safe_read_steam_icons(const std::filesystem::path & root)
{
try
{
return read_steam_icons(root / "appcache/appinfo.vdf");
}
catch (...)
{}
return {};
}
std::optional<std::filesystem::path> find_steam_icon(const std::filesystem::path & root, int app_id, const std::unordered_map<uint32_t, wivrn::steam_icon> & info)
{
auto icon = info.find(app_id);
if (icon == info.end())
return std::nullopt;
try
{
auto icon_path = root / "steam/games" / (icon->second.clienticon + ".ico");
if (std::filesystem::exists(icon_path))
return icon_path;
}
catch (...)
{
}
try
{
auto icon_path = root / "steam/games" / (icon->second.linuxclienticon + ".zip");
if (std::filesystem::exists(icon_path))
return icon_path;
}
catch (...)
{
}
return std::nullopt;
}
void read_steam_vr_apps(std::unordered_map<std::string, application> & res)
{
auto [command, root] = find_steam();
if (not root)
return;
auto manifest = read_vr_manifest(*root);
auto info = safe_read_steam_icons(*root);
if (manifest.empty())
return;
nlohmann::json json = nlohmann::json::parse(manifest);
for (auto & i: json["applications"])
{
try
{
application app;
if (i["launch_type"] == "url")
app.exec = command + " " + (std::string)i["url"];
else
continue;
std::string app_key = i["app_key"];
for (auto [locale, items]: i["strings"].items())
{
if (auto it = items.find("name"); it != items.end())
app.name[locale] = *it;
}
if (not app.name.contains(""))
{
auto it = app.name.find("en_us");
if (it == app.name.end())
it = app.name.begin();
if (it != app.name.end())
app.name[""] = it->second;
}
try
{
const char prefix[] = "steam.app.";
if (app_key.starts_with(prefix))
{
uint32_t app_id = stoll(app_key.substr(strlen(prefix)));
app.icon_path = find_steam_icon(*root, app_id, info);
}
}
catch (...)
{
}
if (not app.exec.empty())
res[app_key] = std::move(app);
}
catch (std::exception & e)
{
std::cerr << "Failed to parse Steam VR manifest: " << e.what() << std::endl;
}
}
for (auto const & entry: std::filesystem::directory_iterator{*root / "userdata"})
{
auto shortcuts_vdf = entry.path() / "config/shortcuts.vdf";
if (std::filesystem::exists(shortcuts_vdf))
{
try
{
for (auto && item: read_steam_shortcuts(shortcuts_vdf))
{
res[std::to_string(item.appid)] = {
.name = {{"", std::move(item.name)}},
// ¯\_(ツ)_/¯
.exec = command + " steam://rungameid/" + std::to_string((uint64_t(item.appid) << 32) + 0x2000000),
.icon_path = std::move(item.icon),
};
}
}
catch (std::exception & e)
{
std::cerr << "Failed to parse Steam shortcuts file " << shortcuts_vdf << ": " << e.what() << std::endl;
}
}
}
}
std::string unescape(std::string_view in)
{
std::string out;
@@ -391,9 +228,19 @@ std::unordered_map<std::string, application> list_applications()
{
std::unordered_map<std::string, application> res;
read_steam_vr_apps(res);
do_data_dir(xdg_data_home(), res);
for (auto & steam: steam::find_installations())
{
auto cmd = steam.get_steam_command() + " ";
for (auto && app: steam.list_applications())
{
res.emplace(std::to_string(app.appid),
application{
.name = std::move(app.name),
.exec = cmd + app.url,
.icon_path = steam.get_icon(app.appid),
});
}
}
for (auto && dir: xdg_data_dirs())
do_data_dir(std::move(dir), res);
-274
View File
@@ -1,274 +0,0 @@
/*
* WiVRn VR streaming
* Copyright (C) 2025 Guillaume Meunier <guillaume.meunier@centraliens.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "steam_app_info.h"
#include <bit>
#include <cstring>
#include <fstream>
#include <iostream>
namespace
{
class binary_reader
{
std::ifstream in;
public:
binary_reader(std::ifstream && in) : in{std::move(in)} {}
void discard(size_t bytes)
{
in.seekg(bytes, std::ios_base::cur);
}
template <typename T>
T read();
template <typename T>
requires std::is_integral_v<T>
T read()
{
T res;
in.read((char *)&res, sizeof(T));
if (not in)
throw std::runtime_error{"File truncated"};
static_assert(std::endian::native == std::endian::big or std::endian::native == std::endian::little);
if constexpr (std::endian::native == std::endian::big)
return std::byteswap(res);
else
return res;
}
std::vector<std::string> string_table();
auto tellg()
{
return in.tellg();
}
void seekg(size_t pos)
{
in.seekg(pos);
}
};
template <>
std::string binary_reader::read()
{
std::string res;
std::getline(in, res, '\0');
if (not in)
throw std::runtime_error{"File truncated"};
return res;
}
std::vector<std::string> binary_reader::string_table()
{
std::vector<std::string> res;
size_t string_offset = read<uint64_t>();
auto pos = in.tellg();
in.seekg(string_offset);
auto count = read<uint32_t>();
res.reserve(count);
for (size_t i = 0; i < count; ++i)
res.emplace_back(read<std::string>());
in.seekg(pos);
return res;
}
template <typename T>
void read_dict(binary_reader & in, T & visitor, const std::vector<std::string> * string_table = nullptr)
{
while (true)
{
auto type = in.read<uint8_t>();
if (type == 8)
{
visitor.end_dict();
return;
}
// Key
const std::string & key = string_table ? string_table->at(in.read<uint32_t>()) : in.read<std::string>();
// Value
switch (type)
{
case 0: // Dictionary
visitor.begin_dict(key);
read_dict(in, visitor, string_table);
break;
case 1: // UTF-8 string
visitor.on_string(key, in.read<std::string>());
break;
case 2: // uint32_t
visitor.on_uint32_t(key, in.read<uint32_t>());
break;
// case 3: // float
default:
throw std::runtime_error{"Unknown object type " + std::to_string(type)};
}
}
}
} // namespace
std::unordered_map<uint32_t, wivrn::steam_icon> wivrn::read_steam_icons(std::filesystem::path path)
{
binary_reader in{std::ifstream{path}};
uint32_t magic = in.read<uint32_t>();
if ((magic & 0xff'ff'ff'00) != 0x07'56'44'00)
throw std::runtime_error{"Wrong magic number"};
auto universe = in.read<uint32_t>();
int version = magic & 0xff;
std::vector<std::string> string_table;
std::vector<std::string> * string_table_ptr = nullptr;
if (version >= 41)
{
string_table = in.string_table();
string_table_ptr = &string_table;
}
std::unordered_map<uint32_t, wivrn::steam_icon> res;
struct V
{
wivrn::steam_icon current{};
void begin_dict(const std::string & key)
{
}
void end_dict()
{
}
void on_string(const std::string & key, std::string && val)
{
if (strcasecmp(key.c_str(), "clienticon") == 0)
current.clienticon = std::move(val);
else if (strcasecmp(key.c_str(), "linuxclienticon") == 0)
current.linuxclienticon = std::move(val);
}
void on_uint32_t(const std::string & key, uint32_t val)
{
}
};
while (true)
{
// See https://github.com/SteamDatabase/SteamAppInfo/blob/master/README.md#app-entry-repeated
auto app_id = in.read<uint32_t>();
if (app_id == 0)
break;
size_t size_data = in.read<uint32_t>();
size_t pos = in.tellg();
in.discard(
4 // info_state
+ 4 // last_updated
+ 8 // pics_token
+ 20 // SHA1 of the app info
+ 4 // change number
+ 20 // SHA1 of the bin data
+ 4 // checksum
+ 1 // type
);
try
{
V v;
read_dict(in, v, string_table_ptr);
if (not(v.current.clienticon.empty() and v.current.linuxclienticon.empty()))
res.emplace(app_id, std::move(v.current));
}
catch (...)
{
// Ignore errors
}
in.seekg(pos + size_data);
}
return res;
}
std::vector<wivrn::steam_shortcut> wivrn::read_steam_shortcuts(std::filesystem::path path)
{
binary_reader in{std::ifstream{path}};
auto type = in.read<uint8_t>();
auto name = in.read<std::string>();
if (type != 0 or name != "shortcuts")
throw std::runtime_error{"Invalid type for shortcuts file"};
std::vector<wivrn::steam_shortcut> res;
struct V
{
std::vector<wivrn::steam_shortcut> & items;
int depth = 0;
wivrn::steam_shortcut current{};
bool VR = false;
void begin_dict(const std::string & key)
{
++depth;
if (depth == 1)
{
current = decltype(current){};
VR = false;
}
}
void end_dict()
{
--depth;
if (depth == 0)
{
if (VR)
items.push_back(std::move(current));
}
}
void on_string(const std::string & key, std::string && val)
{
if (depth == 1)
{
if (strcasecmp(key.c_str(), "AppName") == 0)
current.name = std::move(val);
else if (strcasecmp(key.c_str(), "icon") == 0 and not val.empty())
current.icon = std::move(val);
}
}
void on_uint32_t(const std::string & key, uint32_t val)
{
if (depth == 1)
{
if (strcasecmp(key.c_str(), "appid") == 0)
current.appid = val;
else if (strcasecmp(key.c_str(), "OpenVR") == 0)
VR = val;
}
}
} v{res};
read_dict(in, v);
return res;
}
+495
View File
@@ -0,0 +1,495 @@
/*
* WiVRn VR streaming
* Copyright (C) 2025 Guillaume Meunier <guillaume.meunier@centraliens.net>
* Copyright (C) 2026 Patrick Nicolas <patricknicolas@laposte.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "steam_info.h"
#include "vdf.h"
#include "xdg_base_directory.h"
#include <bit>
#include <charconv>
#include <cstring>
#include <format>
#include <fstream>
#include <iostream>
#include <nlohmann/json.hpp>
namespace
{
class binary_reader
{
std::ifstream in;
public:
binary_reader(std::ifstream && in) : in{std::move(in)} {}
void discard(size_t bytes)
{
in.seekg(bytes, std::ios_base::cur);
}
template <typename T>
T read();
template <typename T>
requires std::is_integral_v<T>
T read()
{
T res;
in.read((char *)&res, sizeof(T));
if (not in)
throw std::runtime_error{"File truncated"};
static_assert(std::endian::native == std::endian::big or std::endian::native == std::endian::little);
if constexpr (std::endian::native == std::endian::big)
return std::byteswap(res);
else
return res;
}
std::vector<std::string> string_table();
auto tellg()
{
return in.tellg();
}
void seekg(size_t pos)
{
in.seekg(pos);
}
};
template <>
std::string binary_reader::read()
{
std::string res;
std::getline(in, res, '\0');
if (not in)
throw std::runtime_error{"File truncated"};
return res;
}
std::vector<std::string> binary_reader::string_table()
{
std::vector<std::string> res;
size_t string_offset = read<uint64_t>();
auto pos = in.tellg();
in.seekg(string_offset);
auto count = read<uint32_t>();
res.reserve(count);
for (size_t i = 0; i < count; ++i)
res.emplace_back(read<std::string>());
in.seekg(pos);
return res;
}
template <typename T>
void read_dict(binary_reader & in, T & visitor, const std::vector<std::string> * string_table = nullptr)
{
while (true)
{
auto type = in.read<uint8_t>();
if (type == 8)
{
visitor.end_dict();
return;
}
// Key
const std::string & key = string_table ? string_table->at(in.read<uint32_t>()) : in.read<std::string>();
// Value
switch (type)
{
case 0: // Dictionary
visitor.begin_dict(key);
read_dict(in, visitor, string_table);
break;
case 1: // UTF-8 string
visitor.on_string(key, in.read<std::string>());
break;
case 2: // uint32_t
visitor.on_uint32_t(key, in.read<uint32_t>());
break;
// case 3: // float
default:
throw std::runtime_error{"Unknown object type " + std::to_string(type)};
}
}
}
std::filesystem::path home()
{
auto home = std::getenv("HOME");
return home ? home : "";
}
std::optional<uint32_t> guess_steam_userid(const std::filesystem::path & root)
{
auto localconfig = root / "config/loginusers.vdf";
if (not std::filesystem::exists(localconfig))
return {};
try
{
wivrn::vdf::root loginusers(localconfig);
if (loginusers.key != "users")
return {};
std::optional<uint32_t> res;
for (const auto & [userid, entries]: std::get<std::vector<wivrn::vdf::keyvalue>>(loginusers.value))
{
uint64_t v;
if (std::from_chars(userid.data.begin(), userid.data.end(), v).ec != std::errc{})
continue;
res = v; // truncate to 32 bits
for (const auto & [key, value]: std::get<std::vector<wivrn::vdf::keyvalue>>(entries))
{
if (key == "MostRecent" and std::get<wivrn::vdf::string>(value) == "1")
return res;
}
}
return res;
}
catch (std::exception & e)
{
return {};
}
}
} // namespace
void read_steam_icons(std::filesystem::path path, std::unordered_map<uint32_t, wivrn::steam::icon> & icons)
{
binary_reader in{std::ifstream{path}};
uint32_t magic = in.read<uint32_t>();
if ((magic & 0xff'ff'ff'00) != 0x07'56'44'00)
throw std::runtime_error{"Wrong magic number"};
auto universe = in.read<uint32_t>();
int version = magic & 0xff;
std::vector<std::string> string_table;
std::vector<std::string> * string_table_ptr = nullptr;
if (version >= 41)
{
string_table = in.string_table();
string_table_ptr = &string_table;
}
struct V
{
wivrn::steam::icon current{};
void begin_dict(const std::string & key)
{
}
void end_dict()
{
}
void on_string(const std::string & key, std::string && val)
{
if (strcasecmp(key.c_str(), "clienticon") == 0)
current.clienticon = std::move(val);
else if (strcasecmp(key.c_str(), "linuxclienticon") == 0)
current.linuxclienticon = std::move(val);
}
void on_uint32_t(const std::string & key, uint32_t val)
{
}
};
while (true)
{
// See https://github.com/SteamDatabase/SteamAppInfo/blob/master/README.md#app-entry-repeated
auto app_id = in.read<uint32_t>();
if (app_id == 0)
break;
size_t size_data = in.read<uint32_t>();
size_t pos = in.tellg();
in.discard(
4 // info_state
+ 4 // last_updated
+ 8 // pics_token
+ 20 // SHA1 of the app info
+ 4 // change number
+ 20 // SHA1 of the bin data
+ 4 // checksum
+ 1 // type
);
try
{
V v;
read_dict(in, v, string_table_ptr);
if (not(v.current.clienticon.empty() and v.current.linuxclienticon.empty()))
icons.emplace(app_id, std::move(v.current));
}
catch (...)
{
// Ignore errors
}
in.seekg(pos + size_data);
}
}
void read_steam_shortcuts(
const std::filesystem::path & path,
std::vector<wivrn::steam::application> & apps,
std::unordered_map<uint32_t, std::filesystem::path> & icons)
{
if (not std::filesystem::exists(path))
return;
binary_reader in{std::ifstream{path}};
auto type = in.read<uint8_t>();
auto name = in.read<std::string>();
if (type != 0 or name != "shortcuts")
throw std::runtime_error{"Invalid type for shortcuts file"};
std::vector<wivrn::steam_shortcut> res;
struct V
{
std::vector<wivrn::steam::application> & apps;
std::unordered_map<uint32_t, std::filesystem::path> & icons;
int depth = 0;
wivrn::steam::application current{};
std::filesystem::path icon;
bool VR = false;
void begin_dict(const std::string & key)
{
++depth;
if (depth == 1)
{
current = decltype(current){};
icon.clear();
VR = false;
}
}
void end_dict()
{
--depth;
if (depth == 0)
{
if (VR)
{
if (not icon.empty())
icons[current.appid] = std::move(icon);
// ¯\_(ツ)_/¯
current.appid = (current.appid << 32) | 0x02000000;
current.url = std::format("steam://rungameid/{}", current.appid);
apps.push_back(std::move(current));
}
}
}
void on_string(const std::string & key, std::string && val)
{
if (depth == 1)
{
if (strcasecmp(key.c_str(), "AppName") == 0)
current.name[""] = std::move(val);
else if (strcasecmp(key.c_str(), "icon") == 0 and not val.empty())
icon = std::move(val);
}
}
void on_uint32_t(const std::string & key, uint32_t val)
{
if (depth == 1)
{
if (strcasecmp(key.c_str(), "appid") == 0)
current.appid = val;
else if (strcasecmp(key.c_str(), "OpenVR") == 0)
VR = val;
}
}
} v{apps, icons};
read_dict(in, v);
}
wivrn::steam::steam(std::filesystem::path root, bool flatpak) :
root(std::move(root)),
flatpak(flatpak),
default_userid(guess_steam_userid(this->root))
{
}
std::vector<wivrn::steam> wivrn::steam::find_installations()
{
std::vector<wivrn::steam> res;
auto h = home();
auto try_construct = [&res](std::filesystem::path root, bool flatpak = false) {
try
{
if (std::filesystem::exists(root))
{
res.push_back(wivrn::steam(std::move(root), flatpak));
return true;
}
}
catch (std::exception &)
{
}
return false;
};
// Flatpak Steam
try_construct(h / ".var/app/com.valvesoftware.Steam/.steam/steam", true);
// Debian Steam (accessed from flatpak)
try_construct(h / ".steam/debian-installation")
// system Steam
or try_construct(xdg_data_home() / "Steam")
// system Steam (accessed from flatpak)
or try_construct(h / ".local/share/Steam");
return res;
}
std::vector<wivrn::steam::application> wivrn::steam::list_applications()
{
std::vector<wivrn::steam::application> res;
// Steam games, from VR manifest
try
{
std::ifstream manifest(root / "config/steamapps.vrmanifest");
nlohmann::json json = nlohmann::json::parse(manifest);
for (auto & i: json["applications"])
{
try
{
// Steam games have an url launch
// shortcuts may be in this file, or may not...
if (i["launch_type"] != "url")
continue;
std::string app_key = i["app_key"];
const char prefix[] = "steam.app.";
if (not app_key.starts_with(prefix))
continue;
application app{
.appid = stoul(app_key.substr(strlen(prefix))),
.url = i["url"],
};
for (auto [locale, items]: i["strings"].items())
{
if (auto it = items.find("name"); it != items.end())
app.name[locale] = *it;
}
if (not app.name.contains(""))
{
auto it = app.name.find("en_us");
if (it == app.name.end())
it = app.name.begin();
if (it != app.name.end())
app.name[""] = it->second;
else
continue; // skip unnamed app
}
res.push_back(std::move(app));
}
catch (std::exception & e)
{
std::cerr << "Failed to parse Steam VR manifest: " << e.what() << std::endl;
}
}
}
catch (std::exception & e)
{
}
// Shortcuts
if (default_userid)
{
try
{
read_steam_shortcuts(root / "userdata" / std::to_string(*default_userid) / "config/shortcuts.vdf", res, shortcut_icons);
}
catch (std::exception & e)
{
}
}
else
{
// Is it a good idea to just iterate over all users?
for (auto const & entry: std::filesystem::directory_iterator{root / "userdata"})
try
{
read_steam_shortcuts(entry.path() / "config/shortcuts.vdf", res, shortcut_icons);
}
catch (std::exception & e)
{
}
}
return res;
}
std::optional<std::filesystem::path> wivrn::steam::get_icon(uint64_t appid)
{
if (appid & 0x02000000)
{
// Shortcut
auto it = shortcut_icons.find(appid >> 32);
if (it != shortcut_icons.end())
return it->second;
return {};
}
if (not icons)
{
icons.emplace();
try
{
read_steam_icons(root / "appcache/appinfo.vdf", *icons);
}
catch (...)
{}
}
auto it = icons->find(appid);
if (it == icons->end())
return {};
auto icon_path = root / "steam/games" / (it->second.clienticon + ".ico");
if (std::filesystem::exists(icon_path))
return icon_path;
icon_path = root / "steam/games" / (it->second.linuxclienticon + ".zip");
if (std::filesystem::exists(icon_path))
return icon_path;
return {};
}
std::string wivrn::steam::get_steam_command() const
{
if (flatpak)
return "flatpak run com.valvesoftware.Steam";
return "steam";
}
+69
View File
@@ -0,0 +1,69 @@
/*
* WiVRn VR streaming
* Copyright (C) 2025 Guillaume Meunier <guillaume.meunier@centraliens.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include <filesystem>
#include <optional>
#include <unordered_map>
#include <vector>
namespace wivrn
{
class steam
{
public:
struct application
{
uint64_t appid;
// localised names, with empty locale for default
std::unordered_map<std::string, std::string> name;
std::string url;
};
struct icon
{
std::string clienticon;
std::string linuxclienticon;
};
private:
std::filesystem::path root;
bool flatpak;
std::optional<uint32_t> default_userid;
std::optional<std::unordered_map<uint32_t, icon>> icons;
std::unordered_map<uint32_t, std::filesystem::path> shortcut_icons;
steam(std::filesystem::path root, bool flatpak);
public:
static std::vector<steam> find_installations();
std::vector<application> list_applications();
std::optional<std::filesystem::path> get_icon(uint64_t app_id);
std::string get_steam_command() const;
};
struct steam_shortcut
{
uint32_t appid;
std::string name;
std::optional<std::filesystem::path> icon;
};
} // namespace wivrn
+191
View File
@@ -0,0 +1,191 @@
/*
* WiVRn VR streaming
* Copyright (C) 2026 Patrick Nicolas <patricknicolas@laposte.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "vdf.h"
#include <boost/iostreams/device/mapped_file.hpp>
#include <iostream>
namespace
{
void consume_whitespace(const char *& pos, const char * end)
{
for (; pos != end; ++pos)
{
if (not std::isspace(*pos))
return;
}
throw std::runtime_error("malformed VDF file");
}
wivrn::vdf::string read_string(const char *& pos, const char * end)
{
consume_whitespace(pos, end);
const bool quoted = *pos == '"';
if (quoted)
++pos;
const char * begin = pos;
for (; pos != end; ++pos)
{
if (*pos == '\\')
{
++pos;
if (pos == end)
break;
continue;
}
if (quoted)
{
if (*pos == '"')
return {std::string_view(begin, pos++)};
}
else
{
if (std::isspace(*pos) or *pos == '{' or *pos == '}')
return {std::string_view(begin, pos)};
}
}
throw std::runtime_error("malformed string in VDF file");
}
std::variant<wivrn::vdf::string, std::vector<wivrn::vdf::keyvalue>> read_value(const char *& pos, const char * end);
wivrn::vdf::keyvalue read_key_value(const char *& pos, const char * end)
{
return wivrn::vdf::keyvalue{
.key = read_string(pos, end),
.value = read_value(pos, end),
};
}
std::vector<wivrn::vdf::keyvalue> read_dict(const char *& pos, const char * end)
{
consume_whitespace(pos, end);
if (*pos != '{')
throw std::runtime_error("malformed VDF file");
++pos;
std::vector<wivrn::vdf::keyvalue> res;
while (true)
{
consume_whitespace(pos, end);
if (*pos == '}')
{
++pos;
return res;
}
res.push_back(read_key_value(pos, end));
}
throw std::runtime_error("malformed dict in VDF file");
}
std::variant<wivrn::vdf::string, std::vector<wivrn::vdf::keyvalue>> read_value(const char *& pos, const char * end)
{
consume_whitespace(pos, end);
if (*pos == '{')
return read_dict(pos, end);
else
return read_string(pos, end);
}
} // namespace
bool wivrn::vdf::string::operator==(const char * b) const
{
const char * a = data.begin();
for (; a != data.end(); ++a, ++b)
{
if (*b == '\0')
return false;
if (*a == '\\')
{
++a;
// This should be taken care of by the parser
assert(a != data.end());
}
if (std::tolower(*b) != std::tolower(*a))
return false;
}
return *b == '\0';
}
wivrn::vdf::root::root(const std::filesystem::path & file)
{
boost::iostreams::mapped_file in{file};
opaque = in;
const char * pos = in.begin();
key = read_string(pos, in.end());
value = read_value(pos, in.end());
}
void dump(const wivrn::vdf::keyvalue & kv, int depth)
{
for (int i = 0; i < depth; ++i)
std::cout << '\t';
std::cout << '"' << kv.key.data << "\": ";
struct V
{
int depth;
void operator()(const wivrn::vdf::string & s)
{
std::cout << '"' << s.data << '"';
}
void operator()(const std::vector<wivrn::vdf::keyvalue> & kv)
{
std::cout << '{' << std::endl;
for (const auto & i: kv)
{
dump(i, depth + 1);
if (&i != &kv.back())
std::cout << ',';
std::cout << std::endl;
}
for (int i = 0; i < depth; ++i)
std::cout << '\t';
std::cout << "}";
}
};
std::visit(V{depth}, kv.value);
}
#ifdef WIVRN_BUILD_TEST
void dump(const wivrn::vdf::root & kv)
{
std::cout << '{';
dump(kv, 0);
std::cout << '}';
}
int main(int argc, char ** argv)
{
for (int i = 1; i < argc; ++i)
{
wivrn::vdf::root doc{argv[i]};
dump(doc);
}
}
#endif
@@ -1,6 +1,6 @@
/*
* WiVRn VR streaming
* Copyright (C) 2025 Guillaume Meunier <guillaume.meunier@centraliens.net>
* Copyright (C) 2026 Patrick Nicolas <patricknicolas@laposte.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,28 +18,37 @@
#pragma once
#include <any>
#include <filesystem>
#include <optional>
#include <unordered_map>
#include <string_view>
#include <variant>
#include <vector>
namespace wivrn
{
struct steam_icon
namespace vdf
{
std::string clienticon;
std::string linuxclienticon;
struct string
{
std::string_view data;
bool operator==(const char *) const;
};
struct steam_shortcut
struct keyvalue
{
uint32_t appid;
std::string name;
std::optional<std::filesystem::path> icon;
string key;
std::variant<string, std::vector<keyvalue>> value;
};
std::unordered_map<uint32_t, steam_icon> read_steam_icons(std::filesystem::path path);
std::vector<steam_shortcut> read_steam_shortcuts(std::filesystem::path path);
struct root : public keyvalue
{
root(const std::filesystem::path &);
private:
std::any opaque;
};
} // namespace vdf
} // namespace wivrn
+4 -2
View File
@@ -45,7 +45,7 @@ std::filesystem::path xdg_cache_home()
std::filesystem::path xdg_data_home()
{
if (const char * xdg_data_home = std::getenv("XDG_DATA_HOME"))
if (const char * xdg_data_home = std::getenv("XDG_DATA_HOME"); xdg_data_home and *xdg_data_home)
return xdg_data_home;
if (const char * home = std::getenv("HOME"))
@@ -71,9 +71,11 @@ std::vector<std::filesystem::path> xdg_config_dirs()
return paths;
}
std::vector<std::filesystem::path> xdg_data_dirs()
std::vector<std::filesystem::path> xdg_data_dirs(bool include_data_home)
{
std::vector<std::filesystem::path> paths;
if (include_data_home)
paths.push_back(xdg_data_home());
if (const char * xdg_config_dirs = std::getenv("XDG_DATA_DIRS"))
{
+1 -1
View File
@@ -26,4 +26,4 @@ std::filesystem::path xdg_config_home();
std::filesystem::path xdg_cache_home();
std::filesystem::path xdg_data_home();
std::vector<std::filesystem::path> xdg_config_dirs();
std::vector<std::filesystem::path> xdg_data_dirs();
std::vector<std::filesystem::path> xdg_data_dirs(bool include_data_home = true);
+63 -38
View File
@@ -25,6 +25,7 @@
#include <algorithm>
#include <filesystem>
#include <format>
#include <fstream>
#include <limits>
#include <optional>
@@ -107,51 +108,75 @@ void find_icon_theme_dirs_helper(const std::vector<std::filesystem::path> & base
const auto theme_dir = base_dir / "icons" / theme;
const auto index_theme = theme_dir / "index.theme";
if (not std::filesystem::exists(index_theme))
continue;
try
if (std::filesystem::exists(index_theme))
{
std::ifstream file{index_theme};
wivrn::ini index{file};
for (const auto & inherited_theme: utils::split(index.get<std::string>("Icon Theme", "Inherits", ""), ","))
try
{
if (inherited_theme != "" and not std::ranges::contains(themes, inherited_theme))
themes.push_back(inherited_theme);
std::ifstream file{index_theme};
wivrn::ini index{file};
for (const auto & inherited_theme: utils::split(index.get<std::string>("Icon Theme", "Inherits", ""), ","))
{
if (inherited_theme != "" and not std::ranges::contains(themes, inherited_theme))
themes.push_back(inherited_theme);
}
for (auto directory: utils::split(index.get<std::string>("Icon Theme", "Directories", ""), ","))
{
int size = index.get<int>(directory, "Size");
int scale = index.get<int>(directory, "Scale", 1);
int min_size = index.get<int>(directory, "MinSize", size);
int max_size = index.get<int>(directory, "MaxSize", size);
int threshold = index.get<int>(directory, "Threshold", 2);
std::string type_str = index.get<std::string>(directory, "Type", "Threshold");
icon_theme_type type = icon_theme_type::threshold;
if (type_str == "Fixed")
type = icon_theme_type::fixed;
else if (type_str == "Scalable")
type = icon_theme_type::scalable;
else if (type_str == "Threshold")
type = icon_theme_type::threshold;
dirs.push_back(icon_theme_dir{
.path = theme_dir / directory,
.size = size,
.scale = scale,
.type = type,
.min_size = min_size,
.max_size = max_size,
.threshold = threshold,
});
}
}
for (auto directory: utils::split(index.get<std::string>("Icon Theme", "Directories", ""), ","))
catch (std::exception & e)
{
int size = index.get<int>(directory, "Size");
int scale = index.get<int>(directory, "Scale", 1);
int min_size = index.get<int>(directory, "MinSize", size);
int max_size = index.get<int>(directory, "MaxSize", size);
int threshold = index.get<int>(directory, "Threshold", 2);
std::string type_str = index.get<std::string>(directory, "Type", "Threshold");
icon_theme_type type = icon_theme_type::threshold;
if (type_str == "Fixed")
type = icon_theme_type::fixed;
else if (type_str == "Scalable")
type = icon_theme_type::scalable;
else if (type_str == "Threshold")
type = icon_theme_type::threshold;
dirs.push_back(icon_theme_dir{
.path = theme_dir / directory,
.size = size,
.scale = scale,
.type = type,
.min_size = min_size,
.max_size = max_size,
.threshold = threshold,
});
}
}
catch (std::exception & e)
else if (theme == "hicolor")
{
// FIXME: full theme support
for (int size: {256})
dirs.push_back(icon_theme_dir{
.path = theme_dir / std::format("{}x{}/apps", size, size),
.size = size,
.scale = 1,
.type = icon_theme_type::threshold,
.min_size = size,
.max_size = size,
.threshold = 2,
});
dirs.push_back(icon_theme_dir{
.path = theme_dir / "scalable/apps",
.size = 128,
.scale = 1,
.type = icon_theme_type::scalable,
.min_size = 1,
.max_size = 256,
.threshold = 2,
});
}
}
}
+1 -1
View File
@@ -28,7 +28,7 @@
<li>Samsung Galaxy XR</li>
</ul>
<p>For desktop streaming, check out wlx-overlay-s.</p>
<p>For desktop streaming, check out WayVR.</p>
</description>
<developer id="io.github.wivrn.wivrn">
<name>Guillaume Meunier, Patrick Nicolas et al</name>
+9 -1
View File
@@ -165,7 +165,7 @@ Kirigami.ApplicationWindow {
text: i18n("Firewall may not allow port 9757")
type: Kirigami.MessageType.Warning
showCloseButton: true
visible: DashboardSettings.show_system_checks && Firewall.needSetup
visible: DashboardSettings.show_system_checks && Firewall.needSetup && Settings.port == Settings.default_port
actions: [
Kirigami.Action {
text: i18n("Fix it")
@@ -188,6 +188,14 @@ Kirigami.ApplicationWindow {
]
}
Kirigami.InlineMessage {
Layout.fillWidth: true
text: Settings.flatpak ? i18n("Vulkan drivers cannot be found, you may need to run \"flatpak update\"") : i18n("Vulkan drivers cannot be found")
type: Kirigami.MessageType.Warning
showCloseButton: true
visible: DashboardSettings.show_system_checks && (VulkanInfo.type == VulkanInfo.SoftGPU || VulkanInfo.type == VulkanInfo.NoGPU)
}
Kirigami.InlineMessage {
Layout.fillWidth: true
text: i18n("Use the Mesa (radv) driver for AMD GPUs\nHardware encoding with vaapi does not work with AMDVLK and AMDGPU-PRO")
+3 -20
View File
@@ -7,8 +7,6 @@ import io.github.wivrn.wivrn
ColumnLayout {
id: select_game
property bool json_loaded: false
Component.onCompleted: {
apps.append({
"name": i18nc("don't start an application automatically", "None"),
@@ -75,13 +73,8 @@ ColumnLayout {
}
}
function reload() {
select_game.json_loaded = false;
load();
}
function load() {
if (select_game.json_loaded || WivrnServer.serverStatus != WivrnServer.Started || WivrnServer.jsonConfiguration == "")
if (WivrnServer.jsonConfiguration == "")
return;
Settings.load(WivrnServer);
@@ -103,22 +96,12 @@ ColumnLayout {
app_text.text = Settings.application;
app_combobox.currentIndex = custom_idx;
}
select_game.json_loaded = true;
}
function save() {
var new_application;
if (apps.get(app_combobox.currentIndex).is_custom)
new_application = app_text.text;
Settings.application = app_text.text;
else
new_application = apps.get(app_combobox.currentIndex).command;
Settings.load(WivrnServer);
if (Settings.application != new_application) {
Settings.application = new_application;
Settings.save(WivrnServer);
}
Settings.application = apps.get(app_combobox.currentIndex).command;
}
}
+45 -1
View File
@@ -21,6 +21,7 @@
#include "escape_string.h"
#include "gui_config.h"
#include "utils/flatpak.h"
#include "wivrn_config.h"
#include "wivrn_server.h"
#include <QList>
#include <QObject>
@@ -121,6 +122,8 @@ void Settings::emitAllChanged()
debugGuiChanged();
steamVrLhChanged();
hidForwardingChanged();
portChanged();
hostnameChanged();
}
void Settings::load(const wivrn_server * server)
@@ -429,6 +432,40 @@ void Settings::set_tcpOnly(const bool & value)
tcpOnlyChanged();
}
int Settings::port() const
{
auto it = m_jsonSettings.find("port");
if (it != m_jsonSettings.end() and it->is_number_integer())
return *it;
return wivrn::default_port;
}
void Settings::set_port(const int & value)
{
auto old = port();
m_jsonSettings["port"] = value;
if (old != value)
portChanged();
}
QString Settings::hostname() const
{
if (auto it = m_jsonSettings.find("hostname"); it != m_jsonSettings.end() and it->is_string())
return QString::fromStdString(*it);
return "";
}
void Settings::set_hostname(const QString & value)
{
auto old = hostname();
if (value == "")
m_jsonSettings.erase("hostname");
else
m_jsonSettings["hostname"] = value.toStdString();
if (old != value)
hostnameChanged();
}
QString Settings::openvr() const
{
// OpenVR compat library
@@ -452,7 +489,7 @@ void Settings::set_openvr(const QString & value)
else
m_jsonSettings["openvr-compat-path"] = value.toStdString();
if (old != value)
tcpOnlyChanged();
openvrChanged();
}
QList<Settings::video_codec> Settings::allowedCodecs() const
@@ -504,6 +541,8 @@ void Settings::restore_defaults()
m_jsonSettings.erase("use-steamvr-lh");
m_jsonSettings.erase("tcp-only");
m_jsonSettings.erase("application");
m_jsonSettings.erase("port");
m_jsonSettings.erase("hostname");
emitAllChanged();
}
@@ -512,6 +551,11 @@ bool Settings::flatpak() const
return wivrn::is_flatpak();
}
int Settings::default_port() const
{
return wivrn::default_port;
}
bool Settings::debug_gui() const
{
#if WIVRN_FEATURE_DEBUG_GUI
+6
View File
@@ -68,6 +68,8 @@ public:
Q_PROPERTY(bool tenbit READ tenbit WRITE set_tenbit NOTIFY tenbitChanged)
Q_PROPERTY(bool tcpOnly READ tcpOnly WRITE set_tcpOnly NOTIFY tcpOnlyChanged)
Q_PROPERTY(int port READ port WRITE set_port NOTIFY portChanged)
Q_PROPERTY(QString hostname READ hostname WRITE set_hostname NOTIFY hostnameChanged)
Q_PROPERTY(QString application READ application WRITE set_application NOTIFY applicationChanged)
Q_PROPERTY(QString openvr READ openvr WRITE set_openvr NOTIFY openvrChanged)
@@ -76,6 +78,7 @@ public:
Q_PROPERTY(bool steamVrLh READ steamVrLh WRITE set_steamVrLh NOTIFY steamVrLhChanged)
Q_PROPERTY(bool flatpak READ flatpak CONSTANT)
Q_PROPERTY(int default_port READ default_port CONSTANT)
Q_PROPERTY(bool hid_forwarding_supported READ hid_forwarding CONSTANT)
Q_PROPERTY(bool debug_gui_supported READ debug_gui CONSTANT)
Q_PROPERTY(bool steamvr_lh_supported READ steamvr_lh CONSTANT)
@@ -89,6 +92,8 @@ public:
SETTER_GETTER_NOTIFY(bool, debugGui)
SETTER_GETTER_NOTIFY(bool, steamVrLh)
SETTER_GETTER_NOTIFY(bool, tcpOnly)
SETTER_GETTER_NOTIFY(int, port)
SETTER_GETTER_NOTIFY(QString, hostname)
SETTER_GETTER_NOTIFY(QString, openvr)
private:
nlohmann::json m_jsonSettings = nlohmann::json::object();
@@ -107,6 +112,7 @@ public:
bool can10bit() const;
bool flatpak() const;
int default_port() const;
bool debug_gui() const;
bool steamvr_lh() const;
bool hid_forwarding() const;
+34 -6
View File
@@ -24,14 +24,40 @@
vulkan_info::vulkan_info()
{
vk::raii::Context context;
try
{
vk::raii::Context context;
vk::ApplicationInfo app_info{"WiVRn dashboard", 1, "No engine", 1, VK_API_VERSION_1_1};
vk::InstanceCreateInfo instance_info{vk::InstanceCreateFlags{0}, &app_info};
vk::raii::Instance vulkan{context, instance_info};
vk::ApplicationInfo app_info{"WiVRn dashboard", 1, "No engine", 1, VK_API_VERSION_1_1};
vk::InstanceCreateInfo instance_info{vk::InstanceCreateFlags{0}, &app_info};
vk::raii::Instance vulkan{context, instance_info};
auto devices = vulkan.enumeratePhysicalDevices();
set_info(choose_device(devices));
auto devices = vulkan.enumeratePhysicalDevices();
set_info(choose_device(devices));
}
catch (std::runtime_error & e)
{
qCritical() << "Failed to get vulkan info: " << e.what();
}
}
static vulkan_info::gpu_type cast_type(vk::PhysicalDeviceType type)
{
switch (type)
{
case vk::PhysicalDeviceType::eOther:
return vulkan_info::OtherGPU;
case vk::PhysicalDeviceType::eIntegratedGpu:
return vulkan_info::IGPU;
case vk::PhysicalDeviceType::eDiscreteGpu:
return vulkan_info::DGPU;
case vk::PhysicalDeviceType::eVirtualGpu:
return vulkan_info::VirtGPU;
case vk::PhysicalDeviceType::eCpu:
return vulkan_info::SoftGPU;
}
qCritical() << "invalid GPU type enum " << int(type);
return vulkan_info::OtherGPU;
}
vk::raii::PhysicalDevice & vulkan_info::choose_device(std::vector<vk::raii::PhysicalDevice> & devices)
@@ -70,5 +96,7 @@ void vulkan_info::set_info(vk::raii::PhysicalDevice & device)
break;
}
m_type = cast_type(prop.properties.deviceType);
qDebug() << "Driver" << m_driverId << m_driverVersion;
}
+19 -1
View File
@@ -33,14 +33,27 @@ class vulkan_info : public QObject
Q_OBJECT
QML_NAMED_ELEMENT(VulkanInfo)
QML_SINGLETON
public:
enum gpu_type
{
DGPU,
IGPU,
SoftGPU,
VirtGPU,
OtherGPU,
NoGPU,
};
Q_ENUM(gpu_type)
Q_PROPERTY(QString driverId READ driverId CONSTANT)
Q_PROPERTY(QString driverVersion READ driverVersion CONSTANT)
Q_PROPERTY(uint32_t driverVersionCode READ driverVersionCode CONSTANT)
Q_PROPERTY(gpu_type type READ type CONSTANT)
QString m_driverId;
QString m_driverVersion;
uint32_t m_driverVersionCode;
uint32_t m_driverVersionCode{};
gpu_type m_type = NoGPU;
vk::raii::PhysicalDevice & choose_device(std::vector<vk::raii::PhysicalDevice> & devices);
void set_info(vk::raii::PhysicalDevice & device);
@@ -62,4 +75,9 @@ public:
{
return m_driverVersionCode;
}
gpu_type type() const
{
return m_type;
}
};
+10
View File
@@ -158,3 +158,13 @@ Default value: `false`
Only available when built with `WIVRN_FEATURE_STEAMVR_LIGHTHOUSE`
Enables the driver to load SteamVR Lighthouse devices.
## `port`
Default value: `9757`
Change the TCP/UDP port used for the connection.
## `hostname`
Default value: unset
If set, overrides the name displayed in the server list.
+956
View File
@@ -0,0 +1,956 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef BEMAN_INPLACE_VECTOR_INPLACE_VECTOR_HPP
#define BEMAN_INPLACE_VECTOR_INPLACE_VECTOR_HPP
#if !defined(__has_include) || __has_include(<beman/inplace_vector/config.hpp>)
#include <beman/inplace_vector/config.hpp>
#endif
#include <algorithm> // for rotate...
#include <array>
#include <compare>
#include <concepts> // for lots...
#include <cstddef> // for size_t
#include <cstdint> // for fixed-width integer types
#include <iterator> // for reverse_iterator and iterator traits
#include <limits> // for numeric_limits
#include <memory> // for destroy
#include <ranges>
#include <type_traits> // for aligned_storage and all meta-functions
// Artifact from previous implementation, can be used as hints for optimizer
#define IV_EXPECT(EXPR)
#ifndef BEMAN_IV_THROW_OR_ABORT
#ifndef BEMAN_INPLACE_VECTOR_NO_EXCEPTIONS
#define BEMAN_INPLACE_VECTOR_NO_EXCEPTIONS() 0
#endif
#if BEMAN_INPLACE_VECTOR_NO_EXCEPTIONS()
#include <cstdlib> // for abort
#define BEMAN_IV_THROW_OR_ABORT(x) abort()
#else
#include <stdexcept> // for length_error
#define BEMAN_IV_THROW_OR_ABORT(x) throw x
#endif
#endif
// Private utilities
namespace beman::inplace_vector::details {
struct from_range_t {};
inline constexpr from_range_t from_range;
// clang-format off
// Smallest unsigned integer that can represent values in [0, N].
template <size_t N>
using smallest_size_t
= std::conditional_t<(N < std::numeric_limits<uint8_t>::max()), uint8_t,
std::conditional_t<(N < std::numeric_limits<uint16_t>::max()), uint16_t,
std::conditional_t<(N < std::numeric_limits<uint32_t>::max()), uint32_t,
std::conditional_t<(N < std::numeric_limits<uint64_t>::max()), uint64_t,
size_t>>>>;
// clang-format on
// Index a random-access and sized range doing bound checks in debug builds
template <std::ranges::random_access_range Rng, std::integral Index>
static constexpr decltype(auto) index(Rng &&rng, Index i) noexcept
requires(std::ranges::sized_range<Rng>)
{
IV_EXPECT(static_cast<ptrdiff_t>(i) < std::ranges::size(rng));
return std::begin(std::forward<Rng>(rng))[std::forward<Index>(i)];
}
// http://eel.is/c++draft/container.requirements.general#container.intro.reqmts-2
template <class Rng, class T>
concept container_compatible_range =
std::ranges::input_range<Rng> &&
std::convertible_to<std::ranges::range_reference_t<Rng>, T>;
template <typename T>
concept satisfy_triviality = std::is_trivially_copyable_v<T> &&
std::is_trivially_default_constructible_v<T> &&
std::is_trivially_destructible_v<T>;
template <typename T, std::size_t N>
concept satisfy_constexpr = N == 0 || satisfy_triviality<T>;
template <typename T>
concept lessthan_comparable = requires(const T &a, const T &b) {
{ a < b } -> std::convertible_to<bool>;
};
// Types implementing the `inplace_vector`'s storage
namespace storage {
// Storage for zero elements.
template <class T> struct zero_sized {
protected:
using size_type = uint8_t;
static constexpr T *storage_data() noexcept { return nullptr; }
static constexpr size_type storage_size() noexcept { return 0; }
static constexpr void
unsafe_set_size([[maybe_unused]] size_t new_size) noexcept {
IV_EXPECT(new_size == 0 &&
"tried to change size of empty storage to non-zero value");
}
public:
constexpr zero_sized() = default;
constexpr zero_sized(zero_sized const &) = default;
constexpr zero_sized &operator=(zero_sized const &) = default;
constexpr zero_sized(zero_sized &&) = default;
constexpr zero_sized &operator=(zero_sized &&) = default;
constexpr ~zero_sized() = default;
};
// Storage for trivial types.
template <class T, size_t N> struct trivial {
static_assert(satisfy_triviality<T>,
"storage::trivial<T, C> requires Trivial<T>");
static_assert(N != size_t{0}, "N == 0, use zero_sized");
protected:
using size_type = smallest_size_t<N>;
private:
using array_based_storage = std::array<std::remove_const_t<T>, N>;
alignas(alignof(T)) array_based_storage storage_data_{};
size_type storage_size_ = 0;
protected:
constexpr const T *storage_data() const noexcept {
return storage_data_.data();
}
constexpr auto storage_data() noexcept { return storage_data_.data(); }
constexpr size_type storage_size() const noexcept { return storage_size_; }
constexpr void unsafe_set_size(size_t new_size) noexcept {
IV_EXPECT(size_type(new_size) <= N && "new_size out-of-bounds [0, N]");
storage_size_ = size_type(new_size);
}
public:
constexpr trivial() noexcept = default;
constexpr trivial(trivial const &) noexcept = default;
constexpr trivial &operator=(trivial const &) noexcept = default;
constexpr trivial(trivial &&) noexcept = default;
constexpr trivial &operator=(trivial &&) noexcept = default;
constexpr ~trivial() = default;
};
// This is the base storage for non-trivial types.
// In this storage solution, elements are stored in type-erased byte storage,
// thus, reinterpret_cast must be used,
// which makes inplace_vector of non-trivial types non-constexpr-friendly.
//
// Note: This is not used if trivial union is supported.
template <class T, size_t N> struct raw_byte_based_storage {
alignas(T) std::byte _d[sizeof(T) * N];
T *storage_data(size_t i) noexcept {
IV_EXPECT(i < N);
return reinterpret_cast<T *>(_d) + i;
}
const T *storage_data(size_t i) const noexcept {
IV_EXPECT(i < N);
return reinterpret_cast<const T *>(_d) + i;
}
};
/// Storage for non-trivial elements.
template <class T, size_t N> struct non_trivial {
static_assert(!satisfy_triviality<T>,
"use storage::trivial for Trivial<T> elements");
static_assert(N != size_t{0}, "use storage::zero for N==0");
protected:
using size_type = smallest_size_t<N>;
private:
using byte_based_storage = raw_byte_based_storage<std::remove_const_t<T>, N>;
byte_based_storage storage_data_{}; // BUGBUG: test SIMD types
size_type storage_size_ = 0;
protected:
constexpr const T *storage_data() const noexcept {
return storage_data_.storage_data(0);
}
constexpr auto storage_data() noexcept {
return storage_data_.storage_data(0);
}
constexpr size_type storage_size() const noexcept { return storage_size_; }
constexpr void unsafe_set_size(size_t new_size) noexcept {
IV_EXPECT(size_type(new_size) <= N && "new_size out-of-bounds [0, N)");
storage_size_ = size_type(new_size);
}
public:
constexpr non_trivial() noexcept = default;
constexpr non_trivial(non_trivial const &) noexcept = default;
constexpr non_trivial &operator=(non_trivial const &) noexcept = default;
constexpr non_trivial(non_trivial &&) noexcept = default;
constexpr non_trivial &operator=(non_trivial &&) noexcept = default;
constexpr ~non_trivial()
requires(std::is_trivially_destructible_v<T>)
= default;
constexpr ~non_trivial() {
std::destroy(storage_data(), storage_data() + storage_size());
}
};
// Selects the vector storage.
template <class T, size_t N>
using storage_for = std::conditional_t<
!satisfy_constexpr<T, N>, non_trivial<T, N>,
std::conditional_t<N == 0, zero_sized<T>, trivial<T, N>>>;
} // namespace storage
template <class T, size_t N>
struct inplace_vector_base : private storage::storage_for<T, N> {
protected:
static_assert(std::is_nothrow_destructible_v<T>,
"T must be nothrow destructible");
using base_t = storage::storage_for<T, N>;
using base_t::storage_data;
using base_t::storage_size;
using base_t::unsafe_set_size;
public:
using value_type = T;
using pointer = T *;
using const_pointer = const T *;
using reference = value_type &;
using const_reference = const value_type &;
using size_type = size_t;
using difference_type = std::ptrdiff_t;
using iterator = pointer;
using const_iterator = const_pointer;
using reverse_iterator = std::reverse_iterator<iterator>;
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
// iterators
constexpr iterator begin() noexcept { return storage_data(); }
constexpr const_iterator begin() const noexcept { return storage_data(); }
constexpr iterator end() noexcept { return begin() + size(); }
constexpr const_iterator end() const noexcept { return begin() + size(); }
constexpr reverse_iterator rbegin() noexcept {
return reverse_iterator(end());
}
constexpr const_reverse_iterator rbegin() const noexcept {
return const_reverse_iterator(end());
}
constexpr reverse_iterator rend() noexcept {
return reverse_iterator(begin());
}
constexpr const_reverse_iterator rend() const noexcept {
return const_reverse_iterator(begin());
}
constexpr const_iterator cbegin() const noexcept { return storage_data(); }
constexpr const_iterator cend() const noexcept { return cbegin() + size(); }
constexpr const_reverse_iterator crbegin() const noexcept {
return const_reverse_iterator(cend());
}
constexpr const_reverse_iterator crend() const noexcept {
return const_reverse_iterator(cbegin());
}
// [inplace.vector.capacity], size/capacity
[[nodiscard]] constexpr bool empty() const noexcept {
return storage_size() == 0;
};
constexpr size_type size() const noexcept { return storage_size(); }
constexpr void shrink_to_fit() {}
static constexpr size_type max_size() noexcept { return N; }
static constexpr size_type capacity() noexcept { return N; }
// element access
constexpr reference operator[](size_type n) {
return details::index(*this, n);
}
constexpr const_reference operator[](size_type n) const {
return details::index(*this, n);
}
constexpr reference front() { return details::index(*this, size_type(0)); }
constexpr const_reference front() const {
return details::index(*this, size_type(0));
}
constexpr reference back() {
return details::index(*this, size() - size_type(1));
}
constexpr const_reference back() const {
return details::index(*this, size() - size_type(1));
}
// [containers.sequences.inplace_vector.data], data access
constexpr T *data() noexcept { return storage_data(); }
constexpr const T *data() const noexcept { return storage_data(); }
protected: // Utilities
constexpr void
assert_iterator_in_range([[maybe_unused]] const_iterator it) noexcept {
IV_EXPECT(begin() <= it && "iterator not in range");
IV_EXPECT(it <= end() && "iterator not in range");
}
constexpr void
assert_valid_iterator_pair([[maybe_unused]] const_iterator first,
[[maybe_unused]] const_iterator last) noexcept {
IV_EXPECT(first <= last && "invalid iterator pair");
}
constexpr void assert_iterator_pair_in_range(const_iterator first,
const_iterator last) noexcept {
assert_iterator_in_range(first);
assert_iterator_in_range(last);
assert_valid_iterator_pair(first, last);
}
constexpr void
unsafe_destroy(T *first,
T *last) noexcept(std::is_nothrow_destructible_v<T>) {
assert_iterator_pair_in_range(first, last);
if constexpr (N > 0 && !std::is_trivially_destructible_v<T>) {
for (; first != last; ++first)
first->~T();
}
}
public:
// [inplace.vector.modifiers], modifiers
template <class... Args>
constexpr T &unchecked_emplace_back(Args &&...args)
requires(std::constructible_from<T, Args...>)
{
IV_EXPECT(size() < capacity() && "inplace_vector out-of-memory");
std::construct_at(storage_data() + size(), std::forward<Args>(args)...);
unsafe_set_size(size() + size_type(1));
return this->back();
}
template <class... Args> constexpr T *try_emplace_back(Args &&...args) {
if (size() == capacity()) [[unlikely]]
return nullptr;
return &unchecked_emplace_back(std::forward<Args>(args)...);
}
constexpr T *try_push_back(const T &x)
requires(std::constructible_from<T, const T &>)
{
return try_emplace_back(x);
}
constexpr T *try_push_back(T &&x)
requires(std::constructible_from<T, T &&>)
{
return try_emplace_back(std::forward<T &&>(x));
}
constexpr T &unchecked_push_back(const T &x)
requires(std::constructible_from<T, const T &>)
{
return unchecked_emplace_back(x);
}
constexpr T &unchecked_push_back(T &&x)
requires(std::constructible_from<T, T &&>)
{
return unchecked_emplace_back(std::forward<T &&>(x));
}
template <details::container_compatible_range<T> R>
constexpr std::ranges::borrowed_iterator_t<R> try_append_range(R &&rg)
requires(std::constructible_from<T, std::ranges::range_reference_t<R>>)
{
auto it = std::ranges::begin(rg);
const auto end = std::ranges::end(rg);
for (; size() != capacity() && it != end; ++it) {
unchecked_emplace_back(*it);
}
return it;
}
constexpr iterator erase(const_iterator first, const_iterator last)
requires(std::movable<T>)
{
assert_iterator_pair_in_range(first, last);
iterator f = begin() + (first - begin());
if (first != last) {
unsafe_destroy(std::move(f + (last - first), end(), f), end());
unsafe_set_size(size() - static_cast<size_type>(last - first));
}
return f;
}
constexpr iterator erase(const_iterator position)
requires(std::movable<T>)
{
return erase(position, position + 1);
}
constexpr void clear() noexcept {
unsafe_destroy(begin(), end());
unsafe_set_size(0);
}
constexpr void pop_back() {
IV_EXPECT(size() > 0 && "pop_back from empty inplace_vector!");
if (size() > 0) { // UB fail-safe
unsafe_destroy(end() - 1, end());
unsafe_set_size(size() - 1);
}
}
constexpr friend bool operator==(const inplace_vector_base &x,
const inplace_vector_base &y) {
return x.size() == y.size() && std::ranges::equal(x, y);
}
constexpr void swap(inplace_vector_base &x) noexcept(
N == 0 || (std::is_nothrow_swappable_v<T> &&
std::is_nothrow_move_constructible_v<T>))
requires(std::movable<T>)
{
auto tmp = std::move(x);
x = std::move(*this);
(*this) = std::move(tmp);
}
constexpr friend void
swap(inplace_vector_base &x, inplace_vector_base &y) noexcept(
N == 0 || (std::is_nothrow_swappable_v<T> &&
std::is_nothrow_move_constructible_v<T>)) {
x.swap(y);
}
constexpr friend auto operator<=>(const inplace_vector_base &x,
const inplace_vector_base &y)
requires(details::lessthan_comparable<T>)
{
if constexpr (std::three_way_comparable<T>) {
return std::lexicographical_compare_three_way(x.begin(), x.end(),
y.begin(), y.end());
} else {
const auto sz = std::min(x.size(), y.size());
for (std::size_t i = 0; i < sz; ++i) {
if (x[i] < y[i])
return std::strong_ordering::less;
if (y[i] < x[i])
return std::strong_ordering::greater;
// [container.opt.reqmts] < must be total ordering relationship
}
return x.size() <=> y.size();
}
}
// [containers.sequences.inplace_vector.cons], construct/copy/destroy
constexpr inplace_vector_base() noexcept = default;
constexpr inplace_vector_base(const inplace_vector_base &x)
requires(N == 0 || std::is_trivially_copy_constructible_v<T>)
= default;
constexpr inplace_vector_base(const inplace_vector_base &x)
requires(N != 0 && !std::is_trivially_copy_constructible_v<T> &&
std::copyable<T>)
{
for (auto &&e : x)
unchecked_emplace_back(e);
}
constexpr inplace_vector_base(inplace_vector_base &&x)
requires(N == 0 || std::is_trivially_move_constructible_v<T>)
= default;
constexpr inplace_vector_base(inplace_vector_base &&x)
requires(N != 0 && !std::is_trivially_move_constructible_v<T> &&
std::movable<T>)
{
for (auto &&e : x)
unchecked_emplace_back(std::move(e));
}
constexpr inplace_vector_base &operator=(const inplace_vector_base &x)
requires(N == 0 || (std::is_trivially_destructible_v<T> &&
std::is_trivially_copy_constructible_v<T> &&
std::is_trivially_copy_assignable_v<T>))
= default;
constexpr inplace_vector_base &operator=(const inplace_vector_base &x)
requires(N != 0 &&
!(std::is_trivially_destructible_v<T> &&
std::is_trivially_copy_constructible_v<T> &&
std::is_trivially_copy_assignable_v<T>) &&
std::copyable<T>)
{
clear();
for (auto &&e : x)
unchecked_emplace_back(e);
return *this;
}
constexpr inplace_vector_base &operator=(inplace_vector_base &&x)
requires(N == 0 || (std::is_trivially_destructible_v<T> &&
std::is_trivially_move_constructible_v<T> &&
std::is_trivially_move_assignable_v<T>))
= default;
constexpr inplace_vector_base &operator=(inplace_vector_base &&x)
requires(N != 0 &&
!(std::is_trivially_destructible_v<T> &&
std::is_trivially_move_constructible_v<T> &&
std::is_trivially_move_assignable_v<T>) &&
std::movable<T>)
{
clear();
for (auto &&e : x)
unchecked_emplace_back(std::move(e));
return *this;
}
};
} // namespace beman::inplace_vector::details
namespace beman::inplace_vector {
template <typename IV>
concept has_constexpr_support =
details::satisfy_constexpr<typename IV::value_type, IV::capacity()>;
/// Dynamically-resizable fixed-N vector with inplace storage.
template <class T, size_t N>
struct inplace_vector : public details::inplace_vector_base<T, N> {
using value_type = T;
using pointer = T *;
using const_pointer = const T *;
using reference = value_type &;
using const_reference = const value_type &;
using size_type = size_t;
using difference_type = std::ptrdiff_t;
using iterator = pointer;
using const_iterator = const_pointer;
using reverse_iterator = std::reverse_iterator<iterator>;
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
// [containers.sequences.inplace_vector.modifiers], modifiers
template <class... Args>
constexpr T &emplace_back(Args &&...args)
requires(std::constructible_from<T, Args...>)
{
if (!this->try_emplace_back(std::forward<Args>(args)...)) [[unlikely]] {
BEMAN_IV_THROW_OR_ABORT(std::bad_alloc());
}
return this->back();
}
constexpr T &push_back(const T &x)
requires(std::constructible_from<T, const T &>)
{
emplace_back(x);
return this->back();
}
constexpr T &push_back(T &&x)
requires(std::constructible_from<T, T &&>)
{
emplace_back(std::forward<T &&>(x));
return this->back();
}
template <details::container_compatible_range<T> R>
constexpr void append_range(R &&rg)
requires(std::constructible_from<T, std::ranges::range_reference_t<R>>)
{
if constexpr (std::ranges::sized_range<R>) {
if (this->size() + std::ranges::size(rg) > this->capacity())
[[unlikely]] {
BEMAN_IV_THROW_OR_ABORT(std::bad_alloc());
}
}
for (auto &&e : rg) {
if (this->size() == this->capacity()) [[unlikely]] {
BEMAN_IV_THROW_OR_ABORT(std::bad_alloc());
}
emplace_back(std::forward<decltype(e)>(e));
}
}
template <class... Args>
constexpr iterator emplace(const_iterator position, Args &&...args)
requires(std::constructible_from<T, Args...> && std::movable<T>)
{
this->assert_iterator_in_range(position);
auto b = this->end();
emplace_back(std::forward<Args>(args)...);
auto pos = this->begin() + (position - this->begin());
std::rotate(pos, b, this->end());
return pos;
}
template <class InputIterator>
constexpr iterator insert(const_iterator position, InputIterator first,
InputIterator last)
requires(std::constructible_from<T, std::iter_reference_t<InputIterator>> &&
std::movable<T>)
{
this->assert_iterator_in_range(position);
if constexpr (std::random_access_iterator<InputIterator>) {
if (this->size() + static_cast<size_type>(std::distance(first, last)) >
this->capacity()) [[unlikely]] {
BEMAN_IV_THROW_OR_ABORT(std::bad_alloc());
}
}
auto b = this->end();
for (; first != last; ++first)
emplace_back(*first);
auto pos = this->begin() + (position - this->begin());
std::rotate(pos, b, this->end());
return pos;
}
template <details::container_compatible_range<T> R>
constexpr iterator insert_range(const_iterator position, R &&rg)
requires(std::constructible_from<T, std::ranges::range_reference_t<R>> &&
std::movable<T>)
{
return insert(position, std::begin(rg), std::end(rg));
}
constexpr iterator insert(const_iterator position,
std::initializer_list<T> il)
requires(std::constructible_from<
T, std::ranges::range_reference_t<std::initializer_list<T>>> &&
std::movable<T>)
{
return insert_range(position, il);
}
constexpr iterator insert(const_iterator position, size_type n, const T &x)
requires(std::constructible_from<T, const T &> && std::copyable<T>)
{
this->assert_iterator_in_range(position);
auto b = this->end();
for (size_type i = 0; i < n; ++i)
emplace_back(x);
auto pos = this->begin() + (position - this->begin());
std::rotate(pos, b, this->end());
return pos;
}
constexpr iterator insert(const_iterator position, const T &x)
requires(std::constructible_from<T, const T &> && std::copyable<T>)
{
return insert(position, 1, x);
}
constexpr iterator insert(const_iterator position, T &&x)
requires(std::constructible_from<T, T &&> && std::movable<T>)
{
return emplace(position, std::move(x));
}
constexpr inplace_vector &operator=(std::initializer_list<T> il)
requires(std::constructible_from<
T, std::ranges::range_reference_t<std::initializer_list<T>>> &&
std::movable<T>)
{
assign_range(il);
return *this;
}
template <class InputIterator>
constexpr void assign(InputIterator first, InputIterator last)
requires(std::constructible_from<T, std::iter_reference_t<InputIterator>> &&
std::movable<T>)
{
this->clear();
insert(this->begin(), first, last);
}
template <details::container_compatible_range<T> R>
constexpr void assign_range(R &&rg)
requires(std::constructible_from<T, std::ranges::range_reference_t<R>> &&
std::movable<T>)
{
assign(std::begin(rg), std::end(rg));
}
constexpr void assign(size_type n, const T &u)
requires(std::constructible_from<T, const T &> && std::movable<T>)
{
this->clear();
insert(this->begin(), n, u);
}
constexpr void assign(std::initializer_list<T> il)
requires(std::constructible_from<
T, std::ranges::range_reference_t<std::initializer_list<T>>> &&
std::movable<T>)
{
this->clear();
insert_range(this->begin(), il);
}
// [inplace.vector.capacity], size/capacity
constexpr void reserve(size_type n) {
if (n > N) [[unlikely]] {
BEMAN_IV_THROW_OR_ABORT(std::bad_alloc());
}
}
constexpr void resize(size_type sz, const T &c)
requires(std::constructible_from<T, const T &> && std::copyable<T>)
{
if (sz == this->size())
return;
else if (sz > N) [[unlikely]] {
BEMAN_IV_THROW_OR_ABORT(std::bad_alloc());
} else if (sz > this->size())
insert(this->end(), sz - this->size(), c);
else {
this->unsafe_destroy(this->begin() + sz, this->end());
this->unsafe_set_size(sz);
}
}
constexpr void resize(size_type sz)
requires(std::constructible_from<T, T &&> && std::default_initializable<T>)
{
if (sz == this->size())
return;
else if (sz > N) [[unlikely]] {
BEMAN_IV_THROW_OR_ABORT(std::bad_alloc());
} else if (sz > this->size()) {
while (this->size() != sz)
emplace_back(T{});
} else {
this->unsafe_destroy(this->begin() + sz, this->end());
this->unsafe_set_size(sz);
}
}
// element access
constexpr reference at(size_type pos) {
if (pos >= this->size()) [[unlikely]] {
BEMAN_IV_THROW_OR_ABORT(std::out_of_range("inplace_vector::at"));
}
return details::index(*this, pos);
}
constexpr const_reference at(size_type pos) const {
if (pos >= this->size()) [[unlikely]] {
BEMAN_IV_THROW_OR_ABORT(std::out_of_range("inplace_vector::at"));
}
return details::index(*this, pos);
}
// [containers.sequences.inplace_vector.cons], construct/copy/destroy
constexpr inplace_vector() noexcept = default;
constexpr inplace_vector(std::initializer_list<T> il)
requires(std::constructible_from<
T, std::ranges::range_reference_t<std::initializer_list<T>>> &&
std::movable<T>)
{
insert(this->begin(), il);
}
constexpr inplace_vector(size_type n, const T &value)
requires(std::constructible_from<T, const T &> && std::copyable<T>)
{
insert(this->begin(), n, value);
}
constexpr explicit inplace_vector(size_type n)
requires(std::constructible_from<T, T &&> && std::default_initializable<T>)
{
for (size_type i = 0; i < n; ++i)
emplace_back(T{});
}
template <class InputIterator> // BUGBUG: why not std::ranges::input_iterator?
constexpr inplace_vector(InputIterator first, InputIterator last)
requires(std::constructible_from<T, std::iter_reference_t<InputIterator>> &&
std::movable<T>)
{
insert(this->begin(), first, last);
}
template <details::container_compatible_range<T> R>
constexpr inplace_vector(details::from_range_t, R &&rg)
requires(std::constructible_from<T, std::ranges::range_reference_t<R>> &&
std::movable<T>)
{
insert_range(this->begin(), std::forward<R &&>(rg));
}
};
namespace freestanding {
template <class T, size_t N>
struct inplace_vector : public details::inplace_vector_base<T, N> {
using value_type = T;
using pointer = T *;
using const_pointer = const T *;
using reference = value_type &;
using const_reference = const value_type &;
using size_type = size_t;
using difference_type = std::ptrdiff_t;
using iterator = pointer;
using const_iterator = const_pointer;
using reverse_iterator = std::reverse_iterator<iterator>;
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
// [containers.sequences.inplace_vector.modifiers], modifiers
template <class... Args>
constexpr T &emplace_back(Args &&...args)
requires(std::constructible_from<T, Args...>)
= delete;
constexpr T &push_back(const T &x)
requires(std::constructible_from<T, const T &>)
= delete;
constexpr T &push_back(T &&x)
requires(std::constructible_from<T, T &&>)
= delete;
template <details::container_compatible_range<T> R>
constexpr void append_range(R &&rg)
requires(std::constructible_from<T, std::ranges::range_reference_t<R>>)
= delete;
template <class... Args>
constexpr iterator emplace(const_iterator position, Args &&...args)
requires(std::constructible_from<T, Args...> && std::movable<T>)
= delete;
template <class InputIterator>
constexpr iterator insert(const_iterator position, InputIterator first,
InputIterator last)
requires(std::constructible_from<T, std::iter_reference_t<InputIterator>> &&
std::movable<T>)
= delete;
template <details::container_compatible_range<T> R>
constexpr iterator insert_range(const_iterator position, R &&rg)
requires(std::constructible_from<T, std::ranges::range_reference_t<R>> &&
std::movable<T>)
= delete;
constexpr iterator insert(const_iterator position,
std::initializer_list<T> il)
requires(std::constructible_from<
T, std::ranges::range_reference_t<std::initializer_list<T>>> &&
std::movable<T>)
= delete;
constexpr iterator insert(const_iterator position, size_type n, const T &x)
requires(std::constructible_from<T, const T &> && std::copyable<T>)
= delete;
constexpr iterator insert(const_iterator position, const T &x)
requires(std::constructible_from<T, const T &> && std::copyable<T>)
= delete;
constexpr iterator insert(const_iterator position, T &&x)
requires(std::constructible_from<T, T &&> && std::movable<T>)
= delete;
constexpr inplace_vector &operator=(std::initializer_list<T> il)
requires(std::constructible_from<
T, std::ranges::range_reference_t<std::initializer_list<T>>> &&
std::movable<T>)
= delete;
template <class InputIterator>
constexpr void assign(InputIterator first, InputIterator last)
requires(std::constructible_from<T, std::iter_reference_t<InputIterator>> &&
std::movable<T>)
= delete;
template <details::container_compatible_range<T> R>
constexpr void assign_range(R &&rg)
requires(std::constructible_from<T, std::ranges::range_reference_t<R>> &&
std::movable<T>)
= delete;
constexpr void assign(size_type n, const T &u)
requires(std::constructible_from<T, const T &> && std::movable<T>)
= delete;
constexpr void assign(std::initializer_list<T> il)
requires(std::constructible_from<
T, std::ranges::range_reference_t<std::initializer_list<T>>> &&
std::movable<T>)
= delete;
// [inplace.vector.capacity], size/capacity
constexpr void reserve(size_type n) = delete;
constexpr void resize(size_type sz, const T &c)
requires(std::constructible_from<T, const T &> && std::copyable<T>)
= delete;
constexpr void resize(size_type sz)
requires(std::constructible_from<T, T &&> && std::default_initializable<T>)
= delete;
// element access
constexpr reference at(size_type pos) = delete;
constexpr const_reference at(size_type pos) const = delete;
// [containers.sequences.inplace_vector.cons], construct/copy/destroy
constexpr inplace_vector() noexcept = default;
constexpr inplace_vector(std::initializer_list<T> il)
requires(std::constructible_from<
T, std::ranges::range_reference_t<std::initializer_list<T>>> &&
std::movable<T>)
= delete;
constexpr inplace_vector(size_type n, const T &value)
requires(std::constructible_from<T, const T &> && std::copyable<T>)
= delete;
constexpr explicit inplace_vector(size_type n)
requires(std::constructible_from<T, T &&> && std::default_initializable<T>)
= delete;
template <class InputIterator> // BUGBUG: why not std::ranges::input_iterator?
constexpr inplace_vector(InputIterator first, InputIterator last)
requires(std::constructible_from<T, std::iter_reference_t<InputIterator>> &&
std::movable<T>)
= delete;
template <details::container_compatible_range<T> R>
constexpr inplace_vector(beman::inplace_vector::details::from_range_t, R &&rg)
requires(std::constructible_from<T, std::ranges::range_reference_t<R>> &&
std::movable<T>)
= delete;
};
} // namespace freestanding
template <typename T, std::size_t N, typename U = T>
constexpr std::size_t erase(details::inplace_vector_base<T, N> &c,
const U &value) {
auto it = std::remove(c.begin(), c.end(), value);
auto r = std::distance(it, c.end());
c.erase(it, c.end());
return r;
}
template <typename T, std::size_t N, typename Predicate>
constexpr std::size_t erase_if(details::inplace_vector_base<T, N> &c,
Predicate pred) {
auto it = std::remove_if(c.begin(), c.end(), pred);
auto r = std::distance(it, c.end());
c.erase(it, c.end());
return r;
}
} // namespace beman::inplace_vector
#undef IV_EXPECT
#endif // BEMAN_INPLACE_VECTOR_INPLACE_VECTOR_HPP
+19530 -19558
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -58,7 +58,7 @@
# Keep in sync with CMakeLists.txt monado rev
rev = lib.strings.trim (builtins.readFile ./monado-rev);
# Nix will output the correct hash when it doesn't match
hash = "sha256-wGqvTI/X22apc8XCN3GCGQClHfBW5xk73mZnwWvHtyI=";
hash = "sha256-aIHry5C30pZVIkB5fptJ0Ncbmg8EKf0M7evB4IJZEI0=";
};
};
+42 -30
View File
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WiVRn-dashboard\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-02-02 14:05+0100\n"
"POT-Creation-Date: 2026-02-16 21:54+0100\n"
"PO-Revision-Date: 2025-11-19 20:20+0100\n"
"Last-Translator: Álvaro De Quinta <blackcherry@danwin1210.de>\n"
"Language-Team: Spanish <>\n"
@@ -119,8 +119,8 @@ msgstr "Comprobando la última versión..."
msgid "No APK is available for this version"
msgstr "No hay ningún APK disponible para esta versión"
#: dashboard/qml/ApkInstallPage.qml:45 dashboard/qml/Main.qml:368
#: dashboard/qml/Main.qml:426 dashboard/qml/WizardPage.qml:211
#: dashboard/qml/ApkInstallPage.qml:45 dashboard/qml/Main.qml:376
#: dashboard/qml/Main.qml:434 dashboard/qml/WizardPage.qml:211
#: dashboard/qml/WizardPage.qml:337
#, kde-format
msgid "ADB is not installed"
@@ -163,7 +163,7 @@ msgstr "Reinstalar WiVRn"
msgid "Install WiVRn"
msgstr "Instalar WiVRn"
#: dashboard/qml/HeadsetsPage.qml:12 dashboard/qml/Main.qml:431
#: dashboard/qml/HeadsetsPage.qml:12 dashboard/qml/Main.qml:439
#, kde-format
msgid "Headsets"
msgstr "Visores"
@@ -290,7 +290,7 @@ msgid "Avahi daemon is not started"
msgstr "El servicio Avahi no está iniciado"
#: dashboard/qml/Main.qml:157 dashboard/qml/Main.qml:171
#: dashboard/qml/Main.qml:223
#: dashboard/qml/Main.qml:231
#, kde-format
msgid "Fix it"
msgstr "Arreglarlo"
@@ -315,6 +315,18 @@ msgstr "Más información"
#: dashboard/qml/Main.qml:193
#, kde-format
msgid "Vulkan drivers cannot be found, you may need to run \"flatpak update\""
msgstr ""
"Los drivers Vulkan no se han encontrado, puede ser que necesite ejecutar "
"\"flatpak update\""
#: dashboard/qml/Main.qml:193
#, kde-format
msgid "Vulkan drivers cannot be found"
msgstr "Los drivers Vulkan no se han encontrado"
#: dashboard/qml/Main.qml:201
#, kde-format
msgid ""
"Use the Mesa (radv) driver for AMD GPUs\n"
"Hardware encoding with vaapi does not work with AMDVLK and AMDGPU-PRO"
@@ -322,7 +334,7 @@ msgstr ""
"Usa el controlador Mesa (radv) para las GPU AMD\n"
"La codificación por hardware con vaapi no funciona con AMDVLK y AMDGPU-PRO"
#: dashboard/qml/Main.qml:201
#: dashboard/qml/Main.qml:209
#, kde-format
msgid ""
"No OpenVR compatibility detected, Steam games won't be able to load VR.\n"
@@ -332,127 +344,127 @@ msgstr ""
"en VR.\n"
"Instala xrizer o OpenComposite."
#: dashboard/qml/Main.qml:209
#: dashboard/qml/Main.qml:217
#, kde-format
msgid "Steam is installed as a snap. Snaps are not compatible with WiVRn."
msgstr ""
"Steam está instalado mediante snap. Los Snaps no son compatibles con WiVRn."
#: dashboard/qml/Main.qml:217
#: dashboard/qml/Main.qml:225
#, kde-format
msgid ""
"Steam is installed as a flatpak but does not have sufficient permissions."
msgstr ""
"Steam está instalado con flatpak, pero no tiene los suficientes permisos."
#: dashboard/qml/Main.qml:232
#: dashboard/qml/Main.qml:240
#, kde-format
msgid "Restart the server for configuration changes to take effect"
msgstr "Reinicia el servidor para que los cambios surtan efecto"
#: dashboard/qml/Main.qml:238
#: dashboard/qml/Main.qml:246
#, kde-format
msgctxt "restart the server"
msgid "Restart now"
msgstr "Reiniciar ahora"
#: dashboard/qml/Main.qml:263
#: dashboard/qml/Main.qml:271
#, kde-format
msgid "Server failed to start"
msgstr "El servidor no pudo iniciar"
#: dashboard/qml/Main.qml:269 dashboard/qml/TroubleshootPage.qml:89
#: dashboard/qml/Main.qml:277 dashboard/qml/TroubleshootPage.qml:89
#, kde-format
msgid "Open server logs"
msgstr "Abrir registros del servidor"
#: dashboard/qml/Main.qml:295
#: dashboard/qml/Main.qml:303
#, kde-format
msgid "Server status"
msgstr "Estado del servidor"
#: dashboard/qml/Main.qml:301
#: dashboard/qml/Main.qml:309
#, kde-format
msgctxt "whether the server is running, displayed in front of a checkbox"
msgid "Running"
msgstr "En ejecución"
#: dashboard/qml/Main.qml:314
#: dashboard/qml/Main.qml:322
#, kde-format
msgctxt "whether pairing is enabled, displayed in front of a checkbox"
msgid "Pairing"
msgstr "Emparejando"
#: dashboard/qml/Main.qml:334
#: dashboard/qml/Main.qml:342
#, kde-format
msgid "Headset status"
msgstr "Estado del visor"
#: dashboard/qml/Main.qml:341
#: dashboard/qml/Main.qml:349
#, kde-format
msgctxt "label for headset name/status under server running switch"
msgid "Headset"
msgstr "Visor"
#: dashboard/qml/Main.qml:344
#: dashboard/qml/Main.qml:352
#, kde-format
msgid "Not connected"
msgstr "No conectado"
#: dashboard/qml/Main.qml:348
#: dashboard/qml/Main.qml:356
#, kde-format
msgid "Disconnect"
msgstr "Desconectar"
#: dashboard/qml/Main.qml:357 dashboard/qml/Main.qml:365
#: dashboard/qml/Main.qml:372
#: dashboard/qml/Main.qml:365 dashboard/qml/Main.qml:373
#: dashboard/qml/Main.qml:380
#, kde-format
msgctxt "label for USB status or connect button"
msgid "USB"
msgstr "USB"
#: dashboard/qml/Main.qml:358
#: dashboard/qml/Main.qml:366
#, kde-format
msgctxt "usb connect button"
msgid "Connect (wired)"
msgstr "Conectar (cableado)"
#: dashboard/qml/Main.qml:375 dashboard/qml/WizardPage.qml:339
#: dashboard/qml/Main.qml:383 dashboard/qml/WizardPage.qml:339
#, kde-format
msgid "No headset is connected or your headset is not in developer mode"
msgstr "No hay ningún visor conectado o tu visor no está en modo desarrollador"
#: dashboard/qml/Main.qml:396
#: dashboard/qml/Main.qml:404
#, kde-format
msgid "Steam information"
msgstr "Información de Steam"
#: dashboard/qml/Main.qml:412
#: dashboard/qml/Main.qml:420
#, kde-format
msgid "Wizard"
msgstr "Asistente"
#: dashboard/qml/Main.qml:418
#: dashboard/qml/Main.qml:426
#, kde-format
msgid "Install the app"
msgstr "Instalar aplicación"
#: dashboard/qml/Main.qml:437 dashboard/qml/SettingsPage.qml:14
#: dashboard/qml/Main.qml:445 dashboard/qml/SettingsPage.qml:14
#, kde-format
msgid "Settings"
msgstr "Ajustes"
#: dashboard/qml/Main.qml:443
#: dashboard/qml/Main.qml:451
#, kde-format
msgid "About"
msgstr "Acerca de"
#: dashboard/qml/Main.qml:448 dashboard/qml/TroubleshootPage.qml:10
#: dashboard/qml/Main.qml:456 dashboard/qml/TroubleshootPage.qml:10
#, kde-format
msgid "Troubleshoot"
msgstr "Solucionar problemas"
#: dashboard/qml/Main.qml:455
#: dashboard/qml/Main.qml:463
#, kde-format
msgid "Version %1"
msgstr "Versión %1"
+56 -56
View File
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WiVRn 0.15\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-02-06 23:11+0100\n"
"POT-Creation-Date: 2026-02-15 00:02+0100\n"
"PO-Revision-Date: 2025-11-19 20:23+0100\n"
"Last-Translator: Álvaro De Quinta <blackcherry@danwin1210.de>\n"
"Language-Team: Spanish <>\n"
@@ -70,11 +70,11 @@ msgstr "No se puede conectar a {} ({}): {}"
msgid "Waiting for connection"
msgstr "Esperando conexión"
#: client/scenes/lobby.cpp:1316
#: client/scenes/lobby.cpp:1307
msgid "Passthrough"
msgstr "Exterior"
#: client/scenes/lobby.cpp:1328
#: client/scenes/lobby.cpp:1319
msgid "Default environment"
msgstr "Entorno por defecto"
@@ -94,13 +94,13 @@ msgid "Disabled"
msgstr "Deshabilitado"
#: client/scenes/lobby_gui.cpp:114 client/scenes/lobby_gui.cpp:258
#: client/scenes/stream_gui.cpp:1010
#: client/scenes/stream_gui.cpp:992
msgid "Disconnect"
msgstr "Desconectar"
#: client/scenes/lobby_gui.cpp:134 client/scenes/lobby_gui_customize.cpp:753
#: client/scenes/lobby_gui_customize.cpp:844
#: client/scenes/lobby_gui_customize.cpp:900 client/scenes/stream_gui.cpp:1006
#: client/scenes/lobby_gui_customize.cpp:900 client/scenes/stream_gui.cpp:988
msgid "Close"
msgstr "Cerrar"
@@ -138,7 +138,7 @@ msgid "TCP only"
msgstr "Solo TCP"
#: client/scenes/lobby_gui.cpp:319 client/scenes/lobby_gui_customize.cpp:655
#: client/scenes/stream_gui.cpp:962
#: client/scenes/stream_gui.cpp:944
msgid "Cancel"
msgstr "Cancelar"
@@ -183,17 +183,17 @@ msgstr "Idioma"
msgid "System language"
msgstr "Idioma del sistema"
#: client/scenes/lobby_gui.cpp:580 client/scenes/stream_gui.cpp:411
#: client/scenes/lobby_gui.cpp:580 client/scenes/stream_gui.cpp:413
msgid "Refresh rate"
msgstr "Frecuencia de actualización"
#: client/scenes/lobby_gui.cpp:580 client/scenes/lobby_gui.cpp:582
#: client/scenes/stream_gui.cpp:411 client/scenes/stream_gui.cpp:413
#: client/scenes/stream_gui.cpp:413 client/scenes/stream_gui.cpp:415
msgctxt "automatic refresh rate"
msgid "Automatic"
msgstr "Automática"
#: client/scenes/lobby_gui.cpp:589 client/scenes/stream_gui.cpp:421
#: client/scenes/lobby_gui.cpp:589 client/scenes/stream_gui.cpp:423
msgid ""
"Select refresh rate based on measured application performance.\n"
"May cause flicker when a change happens."
@@ -202,7 +202,7 @@ msgstr ""
"aplicación.\n"
"Puede causar parpadeos cuando ocurre un cambio."
#: client/scenes/lobby_gui.cpp:606 client/scenes/stream_gui.cpp:439
#: client/scenes/lobby_gui.cpp:606 client/scenes/stream_gui.cpp:441
msgid "Minimum refresh rate"
msgstr "Tasa mínima de refresco"
@@ -392,15 +392,15 @@ msgstr ""
"Permitir valores de configuración inseguros, usar bajo propia "
"responsabilidad."
#: client/scenes/lobby_gui.cpp:920 client/scenes/stream_gui.cpp:473
#: client/scenes/lobby_gui.cpp:920 client/scenes/stream_gui.cpp:475
msgid "OpenXR post-processing"
msgstr "Post-procesamiento de OpenXR"
#: client/scenes/lobby_gui.cpp:924 client/scenes/stream_gui.cpp:477
#: client/scenes/lobby_gui.cpp:924 client/scenes/stream_gui.cpp:479
msgid "Supersampling"
msgstr "Sobremuestreo"
#: client/scenes/lobby_gui.cpp:944 client/scenes/stream_gui.cpp:498
#: client/scenes/lobby_gui.cpp:944 client/scenes/stream_gui.cpp:500
msgid ""
"Reduce flicker for high contrast edges.\n"
"Useful when the input resolution is high compared to the headset display"
@@ -409,11 +409,11 @@ msgstr ""
"Útil cuando la resolución de entrada es alta comparada con la pantalla del "
"visor"
#: client/scenes/lobby_gui.cpp:949 client/scenes/stream_gui.cpp:503
#: client/scenes/lobby_gui.cpp:949 client/scenes/stream_gui.cpp:505
msgid "Sharpening"
msgstr "Nitidez"
#: client/scenes/lobby_gui.cpp:969 client/scenes/stream_gui.cpp:524
#: client/scenes/lobby_gui.cpp:969 client/scenes/stream_gui.cpp:526
msgid ""
"Improve clarity of high contrast edges and counteract blur.\n"
"Useful when the input resolution is low compared to the headset display"
@@ -423,7 +423,7 @@ msgstr ""
"visor"
#: client/scenes/lobby_gui.cpp:1153 client/scenes/lobby_gui.cpp:1161
#: client/scenes/stream_gui.cpp:172 client/scenes/stream_gui.cpp:370
#: client/scenes/stream_gui.cpp:174 client/scenes/stream_gui.cpp:372
msgid "CPU time"
msgstr "Tiempo de CPU"
@@ -432,7 +432,7 @@ msgid "CPU time [ms]"
msgstr "Tiempo de CPU [ms]"
#: client/scenes/lobby_gui.cpp:1167 client/scenes/lobby_gui.cpp:1175
#: client/scenes/stream_gui.cpp:174 client/scenes/stream_gui.cpp:371
#: client/scenes/stream_gui.cpp:176 client/scenes/stream_gui.cpp:373
msgid "GPU time"
msgstr "Tiempo de GPU"
@@ -520,7 +520,7 @@ msgstr "Agregar servidor"
msgid "Server list"
msgstr "Lista de servidores"
#: client/scenes/lobby_gui.cpp:1940 client/scenes/stream_gui.cpp:991
#: client/scenes/lobby_gui.cpp:1940 client/scenes/stream_gui.cpp:973
msgid "Settings"
msgstr "Configuración"
@@ -631,160 +631,160 @@ msgstr "Descargar más entornos"
msgid "Open local glTF model"
msgstr "Abrir modelo glTF local"
#: client/scenes/stream_gui.cpp:174
#: client/scenes/stream_gui.cpp:176
msgid "Defoveate"
msgstr "Desfovear"
#: client/scenes/stream_gui.cpp:176
#: client/scenes/stream_gui.cpp:178
msgid "Network"
msgstr "Red"
#: client/scenes/stream_gui.cpp:176 client/scenes/stream_gui.cpp:368
#: client/scenes/stream_gui.cpp:178 client/scenes/stream_gui.cpp:370
msgid "Download"
msgstr "Descargar"
#: client/scenes/stream_gui.cpp:177 client/scenes/stream_gui.cpp:369
#: client/scenes/stream_gui.cpp:179 client/scenes/stream_gui.cpp:371
msgid "Upload"
msgstr "Subir"
#: client/scenes/stream_gui.cpp:246
#: client/scenes/stream_gui.cpp:248
#, c++-format
msgid "Decoder {}"
msgstr "Decodificador {}"
#: client/scenes/stream_gui.cpp:258
#: client/scenes/stream_gui.cpp:260
msgid "Timings [ms]"
msgstr "Tiempos [ms]"
#: client/scenes/stream_gui.cpp:318
#: client/scenes/stream_gui.cpp:320
msgid "Encode"
msgstr "Codificar"
#: client/scenes/stream_gui.cpp:319
#: client/scenes/stream_gui.cpp:321
msgid "Send"
msgstr "Enviar"
#: client/scenes/stream_gui.cpp:320
#: client/scenes/stream_gui.cpp:322
msgid "Receive"
msgstr "Recibir"
#: client/scenes/stream_gui.cpp:321
#: client/scenes/stream_gui.cpp:323
msgid "Decode"
msgstr "Decodificar"
#: client/scenes/stream_gui.cpp:322
#: client/scenes/stream_gui.cpp:324
msgid "Blitted"
msgstr "Copiado"
#: client/scenes/stream_gui.cpp:323
#: client/scenes/stream_gui.cpp:325
msgid "Displayed"
msgstr "Mostrado"
#: client/scenes/stream_gui.cpp:324
#: client/scenes/stream_gui.cpp:326
msgid "Predicted"
msgstr "Previsto"
#: client/scenes/stream_gui.cpp:343
#: client/scenes/stream_gui.cpp:345
#, c++-format
msgid "Estimated motion to photons latency: {}ms"
msgstr "Latencia estimada de movimiento a fotones: {}ms"
#: client/scenes/stream_gui.cpp:348
#: client/scenes/stream_gui.cpp:350
msgid "Press the grip button to move the window"
msgstr "Pulsa el botón de agarre para mover la ventana"
#: client/scenes/stream_gui.cpp:350 client/scenes/stream_gui.cpp:918
#: client/scenes/stream_gui.cpp:352 client/scenes/stream_gui.cpp:900
msgid "Press both thumbsticks to display the WiVRn window"
msgstr "Pulsa ambos joysticks para mostrar la ventana de WiVRn"
#: client/scenes/stream_gui.cpp:372
#: client/scenes/stream_gui.cpp:374
msgid "Motion to photon latency"
msgstr "Latencia entre el movimiento y la imagen mostrada"
#: client/scenes/stream_gui.cpp:458
#: client/scenes/stream_gui.cpp:460
msgid "Bitrate:"
msgstr "Bitrate:"
#: client/scenes/stream_gui.cpp:468
#: client/scenes/stream_gui.cpp:470
msgid "Click to adjust bitrate"
msgstr "Haga click para ajustar el bitrate"
#: client/scenes/stream_gui.cpp:531
#: client/scenes/stream_gui.cpp:534
msgid "Foveation center override"
msgstr "Reajustar el centro de la fóvea"
#: client/scenes/stream_gui.cpp:534
#: client/scenes/stream_gui.cpp:537
msgid "Enable"
msgstr "Habilitar"
#: client/scenes/stream_gui.cpp:542 client/scenes/stream_gui.cpp:614
#: client/scenes/stream_gui.cpp:545 client/scenes/stream_gui.cpp:616
#, c++-format
msgid "Height {:.1f} deg"
msgstr "Altura {:.1f} °"
#: client/scenes/stream_gui.cpp:543 client/scenes/stream_gui.cpp:615
#: client/scenes/stream_gui.cpp:546 client/scenes/stream_gui.cpp:617
#, c++-format
msgid "Distance {:.2f} m"
msgstr "Distancia {:.2f} m"
#: client/scenes/stream_gui.cpp:544
#: client/scenes/stream_gui.cpp:547
msgid "Default"
msgstr "Por defecto"
#: client/scenes/stream_gui.cpp:555
#: client/scenes/stream_gui.cpp:558
msgid "Change"
msgstr "Cambiar"
#: client/scenes/stream_gui.cpp:588
#: client/scenes/stream_gui.cpp:590
msgid "Use the right thumbstick to adjust the bitrate"
msgstr "Use el stick derecho para ajustar el bitrate"
#: client/scenes/stream_gui.cpp:589
#: client/scenes/stream_gui.cpp:591
msgid "Press A to go back"
msgstr "Pulse A para volver"
#: client/scenes/stream_gui.cpp:590
#: client/scenes/stream_gui.cpp:592
#, c++-format
msgid "Bitrate: {}Mbit/s"
msgstr "Bitrate: {}Mbit/s"
#: client/scenes/stream_gui.cpp:612
#: client/scenes/stream_gui.cpp:614
msgid "Use the thumbsticks to move the foveation center"
msgstr "Usa los joysticks para mover el centro de la fóvea"
#: client/scenes/stream_gui.cpp:613
#: client/scenes/stream_gui.cpp:615
msgid "Press A to save or B to cancel"
msgstr "Pulsa A para guardar o B para cancelar"
#: client/scenes/stream_gui.cpp:671
#: client/scenes/stream_gui.cpp:673
msgid "Running XR applications:"
msgstr "Aplicaciones XR ejecutandose:"
#: client/scenes/stream_gui.cpp:688
#: client/scenes/stream_gui.cpp:690
msgid "Overlays"
msgstr "Superposiciones"
#: client/scenes/stream_gui.cpp:727
#: client/scenes/stream_gui.cpp:729
msgid "Request to quit, may be ignored by the application"
msgstr "Pedir salir, puede ser ignorado por la aplicación"
#: client/scenes/stream_gui.cpp:977
#: client/scenes/stream_gui.cpp:959
msgid "Applications"
msgstr "Aplicaciones"
#: client/scenes/stream_gui.cpp:980
#: client/scenes/stream_gui.cpp:962
msgid "Start"
msgstr "Iniciar"
#: client/scenes/stream_gui.cpp:994
#: client/scenes/stream_gui.cpp:976
msgid "Stats"
msgstr "Estadísticas"
#: client/scenes/stream_gui.cpp:1000
#: client/scenes/stream_gui.cpp:982
msgid "Statistics overlay"
msgstr "Superponer stats"
#: client/scenes/stream_gui.cpp:1003
#: client/scenes/stream_gui.cpp:985
msgid "Compact view"
msgstr "Vista compacta"
+43 -31
View File
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WiVRn-dashboard\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-02-02 10:52+0100\n"
"PO-Revision-Date: 2026-02-02 10:53+0100\n"
"POT-Creation-Date: 2026-02-16 18:43+0100\n"
"PO-Revision-Date: 2026-02-16 21:47+0100\n"
"Last-Translator: Guillaume Meunier <guillaume.meunier@centraliens.net>\n"
"Language-Team: French <>\n"
"Language: French\n"
@@ -117,8 +117,8 @@ msgstr "Vérification de la dernière version..."
msgid "No APK is available for this version"
msgstr "Aucun APK n'est disponible pour cette version"
#: dashboard/qml/ApkInstallPage.qml:45 dashboard/qml/Main.qml:368
#: dashboard/qml/Main.qml:426 dashboard/qml/WizardPage.qml:211
#: dashboard/qml/ApkInstallPage.qml:45 dashboard/qml/Main.qml:376
#: dashboard/qml/Main.qml:434 dashboard/qml/WizardPage.qml:211
#: dashboard/qml/WizardPage.qml:337
#, kde-format
msgid "ADB is not installed"
@@ -160,7 +160,7 @@ msgstr "Réinstaller WiVRn"
msgid "Install WiVRn"
msgstr "Installer WiVRn"
#: dashboard/qml/HeadsetsPage.qml:12 dashboard/qml/Main.qml:431
#: dashboard/qml/HeadsetsPage.qml:12 dashboard/qml/Main.qml:439
#, kde-format
msgid "Headsets"
msgstr "Casques"
@@ -287,7 +287,7 @@ msgid "Avahi daemon is not started"
msgstr "Avahi daemon n'est pas démarré"
#: dashboard/qml/Main.qml:157 dashboard/qml/Main.qml:171
#: dashboard/qml/Main.qml:223
#: dashboard/qml/Main.qml:231
#, kde-format
msgid "Fix it"
msgstr "Corriger"
@@ -312,6 +312,18 @@ msgstr "Plus d'infos"
#: dashboard/qml/Main.qml:193
#, kde-format
msgid "Vulkan drivers cannot be found, you may need to run \"flatpak update\""
msgstr ""
"Impossible de trouver les drivers Vulkan, il est peut-être nécessaire "
"d'exécuter \"flatpak update\""
#: dashboard/qml/Main.qml:193
#, kde-format
msgid "Vulkan drivers cannot be found"
msgstr "Impossible de trouver les drivers Vulkan"
#: dashboard/qml/Main.qml:201
#, kde-format
msgid ""
"Use the Mesa (radv) driver for AMD GPUs\n"
"Hardware encoding with vaapi does not work with AMDVLK and AMDGPU-PRO"
@@ -319,7 +331,7 @@ msgstr ""
"Utilisez le driver Mesa (redv) pour les GPUs AMD\n"
"L'encodage matériel avec vaapi ne fonctionne pas avec AMDVLK et AMDGPU-PRO"
#: dashboard/qml/Main.qml:201
#: dashboard/qml/Main.qml:209
#, kde-format
msgid ""
"No OpenVR compatibility detected, Steam games won't be able to load VR.\n"
@@ -329,14 +341,14 @@ msgstr ""
"pourront pas charger le mode VR.\n"
"Veuillez installer xrizer ou OpenComposite."
#: dashboard/qml/Main.qml:209
#: dashboard/qml/Main.qml:217
#, kde-format
msgid "Steam is installed as a snap. Snaps are not compatible with WiVRn."
msgstr ""
"Steam est installé en tant que snap. Les snaps ne sont pas compatibles avec "
"WiVRn."
#: dashboard/qml/Main.qml:217
#: dashboard/qml/Main.qml:225
#, kde-format
msgid ""
"Steam is installed as a flatpak but does not have sufficient permissions."
@@ -344,114 +356,114 @@ msgstr ""
"Steam est installé en tant que flatpak mais n'a pas les autorisations "
"nécessaires."
#: dashboard/qml/Main.qml:232
#: dashboard/qml/Main.qml:240
#, kde-format
msgid "Restart the server for configuration changes to take effect"
msgstr "Redémarez le serveur pour appliquer les changements"
#: dashboard/qml/Main.qml:238
#: dashboard/qml/Main.qml:246
#, kde-format
msgctxt "restart the server"
msgid "Restart now"
msgstr "Redémarrer"
#: dashboard/qml/Main.qml:263
#: dashboard/qml/Main.qml:271
#, kde-format
msgid "Server failed to start"
msgstr "Le serveur n'a pas pu démarrer"
#: dashboard/qml/Main.qml:269 dashboard/qml/TroubleshootPage.qml:89
#: dashboard/qml/Main.qml:277 dashboard/qml/TroubleshootPage.qml:89
#, kde-format
msgid "Open server logs"
msgstr "Ouvrir les logs du serveur"
#: dashboard/qml/Main.qml:295
#: dashboard/qml/Main.qml:303
#, kde-format
msgid "Server status"
msgstr "Serveur"
#: dashboard/qml/Main.qml:301
#: dashboard/qml/Main.qml:309
#, kde-format
msgctxt "whether the server is running, displayed in front of a checkbox"
msgid "Running"
msgstr "Démarré"
#: dashboard/qml/Main.qml:314
#: dashboard/qml/Main.qml:322
#, kde-format
msgctxt "whether pairing is enabled, displayed in front of a checkbox"
msgid "Pairing"
msgstr "Appairage"
#: dashboard/qml/Main.qml:334
#: dashboard/qml/Main.qml:342
#, kde-format
msgid "Headset status"
msgstr "Casque"
#: dashboard/qml/Main.qml:341
#: dashboard/qml/Main.qml:349
#, kde-format
msgctxt "label for headset name/status under server running switch"
msgid "Headset"
msgstr "Casque"
#: dashboard/qml/Main.qml:344
#: dashboard/qml/Main.qml:352
#, kde-format
msgid "Not connected"
msgstr "Déconnecté"
#: dashboard/qml/Main.qml:348
#: dashboard/qml/Main.qml:356
#, kde-format
msgid "Disconnect"
msgstr "Déconnecter"
#: dashboard/qml/Main.qml:357 dashboard/qml/Main.qml:365
#: dashboard/qml/Main.qml:372
#: dashboard/qml/Main.qml:365 dashboard/qml/Main.qml:373
#: dashboard/qml/Main.qml:380
#, kde-format
msgctxt "label for USB status or connect button"
msgid "USB"
msgstr "USB"
#: dashboard/qml/Main.qml:358
#: dashboard/qml/Main.qml:366
#, kde-format
msgctxt "usb connect button"
msgid "Connect (wired)"
msgstr "Connecter (filaire)"
#: dashboard/qml/Main.qml:375 dashboard/qml/WizardPage.qml:339
#: dashboard/qml/Main.qml:383 dashboard/qml/WizardPage.qml:339
#, kde-format
msgid "No headset is connected or your headset is not in developer mode"
msgstr "Le casque n'est pas connecté ou n'est pas en mode développeur"
#: dashboard/qml/Main.qml:396
#: dashboard/qml/Main.qml:404
#, kde-format
msgid "Steam information"
msgstr "Informations pour Steam"
#: dashboard/qml/Main.qml:412
#: dashboard/qml/Main.qml:420
#, kde-format
msgid "Wizard"
msgstr "Assistant"
#: dashboard/qml/Main.qml:418
#: dashboard/qml/Main.qml:426
#, kde-format
msgid "Install the app"
msgstr "Installer l'appli"
#: dashboard/qml/Main.qml:437 dashboard/qml/SettingsPage.qml:14
#: dashboard/qml/Main.qml:445 dashboard/qml/SettingsPage.qml:14
#, kde-format
msgid "Settings"
msgstr "Paramètres"
#: dashboard/qml/Main.qml:443
#: dashboard/qml/Main.qml:451
#, kde-format
msgid "About"
msgstr "À propos"
#: dashboard/qml/Main.qml:448 dashboard/qml/TroubleshootPage.qml:10
#: dashboard/qml/Main.qml:456 dashboard/qml/TroubleshootPage.qml:10
#, kde-format
msgid "Troubleshoot"
msgstr "Dépannage"
#: dashboard/qml/Main.qml:455
#: dashboard/qml/Main.qml:463
#, kde-format
msgid "Version %1"
msgstr "Version %1"
+40 -30
View File
@@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WiVRn-dashboard\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-02-04 17:02+0900\n"
"POT-Creation-Date: 2026-02-17 12:42+0900\n"
"PO-Revision-Date: 2025-04-10 07:14+0900\n"
"Last-Translator: Mitsuami Megane <hello@mitsua.me>\n"
"Language-Team: Japanese <>\n"
@@ -112,8 +112,8 @@ msgstr "最新リリースを確認中"
msgid "No APK is available for this version"
msgstr "現在バージョン用の公式APKは提供されていません"
#: dashboard/qml/ApkInstallPage.qml:45 dashboard/qml/Main.qml:368
#: dashboard/qml/Main.qml:426 dashboard/qml/WizardPage.qml:211
#: dashboard/qml/ApkInstallPage.qml:45 dashboard/qml/Main.qml:376
#: dashboard/qml/Main.qml:434 dashboard/qml/WizardPage.qml:211
#: dashboard/qml/WizardPage.qml:337
#, kde-format
msgid "ADB is not installed"
@@ -159,7 +159,7 @@ msgstr "WiVRnをインストールする"
msgid "Headset statistics"
msgstr "HMDの統計情報"
#: dashboard/qml/HeadsetsPage.qml:12 dashboard/qml/Main.qml:431
#: dashboard/qml/HeadsetsPage.qml:12 dashboard/qml/Main.qml:439
#, kde-format
msgid "Headsets"
msgstr "HMD"
@@ -275,7 +275,7 @@ msgid "Avahi daemon is not started"
msgstr "Avahiデーモンが起動していません"
#: dashboard/qml/Main.qml:157 dashboard/qml/Main.qml:171
#: dashboard/qml/Main.qml:223
#: dashboard/qml/Main.qml:231
#, kde-format
msgid "Fix it"
msgstr "直す"
@@ -300,6 +300,16 @@ msgstr "詳細情報"
#: dashboard/qml/Main.qml:193
#, kde-format
msgid "Vulkan drivers cannot be found, you may need to run \"flatpak update\""
msgstr "Vulkanドライバーが見つかりません。「flatpak update」を実行してみて下さい。"
#: dashboard/qml/Main.qml:193
#, kde-format
msgid "Vulkan drivers cannot be found"
msgstr "Vulkanドライバーが見つかりません"
#: dashboard/qml/Main.qml:201
#, kde-format
msgid ""
"Use the Mesa (radv) driver for AMD GPUs\n"
"Hardware encoding with vaapi does not work with AMDVLK and AMDGPU-PRO"
@@ -307,7 +317,7 @@ msgstr ""
"AMD GPUの場合は「Mesa (radv)」ドライバーを使ってください\n"
"AMDVLKやAMDGPU-PROなどはvaapiエンコーダーに対応していません"
#: dashboard/qml/Main.qml:201
#: dashboard/qml/Main.qml:209
#, kde-format
msgid ""
"No OpenVR compatibility detected, Steam games won't be able to load VR.\n"
@@ -316,13 +326,13 @@ msgstr ""
"OpenVR実装ライブラリーは見つかりませんでした。SteamVRゲームを実行するには、\n"
"xrizerかOpenCompositeをインストールしましょう。"
#: dashboard/qml/Main.qml:209
#: dashboard/qml/Main.qml:217
#, kde-format
msgid "Steam is installed as a snap. Snaps are not compatible with WiVRn."
msgstr ""
"SteamはSnapとしてインストールされていますが、Snapはサポートサれていません。"
#: dashboard/qml/Main.qml:217
#: dashboard/qml/Main.qml:225
#, kde-format
msgid ""
"Steam is installed as a flatpak but does not have sufficient permissions."
@@ -330,114 +340,114 @@ msgstr ""
"SteamはFlatpakとしてインストールされていますが、必要な権限が設定されていませ"
"ん。"
#: dashboard/qml/Main.qml:232
#: dashboard/qml/Main.qml:240
#, kde-format
msgid "Restart the server for configuration changes to take effect"
msgstr "設定変更を有効にするにはサーバーを再起動してください。"
#: dashboard/qml/Main.qml:238
#: dashboard/qml/Main.qml:246
#, kde-format
msgctxt "restart the server"
msgid "Restart now"
msgstr "今すぐ再起動する"
#: dashboard/qml/Main.qml:263
#: dashboard/qml/Main.qml:271
#, kde-format
msgid "Server failed to start"
msgstr "サーバーは起動できませんでした"
#: dashboard/qml/Main.qml:269 dashboard/qml/TroubleshootPage.qml:89
#: dashboard/qml/Main.qml:277 dashboard/qml/TroubleshootPage.qml:89
#, kde-format
msgid "Open server logs"
msgstr "ログを見る"
#: dashboard/qml/Main.qml:295
#: dashboard/qml/Main.qml:303
#, kde-format
msgid "Server status"
msgstr "サーバーステータス"
#: dashboard/qml/Main.qml:301
#: dashboard/qml/Main.qml:309
#, kde-format
msgctxt "whether the server is running, displayed in front of a checkbox"
msgid "Running"
msgstr "作動中"
#: dashboard/qml/Main.qml:314
#: dashboard/qml/Main.qml:322
#, kde-format
msgctxt "whether pairing is enabled, displayed in front of a checkbox"
msgid "Pairing"
msgstr "ペアリング"
#: dashboard/qml/Main.qml:334
#: dashboard/qml/Main.qml:342
#, kde-format
msgid "Headset status"
msgstr "HMDステータス"
#: dashboard/qml/Main.qml:341
#: dashboard/qml/Main.qml:349
#, kde-format
msgctxt "label for headset name/status under server running switch"
msgid "Headset"
msgstr "HMD"
#: dashboard/qml/Main.qml:344
#: dashboard/qml/Main.qml:352
#, kde-format
msgid "Not connected"
msgstr "未接続"
#: dashboard/qml/Main.qml:348
#: dashboard/qml/Main.qml:356
#, kde-format
msgid "Disconnect"
msgstr "切断する"
#: dashboard/qml/Main.qml:357 dashboard/qml/Main.qml:365
#: dashboard/qml/Main.qml:372
#: dashboard/qml/Main.qml:365 dashboard/qml/Main.qml:373
#: dashboard/qml/Main.qml:380
#, kde-format
msgctxt "label for USB status or connect button"
msgid "USB"
msgstr "USB"
#: dashboard/qml/Main.qml:358
#: dashboard/qml/Main.qml:366
#, kde-format
msgctxt "usb connect button"
msgid "Connect (wired)"
msgstr "有線で接続する"
#: dashboard/qml/Main.qml:375 dashboard/qml/WizardPage.qml:339
#: dashboard/qml/Main.qml:383 dashboard/qml/WizardPage.qml:339
#, kde-format
msgid "No headset is connected or your headset is not in developer mode"
msgstr "HMDが接続されていないか、HMDが開発者モードになっていません"
#: dashboard/qml/Main.qml:396
#: dashboard/qml/Main.qml:404
#, kde-format
msgid "Steam information"
msgstr "ストリーム情報"
#: dashboard/qml/Main.qml:412
#: dashboard/qml/Main.qml:420
#, kde-format
msgid "Wizard"
msgstr "セットアップウィザード"
#: dashboard/qml/Main.qml:418
#: dashboard/qml/Main.qml:426
#, kde-format
msgid "Install the app"
msgstr "アプリをインストール"
#: dashboard/qml/Main.qml:437 dashboard/qml/SettingsPage.qml:14
#: dashboard/qml/Main.qml:445 dashboard/qml/SettingsPage.qml:14
#, kde-format
msgid "Settings"
msgstr "設定"
#: dashboard/qml/Main.qml:443
#: dashboard/qml/Main.qml:451
#, kde-format
msgid "About"
msgstr "WiVRnについて"
#: dashboard/qml/Main.qml:448 dashboard/qml/TroubleshootPage.qml:10
#: dashboard/qml/Main.qml:456 dashboard/qml/TroubleshootPage.qml:10
#, kde-format
msgid "Troubleshoot"
msgstr "問題解決"
#: dashboard/qml/Main.qml:455
#: dashboard/qml/Main.qml:463
#, kde-format
msgid "Version %1"
msgstr "バージョン%1"
+114 -114
View File
@@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WiVRn 0.16\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-02-04 17:02+0900\n"
"POT-Creation-Date: 2026-02-17 12:42+0900\n"
"PO-Revision-Date: 2024-06-20 10:33+0900\n"
"Last-Translator: Mitsuami Megane <hello@mitsua.me>\n"
"Language: Japanese\n"
@@ -14,24 +14,24 @@ msgstr ""
msgid "No supported swapchain format"
msgstr "互換性のあるスワップチェーンは見つからなかった"
#: client/scenes/app_launcher.cpp:128
#: client/scenes/app_launcher.cpp:127
msgid "Connected to WiVRn server"
msgstr "WiVRnサーバーに接続しました。"
#: client/scenes/app_launcher.cpp:130
#: client/scenes/app_launcher.cpp:129
#, c++-format
msgid "Connected to {}"
msgstr "{}に接続しました。"
#: client/scenes/app_launcher.cpp:136
#: client/scenes/app_launcher.cpp:135
msgid "Start an application on the server to start streaming."
msgstr "VRアプリを起動してVRに入りましょう!"
#: client/scenes/app_launcher.cpp:146
#: client/scenes/app_launcher.cpp:145
msgid "Start an application on your computer or select one to start streaming."
msgstr "パソコンでVRアプリを起動するか、ここからアプリを選択しましょう。"
#: client/scenes/app_launcher.cpp:148
#: client/scenes/app_launcher.cpp:147
#, c++-format
msgid "Start an application on {} or select one to start streaming."
msgstr "{}でVRアプリを起動するか、ここからアプリを選択しましょう。"
@@ -59,11 +59,11 @@ msgstr "{}に接続できませんでした:({}) {}"
msgid "Waiting for connection"
msgstr "接続を待っています"
#: client/scenes/lobby.cpp:1316
#: client/scenes/lobby.cpp:1307
msgid "Passthrough"
msgstr "パススルー"
#: client/scenes/lobby.cpp:1328
#: client/scenes/lobby.cpp:1319
msgid "Default environment"
msgstr "デフォルトのホーム環境"
@@ -83,13 +83,13 @@ msgid "Disabled"
msgstr "無効"
#: client/scenes/lobby_gui.cpp:114 client/scenes/lobby_gui.cpp:258
#: client/scenes/stream_gui.cpp:1009
#: client/scenes/stream_gui.cpp:992
msgid "Disconnect"
msgstr "切断する"
#: client/scenes/lobby_gui.cpp:134 client/scenes/lobby_gui_customize.cpp:753
#: client/scenes/lobby_gui_customize.cpp:844
#: client/scenes/lobby_gui_customize.cpp:900 client/scenes/stream_gui.cpp:1005
#: client/scenes/lobby_gui_customize.cpp:900 client/scenes/stream_gui.cpp:988
msgid "Close"
msgstr "閉じる"
@@ -127,7 +127,7 @@ msgid "TCP only"
msgstr "TCPのみを使用"
#: client/scenes/lobby_gui.cpp:319 client/scenes/lobby_gui_customize.cpp:655
#: client/scenes/stream_gui.cpp:962
#: client/scenes/stream_gui.cpp:944
msgid "Cancel"
msgstr "キャンセル"
@@ -172,17 +172,17 @@ msgstr "言語"
msgid "System language"
msgstr "デバイス言語"
#: client/scenes/lobby_gui.cpp:580 client/scenes/stream_gui.cpp:411
#: client/scenes/lobby_gui.cpp:580 client/scenes/stream_gui.cpp:413
msgid "Refresh rate"
msgstr "リフレッシュレート"
#: client/scenes/lobby_gui.cpp:580 client/scenes/lobby_gui.cpp:582
#: client/scenes/stream_gui.cpp:411 client/scenes/stream_gui.cpp:413
#: client/scenes/stream_gui.cpp:413 client/scenes/stream_gui.cpp:415
msgctxt "automatic refresh rate"
msgid "Automatic"
msgstr "自動"
#: client/scenes/lobby_gui.cpp:589 client/scenes/stream_gui.cpp:421
#: client/scenes/lobby_gui.cpp:589 client/scenes/stream_gui.cpp:423
msgid ""
"Select refresh rate based on measured application performance.\n"
"May cause flicker when a change happens."
@@ -190,7 +190,7 @@ msgstr ""
"アプリケーションのパフォーマンスを基づいて自動的に設定します。\n"
"変更時にチラツキが発生する可能性があります。"
#: client/scenes/lobby_gui.cpp:606 client/scenes/stream_gui.cpp:439
#: client/scenes/lobby_gui.cpp:606 client/scenes/stream_gui.cpp:441
msgid "Minimum refresh rate"
msgstr "最低リフレッシュレート"
@@ -266,58 +266,58 @@ msgstr "コーデック"
msgid "10-bit"
msgstr "10ビット"
#: client/scenes/lobby_gui.cpp:768
#: client/scenes/lobby_gui.cpp:769
msgid "Bitrate"
msgstr "ビットレート"
#: client/scenes/lobby_gui.cpp:772
#: client/scenes/lobby_gui.cpp:773
#, c++-format
msgid "{}Mbit/s"
msgstr "{}Mbps"
#: client/scenes/lobby_gui.cpp:783
#: client/scenes/lobby_gui.cpp:784
msgid "High power mode"
msgstr "高電力モード"
#: client/scenes/lobby_gui.cpp:786
#: client/scenes/lobby_gui.cpp:787
msgid "Increase power usage to allow higher resolution and refresh rate"
msgstr "HMDの性能問題を緩和するため、電力を増加させます。"
#: client/scenes/lobby_gui.cpp:792
#: client/scenes/lobby_gui.cpp:793
msgid "Enable microphone"
msgstr "マイクを有効する"
#: client/scenes/lobby_gui.cpp:801
#: client/scenes/lobby_gui.cpp:802
msgid "Unprocessed Microphone Audio"
msgstr "未処理のマイク音声"
#: client/scenes/lobby_gui.cpp:807
#: client/scenes/lobby_gui.cpp:808
msgid "Force disable audio filters, such as noise cancellation"
msgstr "ノイズ除去などのフィルターを無効化する"
#: client/scenes/lobby_gui.cpp:814
#: client/scenes/lobby_gui.cpp:815
msgid "Enable hand tracking"
msgstr "ハンドトラッキングを有効する"
#: client/scenes/lobby_gui.cpp:820 client/scenes/lobby_gui.cpp:831
#: client/scenes/lobby_gui.cpp:841 client/scenes/lobby_gui.cpp:856
#: client/scenes/lobby_gui.cpp:821 client/scenes/lobby_gui.cpp:832
#: client/scenes/lobby_gui.cpp:842 client/scenes/lobby_gui.cpp:857
#: client/scenes/lobby_gui_customize.cpp:640
msgid "This feature is not supported by your headset"
msgstr "デバイスはこの機能をサポートしていません"
#: client/scenes/lobby_gui.cpp:825
#: client/scenes/lobby_gui.cpp:826
msgid "Enable eye tracking"
msgstr "アイトラッキングを有効する"
#: client/scenes/lobby_gui.cpp:836
#: client/scenes/lobby_gui.cpp:837
msgid "Enable face tracking"
msgstr "顔トラッキングを有効する"
#: client/scenes/lobby_gui.cpp:848
#: client/scenes/lobby_gui.cpp:849
msgid "Enable body tracking"
msgstr "ボディラッキングを有効する"
#: client/scenes/lobby_gui.cpp:861
#: client/scenes/lobby_gui.cpp:862
msgid ""
"Requires 'Hand and body tracking' to be enabled in the Quest movement "
"tracking settings,\n"
@@ -328,11 +328,11 @@ msgstr ""
"そうでなければ、トラッキングデータはHMDとコントローラーの情報から推測されるこ"
"とになる。"
#: client/scenes/lobby_gui.cpp:871
#: client/scenes/lobby_gui.cpp:872
msgid "Enable lower body tracking"
msgstr "下半身トラッキングを有効する"
#: client/scenes/lobby_gui.cpp:877
#: client/scenes/lobby_gui.cpp:878
msgid ""
"Estimate lower body joint positions using Generative Legs\n"
"Requires 'Hand and body tracking' to be enabled in the Quest movement "
@@ -342,11 +342,11 @@ msgstr ""
"Quest設定・動きのトラッキング・ジェスチャーコントロールとボディトラッキングを"
"有効する必要がある。"
#: client/scenes/lobby_gui.cpp:880
#: client/scenes/lobby_gui.cpp:881
msgid "Enable hip tracking"
msgstr "腰のトラッキングを有効する"
#: client/scenes/lobby_gui.cpp:886
#: client/scenes/lobby_gui.cpp:887
msgid ""
"Only takes affect with lower body tracking enabled\n"
"May be desired when using another source of hip tracking"
@@ -354,11 +354,11 @@ msgstr ""
"下半身トラッキングが有効な場合に使用可能。\n"
"腰トラッカーを持ってる方は無効にしましょう。"
#: client/scenes/lobby_gui.cpp:895
#: client/scenes/lobby_gui.cpp:896
msgid "Enable in-stream window"
msgstr "ストリーミング中の設定パネル"
#: client/scenes/lobby_gui.cpp:898
#: client/scenes/lobby_gui.cpp:899
msgid ""
"Enables the configuration window to be shown while the game is streaming.\n"
"If enabled, the window is activated by pressing both thumbsticks."
@@ -366,23 +366,23 @@ msgstr ""
"ストリーミング中にも設定パネルを表示できるようにします。\n"
"両方のサムスティックを同時に押して切り替えることができます。"
#: client/scenes/lobby_gui.cpp:902
#: client/scenes/lobby_gui.cpp:903
msgid "Extended configuration values"
msgstr "設定に対する制限の緩和"
#: client/scenes/lobby_gui.cpp:905
#: client/scenes/lobby_gui.cpp:906
msgid "Allows unsafe configuration values, use at your own risk."
msgstr "不安定な状態が発生しないよう、十分にご注意ください。"
#: client/scenes/lobby_gui.cpp:919 client/scenes/stream_gui.cpp:473
#: client/scenes/lobby_gui.cpp:920 client/scenes/stream_gui.cpp:475
msgid "OpenXR post-processing"
msgstr "OpenXRポストエフェクト"
#: client/scenes/lobby_gui.cpp:923 client/scenes/stream_gui.cpp:477
#: client/scenes/lobby_gui.cpp:924 client/scenes/stream_gui.cpp:479
msgid "Supersampling"
msgstr "スーパーサンプリング"
#: client/scenes/lobby_gui.cpp:943 client/scenes/stream_gui.cpp:498
#: client/scenes/lobby_gui.cpp:944 client/scenes/stream_gui.cpp:500
msgid ""
"Reduce flicker for high contrast edges.\n"
"Useful when the input resolution is high compared to the headset display"
@@ -390,11 +390,11 @@ msgstr ""
"コントラストが高い部分のギザギザを低減する。\n"
"ストリームの解像度は、HMDの解像度より高い場合は有用です。"
#: client/scenes/lobby_gui.cpp:948 client/scenes/stream_gui.cpp:503
#: client/scenes/lobby_gui.cpp:949 client/scenes/stream_gui.cpp:505
msgid "Sharpening"
msgstr "シャープ"
#: client/scenes/lobby_gui.cpp:968 client/scenes/stream_gui.cpp:524
#: client/scenes/lobby_gui.cpp:969 client/scenes/stream_gui.cpp:526
msgid ""
"Improve clarity of high contrast edges and counteract blur.\n"
"Useful when the input resolution is low compared to the headset display"
@@ -402,129 +402,129 @@ msgstr ""
"ぼかしを低減し、コントラストが高い部分の鮮明度を向上する。\n"
"ストリームの解像度は、HMDの解像度より低い場合に有用です。"
#: client/scenes/lobby_gui.cpp:1152 client/scenes/lobby_gui.cpp:1160
#: client/scenes/stream_gui.cpp:172 client/scenes/stream_gui.cpp:370
#: client/scenes/lobby_gui.cpp:1153 client/scenes/lobby_gui.cpp:1161
#: client/scenes/stream_gui.cpp:174 client/scenes/stream_gui.cpp:372
msgid "CPU time"
msgstr "CPU使用時間"
#: client/scenes/lobby_gui.cpp:1156
#: client/scenes/lobby_gui.cpp:1157
msgid "CPU time [ms]"
msgstr "CPU使用時間、ミリ秒"
#: client/scenes/lobby_gui.cpp:1166 client/scenes/lobby_gui.cpp:1174
#: client/scenes/stream_gui.cpp:174 client/scenes/stream_gui.cpp:371
#: client/scenes/lobby_gui.cpp:1167 client/scenes/lobby_gui.cpp:1175
#: client/scenes/stream_gui.cpp:176 client/scenes/stream_gui.cpp:373
msgid "GPU time"
msgstr "GPU使用時間"
#: client/scenes/lobby_gui.cpp:1170
#: client/scenes/lobby_gui.cpp:1171
msgid "GPU time [ms]"
msgstr "GPU使用時間、ミリ秒"
#: client/scenes/lobby_gui.cpp:1234
#: client/scenes/lobby_gui.cpp:1235
msgid "Enable the microphone?"
msgstr "マイクを有効にしますか?"
#: client/scenes/lobby_gui.cpp:1239
#: client/scenes/lobby_gui.cpp:1240
msgid "Enable eye tracking?"
msgstr "アイトラッキングを有効にしますか?"
#: client/scenes/lobby_gui.cpp:1244
#: client/scenes/lobby_gui.cpp:1245
msgid "Enable face tracking?"
msgstr "フェースラッキングを有効にしますか?"
#: client/scenes/lobby_gui.cpp:1249
#: client/scenes/lobby_gui.cpp:1250
msgid "Enable body tracking?"
msgstr "ボディトラッキングを有効にしますか?"
#: client/scenes/lobby_gui.cpp:1257
#: client/scenes/lobby_gui.cpp:1258
msgid "Welcome to WiVRn"
msgstr "WiVRnへようこそ!"
#: client/scenes/lobby_gui.cpp:1285
#: client/scenes/lobby_gui.cpp:1286
msgid "Yes"
msgstr "はい"
#: client/scenes/lobby_gui.cpp:1292
#: client/scenes/lobby_gui.cpp:1293
msgid "No"
msgstr "いいえ"
#: client/scenes/lobby_gui.cpp:1311 client/scenes/lobby_gui.cpp:1957
#: client/scenes/lobby_gui.cpp:1312 client/scenes/lobby_gui.cpp:1958
msgid "Licenses"
msgstr "ライセンス"
#: client/scenes/lobby_gui.cpp:1587
#: client/scenes/lobby_gui.cpp:1588
msgid "Microphone is enabled"
msgstr "マイクは有効です"
#: client/scenes/lobby_gui.cpp:1588
#: client/scenes/lobby_gui.cpp:1589
msgid "Microphone is disabled"
msgstr "マイクは無効です"
#: client/scenes/lobby_gui.cpp:1597
#: client/scenes/lobby_gui.cpp:1598
msgid "Hand tracking is enabled"
msgstr "ハンドトラッキングは有効です"
#: client/scenes/lobby_gui.cpp:1598
#: client/scenes/lobby_gui.cpp:1599
msgid "Hand tracking is disabled"
msgstr "ハンドラッキングは無効です"
#: client/scenes/lobby_gui.cpp:1607
#: client/scenes/lobby_gui.cpp:1608
msgid "Eye tracking is enabled"
msgstr "アイトラッキングは有効です"
#: client/scenes/lobby_gui.cpp:1608
#: client/scenes/lobby_gui.cpp:1609
msgid "Eye tracking is disabled"
msgstr "アイトラッキングは無効です"
#: client/scenes/lobby_gui.cpp:1618
#: client/scenes/lobby_gui.cpp:1619
msgid "Face tracking is enabled"
msgstr "フェーストラッキングは有効です"
#: client/scenes/lobby_gui.cpp:1619
#: client/scenes/lobby_gui.cpp:1620
msgid "Face tracking is disabled"
msgstr "フェーストラッキングは無効です"
#: client/scenes/lobby_gui.cpp:1633
#: client/scenes/lobby_gui.cpp:1634
msgid "Body tracking is enabled"
msgstr "ボディトラッキングは有効です"
#: client/scenes/lobby_gui.cpp:1634
#: client/scenes/lobby_gui.cpp:1635
msgid "Body tracking is disabled"
msgstr "ボディトラッキングは無効です"
#: client/scenes/lobby_gui.cpp:1650
#: client/scenes/lobby_gui.cpp:1651
msgid "Add server"
msgstr "サーバーを追加する"
#: client/scenes/lobby_gui.cpp:1936
#: client/scenes/lobby_gui.cpp:1937
msgid "Server list"
msgstr "サーバー"
#: client/scenes/lobby_gui.cpp:1939 client/scenes/stream_gui.cpp:990
#: client/scenes/lobby_gui.cpp:1940 client/scenes/stream_gui.cpp:973
msgid "Settings"
msgstr "設定"
#: client/scenes/lobby_gui.cpp:1942
#: client/scenes/lobby_gui.cpp:1943
msgid "Post-processing"
msgstr "ポストエフェクト"
#: client/scenes/lobby_gui.cpp:1945
#: client/scenes/lobby_gui.cpp:1946
msgid "Customize"
msgstr "カスタマイズ"
#: client/scenes/lobby_gui.cpp:1949
#: client/scenes/lobby_gui.cpp:1950
msgid "Debug"
msgstr "デバッグ"
#: client/scenes/lobby_gui.cpp:1954
#: client/scenes/lobby_gui.cpp:1955
msgid "About"
msgstr "WiVRnについて"
#: client/scenes/lobby_gui.cpp:1960
#: client/scenes/lobby_gui.cpp:1961
msgid "Exit"
msgstr "完了"
#: client/scenes/lobby_gui.cpp:1977
#: client/scenes/lobby_gui.cpp:1978
msgid ""
"Press the grip button or put your palm up\n"
"to move the main window"
@@ -532,7 +532,7 @@ msgstr ""
"メイン・パネルを動かすには、グリップを握るか、\n"
"手のひらを上向きにしましょう。"
#: client/scenes/lobby_gui.cpp:1979
#: client/scenes/lobby_gui.cpp:1980
msgid "Press the grip button to move the main window"
msgstr "グリップを握ってパネルを動かしましょう。"
@@ -611,160 +611,160 @@ msgstr "ホーム環境をダウンロード"
msgid "Open local glTF model"
msgstr "glTFファイルを開く"
#: client/scenes/stream_gui.cpp:174
#: client/scenes/stream_gui.cpp:176
msgid "Defoveate"
msgstr "フォビエーション解除"
#: client/scenes/stream_gui.cpp:176
#: client/scenes/stream_gui.cpp:178
msgid "Network"
msgstr "ネットワーク"
#: client/scenes/stream_gui.cpp:176 client/scenes/stream_gui.cpp:368
#: client/scenes/stream_gui.cpp:178 client/scenes/stream_gui.cpp:370
msgid "Download"
msgstr "ダウンロード"
#: client/scenes/stream_gui.cpp:177 client/scenes/stream_gui.cpp:369
#: client/scenes/stream_gui.cpp:179 client/scenes/stream_gui.cpp:371
msgid "Upload"
msgstr "アップロード"
#: client/scenes/stream_gui.cpp:246
#: client/scenes/stream_gui.cpp:248
#, c++-format
msgid "Decoder {}"
msgstr "デコーダー {}"
#: client/scenes/stream_gui.cpp:258
#: client/scenes/stream_gui.cpp:260
msgid "Timings [ms]"
msgstr "タイミング、ミリ秒"
#: client/scenes/stream_gui.cpp:318
#: client/scenes/stream_gui.cpp:320
msgid "Encode"
msgstr "動画エンコード"
#: client/scenes/stream_gui.cpp:319
#: client/scenes/stream_gui.cpp:321
msgid "Send"
msgstr "送信"
#: client/scenes/stream_gui.cpp:320
#: client/scenes/stream_gui.cpp:322
msgid "Receive"
msgstr "受信"
#: client/scenes/stream_gui.cpp:321
#: client/scenes/stream_gui.cpp:323
msgid "Decode"
msgstr "デコード"
#: client/scenes/stream_gui.cpp:322
#: client/scenes/stream_gui.cpp:324
msgid "Blitted"
msgstr "描画"
#: client/scenes/stream_gui.cpp:323
#: client/scenes/stream_gui.cpp:325
msgid "Displayed"
msgstr "表示"
#: client/scenes/stream_gui.cpp:324
#: client/scenes/stream_gui.cpp:326
msgid "Predicted"
msgstr "予測時間"
#: client/scenes/stream_gui.cpp:343
#: client/scenes/stream_gui.cpp:345
#, c++-format
msgid "Estimated motion to photons latency: {}ms"
msgstr "「Motion-to-photon」推定遅延 {}ミリ秒"
#: client/scenes/stream_gui.cpp:348
#: client/scenes/stream_gui.cpp:350
msgid "Press the grip button to move the window"
msgstr "グリップを握ってパネルを動かしましょう。"
#: client/scenes/stream_gui.cpp:350 client/scenes/stream_gui.cpp:918
#: client/scenes/stream_gui.cpp:352 client/scenes/stream_gui.cpp:900
msgid "Press both thumbsticks to display the WiVRn window"
msgstr "両方のサムスティックを同時に押すことで設定表示"
#: client/scenes/stream_gui.cpp:372
#: client/scenes/stream_gui.cpp:374
msgid "Motion to photon latency"
msgstr "「Motion-to-photon」遅延"
#: client/scenes/stream_gui.cpp:458
#: client/scenes/stream_gui.cpp:460
msgid "Bitrate:"
msgstr "ビットレート:"
#: client/scenes/stream_gui.cpp:468
#: client/scenes/stream_gui.cpp:470
msgid "Click to adjust bitrate"
msgstr "クリックしてビットレートを調整"
#: client/scenes/stream_gui.cpp:531
#: client/scenes/stream_gui.cpp:534
msgid "Foveation center override"
msgstr "光学中心の調整"
#: client/scenes/stream_gui.cpp:534
#: client/scenes/stream_gui.cpp:537
msgid "Enable"
msgstr "有効"
#: client/scenes/stream_gui.cpp:542 client/scenes/stream_gui.cpp:614
#: client/scenes/stream_gui.cpp:545 client/scenes/stream_gui.cpp:616
#, c++-format
msgid "Height {:.1f} deg"
msgstr "仰角 {:.1f}°"
#: client/scenes/stream_gui.cpp:543 client/scenes/stream_gui.cpp:615
#: client/scenes/stream_gui.cpp:546 client/scenes/stream_gui.cpp:617
#, c++-format
msgid "Distance {:.2f} m"
msgstr "距離 {:.2f}m"
#: client/scenes/stream_gui.cpp:544
#: client/scenes/stream_gui.cpp:547
msgid "Default"
msgstr "デフォルト"
#: client/scenes/stream_gui.cpp:555
#: client/scenes/stream_gui.cpp:558
msgid "Change"
msgstr "編集"
#: client/scenes/stream_gui.cpp:588
#: client/scenes/stream_gui.cpp:590
msgid "Use the right thumbstick to adjust the bitrate"
msgstr "右スティックでビットレートを調整しましょう"
#: client/scenes/stream_gui.cpp:589
#: client/scenes/stream_gui.cpp:591
msgid "Press A to go back"
msgstr "「A」を押して戻る"
#: client/scenes/stream_gui.cpp:590
#: client/scenes/stream_gui.cpp:592
#, c++-format
msgid "Bitrate: {}Mbit/s"
msgstr "ビットレート:{}Mbps"
#: client/scenes/stream_gui.cpp:612
#: client/scenes/stream_gui.cpp:614
msgid "Use the thumbsticks to move the foveation center"
msgstr "ジョイスティックを使って中心点を調整しましょう。"
#: client/scenes/stream_gui.cpp:613
#: client/scenes/stream_gui.cpp:615
msgid "Press A to save or B to cancel"
msgstr "AかBを押してキャンセル。"
#: client/scenes/stream_gui.cpp:671
#: client/scenes/stream_gui.cpp:673
msgid "Running XR applications:"
msgstr "XRアプリの実行"
#: client/scenes/stream_gui.cpp:688
#: client/scenes/stream_gui.cpp:690
msgid "Overlays"
msgstr "オーバーレイ"
#: client/scenes/stream_gui.cpp:727
#: client/scenes/stream_gui.cpp:729
msgid "Request to quit, may be ignored by the application"
msgstr "終了シグナルを送信する"
#: client/scenes/stream_gui.cpp:977
#: client/scenes/stream_gui.cpp:959
msgid "Applications"
msgstr "アプリ"
#: client/scenes/stream_gui.cpp:980
#: client/scenes/stream_gui.cpp:962
msgid "Start"
msgstr "実行する"
#: client/scenes/stream_gui.cpp:993
#: client/scenes/stream_gui.cpp:976
msgid "Stats"
msgstr "統計情報"
#: client/scenes/stream_gui.cpp:999
#: client/scenes/stream_gui.cpp:982
msgid "Statistics overlay"
msgstr "統計オーバーレイ"
#: client/scenes/stream_gui.cpp:1002
#: client/scenes/stream_gui.cpp:985
msgid "Compact view"
msgstr "コンパクト・モード"
+44 -32
View File
@@ -10,8 +10,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WiVRn-dashboard\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-02-02 14:05+0100\n"
"PO-Revision-Date: 2026-02-02 15:54+0100\n"
"POT-Creation-Date: 2026-02-16 21:54+0100\n"
"PO-Revision-Date: 2026-02-16 23:23+0100\n"
"Last-Translator: Claudio Sampaio (Patola) <patola@gmail.com>\n"
"Language-Team: Portuguese <>\n"
"Language: pt_BR\n"
@@ -19,7 +19,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Lokalize 25.12.1\n"
"X-Generator: Lokalize 25.12.2\n"
#: dashboard/apk_installer.cpp:137
#, kde-format
@@ -121,8 +121,8 @@ msgstr "Verificando a última versão..."
msgid "No APK is available for this version"
msgstr "Nenhum APK está disponível para esta versão"
#: dashboard/qml/ApkInstallPage.qml:45 dashboard/qml/Main.qml:368
#: dashboard/qml/Main.qml:426 dashboard/qml/WizardPage.qml:211
#: dashboard/qml/ApkInstallPage.qml:45 dashboard/qml/Main.qml:376
#: dashboard/qml/Main.qml:434 dashboard/qml/WizardPage.qml:211
#: dashboard/qml/WizardPage.qml:337
#, kde-format
msgid "ADB is not installed"
@@ -165,7 +165,7 @@ msgstr "Reinstalar WiVRn"
msgid "Install WiVRn"
msgstr "Instalar WiVRn"
#: dashboard/qml/HeadsetsPage.qml:12 dashboard/qml/Main.qml:431
#: dashboard/qml/HeadsetsPage.qml:12 dashboard/qml/Main.qml:439
#, kde-format
msgid "Headsets"
msgstr "Headsets"
@@ -291,7 +291,7 @@ msgid "Avahi daemon is not started"
msgstr "Avahi daemon não foi iniciado"
#: dashboard/qml/Main.qml:157 dashboard/qml/Main.qml:171
#: dashboard/qml/Main.qml:223
#: dashboard/qml/Main.qml:231
#, kde-format
msgid "Fix it"
msgstr "Conserte"
@@ -315,6 +315,18 @@ msgstr "Mais informações"
#: dashboard/qml/Main.qml:193
#, kde-format
msgid "Vulkan drivers cannot be found, you may need to run \"flatpak update\""
msgstr ""
"Drivers vulkan não foram encontrados, você pode ter que rodar \"flatpak update"
"\""
#: dashboard/qml/Main.qml:193
#, kde-format
msgid "Vulkan drivers cannot be found"
msgstr "Drivers vulkan não foram encontrados"
#: dashboard/qml/Main.qml:201
#, kde-format
msgid ""
"Use the Mesa (radv) driver for AMD GPUs\n"
"Hardware encoding with vaapi does not work with AMDVLK and AMDGPU-PRO"
@@ -322,7 +334,7 @@ msgstr ""
"Use o driver Mesa (radv) para GPUs AMD\n"
"Codificação de hardware com a vaapi não funciona com AMDVLK e AMDGPU-PRO"
#: dashboard/qml/Main.qml:201
#: dashboard/qml/Main.qml:209
#, kde-format
msgid ""
"No OpenVR compatibility detected, Steam games won't be able to load VR.\n"
@@ -332,127 +344,127 @@ msgstr ""
"conseguirão carregar em VR.\n"
"Instale o xrizer ou o OpenComposite."
#: dashboard/qml/Main.qml:209
#: dashboard/qml/Main.qml:217
#, kde-format
msgid "Steam is installed as a snap. Snaps are not compatible with WiVRn."
msgstr "A Steam está instalada como snap. Snaps não são compatíveis com WiVRn."
#: dashboard/qml/Main.qml:217
#: dashboard/qml/Main.qml:225
#, kde-format
msgid ""
"Steam is installed as a flatpak but does not have sufficient permissions."
msgstr "A Steam está instalada como flatpak e não tem permissões suficientes."
#: dashboard/qml/Main.qml:232
#: dashboard/qml/Main.qml:240
#, kde-format
msgid "Restart the server for configuration changes to take effect"
msgstr ""
"Reinicie o servidor para que as alterações de configuração tenham efeito"
#: dashboard/qml/Main.qml:238
#: dashboard/qml/Main.qml:246
#, kde-format
msgctxt "restart the server"
msgid "Restart now"
msgstr "Reiniciar agora"
#: dashboard/qml/Main.qml:263
#: dashboard/qml/Main.qml:271
#, kde-format
msgid "Server failed to start"
msgstr "Servidor falhou em iniciar"
#: dashboard/qml/Main.qml:269 dashboard/qml/TroubleshootPage.qml:89
#: dashboard/qml/Main.qml:277 dashboard/qml/TroubleshootPage.qml:89
#, kde-format
msgid "Open server logs"
msgstr "Abrir logs do servidor"
#: dashboard/qml/Main.qml:295
#: dashboard/qml/Main.qml:303
#, kde-format
msgid "Server status"
msgstr "Status do servidor"
#: dashboard/qml/Main.qml:301
#: dashboard/qml/Main.qml:309
#, kde-format
msgctxt "whether the server is running, displayed in front of a checkbox"
msgid "Running"
msgstr "Rodando"
#: dashboard/qml/Main.qml:314
#: dashboard/qml/Main.qml:322
#, kde-format
msgctxt "whether pairing is enabled, displayed in front of a checkbox"
msgid "Pairing"
msgstr "Pareando"
#: dashboard/qml/Main.qml:334
#: dashboard/qml/Main.qml:342
#, kde-format
msgid "Headset status"
msgstr "Status do headset"
#: dashboard/qml/Main.qml:341
#: dashboard/qml/Main.qml:349
#, kde-format
msgctxt "label for headset name/status under server running switch"
msgid "Headset"
msgstr "Headset"
#: dashboard/qml/Main.qml:344
#: dashboard/qml/Main.qml:352
#, kde-format
msgid "Not connected"
msgstr "Não conectado"
#: dashboard/qml/Main.qml:348
#: dashboard/qml/Main.qml:356
#, kde-format
msgid "Disconnect"
msgstr "Desconectar"
#: dashboard/qml/Main.qml:357 dashboard/qml/Main.qml:365
#: dashboard/qml/Main.qml:372
#: dashboard/qml/Main.qml:365 dashboard/qml/Main.qml:373
#: dashboard/qml/Main.qml:380
#, kde-format
msgctxt "label for USB status or connect button"
msgid "USB"
msgstr "USB"
#: dashboard/qml/Main.qml:358
#: dashboard/qml/Main.qml:366
#, kde-format
msgctxt "usb connect button"
msgid "Connect (wired)"
msgstr "Conectar (por cabo)"
#: dashboard/qml/Main.qml:375 dashboard/qml/WizardPage.qml:339
#: dashboard/qml/Main.qml:383 dashboard/qml/WizardPage.qml:339
#, kde-format
msgid "No headset is connected or your headset is not in developer mode"
msgstr ""
"Nenhum headset está conectado ou seu headset não está em modo desenvolvedor"
#: dashboard/qml/Main.qml:396
#: dashboard/qml/Main.qml:404
#, kde-format
msgid "Steam information"
msgstr "Informações da Steam"
#: dashboard/qml/Main.qml:412
#: dashboard/qml/Main.qml:420
#, kde-format
msgid "Wizard"
msgstr "Assistente"
#: dashboard/qml/Main.qml:418
#: dashboard/qml/Main.qml:426
#, kde-format
msgid "Install the app"
msgstr "Instalar o aplicativo"
#: dashboard/qml/Main.qml:437 dashboard/qml/SettingsPage.qml:14
#: dashboard/qml/Main.qml:445 dashboard/qml/SettingsPage.qml:14
#, kde-format
msgid "Settings"
msgstr "Ajustes"
#: dashboard/qml/Main.qml:443
#: dashboard/qml/Main.qml:451
#, kde-format
msgid "About"
msgstr "Sobre"
#: dashboard/qml/Main.qml:448 dashboard/qml/TroubleshootPage.qml:10
#: dashboard/qml/Main.qml:456 dashboard/qml/TroubleshootPage.qml:10
#, kde-format
msgid "Troubleshoot"
msgstr "Resolver problemas"
#: dashboard/qml/Main.qml:455
#: dashboard/qml/Main.qml:463
#, kde-format
msgid "Version %1"
msgstr "Versão %1"
+44 -34
View File
@@ -8,8 +8,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WiVRn-dashboard\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-02-02 21:05+0800\n"
"PO-Revision-Date: 2026-02-08 12:43+0800\n"
"POT-Creation-Date: 2026-02-18 16:24+0800\n"
"PO-Revision-Date: 2026-02-25 21:21+0800\n"
"Last-Translator: BERADQ <adqber123@outlook.com>\n"
"Language-Team: Chinese (China)\n"
"Language: zh_CN\n"
@@ -119,8 +119,8 @@ msgstr "正在检查最新版本..."
msgid "No APK is available for this version"
msgstr "此版本无预编译 APK"
#: dashboard/qml/ApkInstallPage.qml:45 dashboard/qml/Main.qml:368
#: dashboard/qml/Main.qml:426 dashboard/qml/WizardPage.qml:211
#: dashboard/qml/ApkInstallPage.qml:45 dashboard/qml/Main.qml:376
#: dashboard/qml/Main.qml:434 dashboard/qml/WizardPage.qml:211
#: dashboard/qml/WizardPage.qml:337
#, kde-format
msgid "ADB is not installed"
@@ -161,7 +161,7 @@ msgstr "重新安装 WiVRn"
msgid "Install WiVRn"
msgstr "安装 WiVRn"
#: dashboard/qml/HeadsetsPage.qml:12 dashboard/qml/Main.qml:431
#: dashboard/qml/HeadsetsPage.qml:12 dashboard/qml/Main.qml:439
#, kde-format
msgid "Headsets"
msgstr "头显"
@@ -282,7 +282,7 @@ msgid "Avahi daemon is not started"
msgstr "Avahi 守护进程未启用"
#: dashboard/qml/Main.qml:157 dashboard/qml/Main.qml:171
#: dashboard/qml/Main.qml:223
#: dashboard/qml/Main.qml:231
#, kde-format
msgid "Fix it"
msgstr "修复"
@@ -305,6 +305,16 @@ msgstr "更多信息"
#: dashboard/qml/Main.qml:193
#, kde-format
msgid "Vulkan drivers cannot be found, you may need to run \"flatpak update\""
msgstr "找不到 Vulkan 设备,您或许需要执行 \"flatpak update\""
#: dashboard/qml/Main.qml:193
#, kde-format
msgid "Vulkan drivers cannot be found"
msgstr "无法找到 Vulkan 设备"
#: dashboard/qml/Main.qml:201
#, kde-format
msgid ""
"Use the Mesa (radv) driver for AMD GPUs\n"
"Hardware encoding with vaapi does not work with AMDVLK and AMDGPU-PRO"
@@ -312,7 +322,7 @@ msgstr ""
"AMD 显卡请使用 Mesa (radv) 驱动程序\n"
"使用 vaapi 的硬件编码不适用于 AMDVLK 和 AMDGPU-PRO"
#: dashboard/qml/Main.qml:201
#: dashboard/qml/Main.qml:209
#, kde-format
msgid ""
"No OpenVR compatibility detected, Steam games won't be able to load VR.\n"
@@ -321,142 +331,142 @@ msgstr ""
"系统未检测到 OpenVR 兼容层,Steam 平台上的 VR 游戏无法正常加载。\n"
"请安装 xrizer 或 OpenComposite"
#: dashboard/qml/Main.qml:209
#: dashboard/qml/Main.qml:217
#, kde-format
msgid "Steam is installed as a snap. Snaps are not compatible with WiVRn."
msgstr "Steam 是以 snap 方式安装的。Snap 与 WiVRn 不兼容。"
#: dashboard/qml/Main.qml:217
#: dashboard/qml/Main.qml:225
#, kde-format
msgid ""
"Steam is installed as a flatpak but does not have sufficient permissions."
msgstr "Steam 是以 flatpak 方式安装的,但权限不足。"
#: dashboard/qml/Main.qml:232
#: dashboard/qml/Main.qml:240
#, kde-format
msgid "Restart the server for configuration changes to take effect"
msgstr "重新启动服务器以使配置更改生效。"
#: dashboard/qml/Main.qml:238
#: dashboard/qml/Main.qml:246
#, kde-format
msgctxt "restart the server"
msgid "Restart now"
msgstr "立即重新启动"
#: dashboard/qml/Main.qml:263
#: dashboard/qml/Main.qml:271
#, kde-format
msgid "Server failed to start"
msgstr "服务器启动失败"
#: dashboard/qml/Main.qml:269 dashboard/qml/TroubleshootPage.qml:89
#: dashboard/qml/Main.qml:277 dashboard/qml/TroubleshootPage.qml:89
#, kde-format
msgid "Open server logs"
msgstr "开启服务器日志"
#: dashboard/qml/Main.qml:295
#: dashboard/qml/Main.qml:303
#, kde-format
msgid "Server status"
msgstr "服务器状态"
#: dashboard/qml/Main.qml:301
#: dashboard/qml/Main.qml:309
#, kde-format
msgctxt "whether the server is running, displayed in front of a checkbox"
msgid "Running"
msgstr "运行"
#: dashboard/qml/Main.qml:314
#: dashboard/qml/Main.qml:322
#, kde-format
msgctxt "whether pairing is enabled, displayed in front of a checkbox"
msgid "Pairing"
msgstr "配对"
#: dashboard/qml/Main.qml:334
#: dashboard/qml/Main.qml:342
#, kde-format
msgid "Headset status"
msgstr "头显状态"
#: dashboard/qml/Main.qml:341
#: dashboard/qml/Main.qml:349
#, kde-format
msgctxt "label for headset name/status under server running switch"
msgid "Headset"
msgstr "头显"
#: dashboard/qml/Main.qml:344
#: dashboard/qml/Main.qml:352
#, kde-format
msgid "Not connected"
msgstr "未连接"
#: dashboard/qml/Main.qml:348
#: dashboard/qml/Main.qml:356
#, kde-format
msgid "Disconnect"
msgstr "断开连接"
#: dashboard/qml/Main.qml:357 dashboard/qml/Main.qml:365
#: dashboard/qml/Main.qml:372
#: dashboard/qml/Main.qml:365 dashboard/qml/Main.qml:373
#: dashboard/qml/Main.qml:380
#, kde-format
msgctxt "label for USB status or connect button"
msgid "USB"
msgstr "USB"
#: dashboard/qml/Main.qml:358
#: dashboard/qml/Main.qml:366
#, kde-format
msgctxt "usb connect button"
msgid "Connect (wired)"
msgstr "链接 (有线)"
#: dashboard/qml/Main.qml:375 dashboard/qml/WizardPage.qml:339
#: dashboard/qml/Main.qml:383 dashboard/qml/WizardPage.qml:339
#, kde-format
msgid "No headset is connected or your headset is not in developer mode"
msgstr "没有检测到头显,或您的头显未启用开发者模式"
#: dashboard/qml/Main.qml:396
#: dashboard/qml/Main.qml:404
#, kde-format
msgid "Steam information"
msgstr "Steam 信息"
#: dashboard/qml/Main.qml:412
#: dashboard/qml/Main.qml:420
#, kde-format
msgid "Wizard"
msgstr "向导"
#: dashboard/qml/Main.qml:418
#: dashboard/qml/Main.qml:426
#, kde-format
msgid "Install the app"
msgstr "安装应用程序"
#: dashboard/qml/Main.qml:437 dashboard/qml/SettingsPage.qml:14
#: dashboard/qml/Main.qml:445 dashboard/qml/SettingsPage.qml:14
#, kde-format
msgid "Settings"
msgstr "设置"
#: dashboard/qml/Main.qml:443
#: dashboard/qml/Main.qml:451
#, kde-format
msgid "About"
msgstr "关于"
#: dashboard/qml/Main.qml:448 dashboard/qml/TroubleshootPage.qml:10
#: dashboard/qml/Main.qml:456 dashboard/qml/TroubleshootPage.qml:10
#, kde-format
msgid "Troubleshoot"
msgstr "疑难解答"
#: dashboard/qml/Main.qml:455
#: dashboard/qml/Main.qml:463
#, kde-format
msgid "Version %1"
msgstr "版本 %1"
#: dashboard/qml/SelectGame.qml:14
#: dashboard/qml/SelectGame.qml:12
#, kde-format
msgctxt "don't start an application automatically"
msgid "None"
msgstr "无"
#: dashboard/qml/SelectGame.qml:20
#: dashboard/qml/SelectGame.qml:18
#, kde-format
msgctxt "choose a custom application to start"
msgid "Custom"
msgstr "自定义"
#: dashboard/qml/SelectGame.qml:72
#: dashboard/qml/SelectGame.qml:70
#, kde-format
msgctxt "browse a file to choose the application to start"
msgid "Browse"
+39 -39
View File
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WiVRn\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-02-07 17:21+0800\n"
"POT-Creation-Date: 2026-02-24 02:14+0800\n"
"PO-Revision-Date: 2025-12-31 18:23+0800\n"
"Last-Translator: BERADQ <adqber123@outlook.com>\n"
"Language-Team: Chinese (China)\n"
@@ -68,11 +68,11 @@ msgstr "无法连接至 {} ({}): {}"
msgid "Waiting for connection"
msgstr "等待连接"
#: client/scenes/lobby.cpp:1316
#: client/scenes/lobby.cpp:1307
msgid "Passthrough"
msgstr "透视"
#: client/scenes/lobby.cpp:1328
#: client/scenes/lobby.cpp:1319
msgid "Default environment"
msgstr "默认环境"
@@ -92,13 +92,13 @@ msgid "Disabled"
msgstr "停用"
#: client/scenes/lobby_gui.cpp:114 client/scenes/lobby_gui.cpp:258
#: client/scenes/stream_gui.cpp:1010
#: client/scenes/stream_gui.cpp:992
msgid "Disconnect"
msgstr "终止连接"
#: client/scenes/lobby_gui.cpp:134 client/scenes/lobby_gui_customize.cpp:753
#: client/scenes/lobby_gui_customize.cpp:844
#: client/scenes/lobby_gui_customize.cpp:900 client/scenes/stream_gui.cpp:1006
#: client/scenes/lobby_gui_customize.cpp:900 client/scenes/stream_gui.cpp:988
msgid "Close"
msgstr "关闭"
@@ -136,7 +136,7 @@ msgid "TCP only"
msgstr "仅限 TCP"
#: client/scenes/lobby_gui.cpp:319 client/scenes/lobby_gui_customize.cpp:655
#: client/scenes/stream_gui.cpp:962
#: client/scenes/stream_gui.cpp:944
msgid "Cancel"
msgstr "取消"
@@ -181,12 +181,12 @@ msgstr "语言"
msgid "System language"
msgstr "系统语言"
#: client/scenes/lobby_gui.cpp:580 client/scenes/stream_gui.cpp:411
#: client/scenes/lobby_gui.cpp:580 client/scenes/stream_gui.cpp:412
msgid "Refresh rate"
msgstr "刷新率"
#: client/scenes/lobby_gui.cpp:580 client/scenes/lobby_gui.cpp:582
#: client/scenes/stream_gui.cpp:411 client/scenes/stream_gui.cpp:413
#: client/scenes/stream_gui.cpp:412 client/scenes/stream_gui.cpp:414
msgctxt "automatic refresh rate"
msgid "Automatic"
msgstr "自动"
@@ -408,7 +408,7 @@ msgstr ""
"当串流分辨率低于头显原生分辨率时很有用"
#: client/scenes/lobby_gui.cpp:1153 client/scenes/lobby_gui.cpp:1161
#: client/scenes/stream_gui.cpp:172 client/scenes/stream_gui.cpp:370
#: client/scenes/stream_gui.cpp:173 client/scenes/stream_gui.cpp:371
msgid "CPU time"
msgstr "CPU 时间"
@@ -417,7 +417,7 @@ msgid "CPU time [ms]"
msgstr "CPU 时间 [ms]"
#: client/scenes/lobby_gui.cpp:1167 client/scenes/lobby_gui.cpp:1175
#: client/scenes/stream_gui.cpp:174 client/scenes/stream_gui.cpp:371
#: client/scenes/stream_gui.cpp:175 client/scenes/stream_gui.cpp:372
msgid "GPU time"
msgstr "GPU 时间"
@@ -505,7 +505,7 @@ msgstr "新增服务器"
msgid "Server list"
msgstr "服务器列表"
#: client/scenes/lobby_gui.cpp:1940 client/scenes/stream_gui.cpp:991
#: client/scenes/lobby_gui.cpp:1940 client/scenes/stream_gui.cpp:973
msgid "Settings"
msgstr "设置"
@@ -616,73 +616,73 @@ msgstr "下载更多环境"
msgid "Open local glTF model"
msgstr "打开本地 glTF 模型"
#: client/scenes/stream_gui.cpp:174
#: client/scenes/stream_gui.cpp:175
msgid "Defoveate"
msgstr "去凹形畸变"
#: client/scenes/stream_gui.cpp:176
#: client/scenes/stream_gui.cpp:177
msgid "Network"
msgstr "网络"
#: client/scenes/stream_gui.cpp:176 client/scenes/stream_gui.cpp:368
#: client/scenes/stream_gui.cpp:177 client/scenes/stream_gui.cpp:369
msgid "Download"
msgstr "下载"
#: client/scenes/stream_gui.cpp:177 client/scenes/stream_gui.cpp:369
#: client/scenes/stream_gui.cpp:178 client/scenes/stream_gui.cpp:370
msgid "Upload"
msgstr "上传"
#: client/scenes/stream_gui.cpp:246
#: client/scenes/stream_gui.cpp:247
#, c++-format
msgid "Decoder {}"
msgstr "解码器 {}"
#: client/scenes/stream_gui.cpp:258
#: client/scenes/stream_gui.cpp:259
msgid "Timings [ms]"
msgstr "时间信息 [ms]"
#: client/scenes/stream_gui.cpp:318
#: client/scenes/stream_gui.cpp:319
msgid "Encode"
msgstr "编码"
#: client/scenes/stream_gui.cpp:319
#: client/scenes/stream_gui.cpp:320
msgid "Send"
msgstr "发送"
#: client/scenes/stream_gui.cpp:320
#: client/scenes/stream_gui.cpp:321
msgid "Receive"
msgstr "接收"
#: client/scenes/stream_gui.cpp:321
#: client/scenes/stream_gui.cpp:322
msgid "Decode"
msgstr "解码"
#: client/scenes/stream_gui.cpp:322
#: client/scenes/stream_gui.cpp:323
msgid "Blitted"
msgstr "已传输位块"
#: client/scenes/stream_gui.cpp:323
#: client/scenes/stream_gui.cpp:324
msgid "Displayed"
msgstr "已显示"
#: client/scenes/stream_gui.cpp:324
#: client/scenes/stream_gui.cpp:325
msgid "Predicted"
msgstr "已预测"
#: client/scenes/stream_gui.cpp:343
#: client/scenes/stream_gui.cpp:344
#, c++-format
msgid "Estimated motion to photons latency: {}ms"
msgstr "估计从运动到显示延迟: {}ms"
#: client/scenes/stream_gui.cpp:348
#: client/scenes/stream_gui.cpp:349
msgid "Press the grip button to move the window"
msgstr "按下抓握键来移动窗口"
#: client/scenes/stream_gui.cpp:350 client/scenes/stream_gui.cpp:918
#: client/scenes/stream_gui.cpp:351 client/scenes/stream_gui.cpp:900
msgid "Press both thumbsticks to display the WiVRn window"
msgstr "同时按下两侧摇杆以显示 WiVRn 窗口"
#: client/scenes/stream_gui.cpp:372
#: client/scenes/stream_gui.cpp:373
msgid "Motion to photon latency"
msgstr "从动作到显示的延迟"
@@ -694,29 +694,29 @@ msgstr "码率:"
msgid "Click to adjust bitrate"
msgstr "点击以调整码率"
#: client/scenes/stream_gui.cpp:531
#: client/scenes/stream_gui.cpp:532
msgid "Foveation center override"
msgstr "注视点渲染位置覆盖"
#: client/scenes/stream_gui.cpp:534
#: client/scenes/stream_gui.cpp:535
msgid "Enable"
msgstr "启用"
#: client/scenes/stream_gui.cpp:542 client/scenes/stream_gui.cpp:614
#: client/scenes/stream_gui.cpp:543 client/scenes/stream_gui.cpp:614
#, c++-format
msgid "Height {:.1f} deg"
msgstr "俯仰 {:.1f}°"
#: client/scenes/stream_gui.cpp:543 client/scenes/stream_gui.cpp:615
#: client/scenes/stream_gui.cpp:544 client/scenes/stream_gui.cpp:615
#, c++-format
msgid "Distance {:.2f} m"
msgstr "距离 {:.2f}m"
#: client/scenes/stream_gui.cpp:544
#: client/scenes/stream_gui.cpp:545
msgid "Default"
msgstr "默认"
#: client/scenes/stream_gui.cpp:555
#: client/scenes/stream_gui.cpp:556
msgid "Change"
msgstr "变更"
@@ -753,23 +753,23 @@ msgstr "叠加层"
msgid "Request to quit, may be ignored by the application"
msgstr "退出请求可能会被应用程序忽略"
#: client/scenes/stream_gui.cpp:977
#: client/scenes/stream_gui.cpp:959
msgid "Applications"
msgstr "应用程序"
#: client/scenes/stream_gui.cpp:980
#: client/scenes/stream_gui.cpp:962
msgid "Start"
msgstr "启动"
#: client/scenes/stream_gui.cpp:994
#: client/scenes/stream_gui.cpp:976
msgid "Stats"
msgstr "统计"
#: client/scenes/stream_gui.cpp:1000
#: client/scenes/stream_gui.cpp:982
msgid "Statistics overlay"
msgstr "统计数据叠加"
#: client/scenes/stream_gui.cpp:1003
#: client/scenes/stream_gui.cpp:985
msgid "Compact view"
msgstr "概览"
+1 -1
View File
@@ -1 +1 @@
723652b545a79609f9f04cb89fcbf807d9d6451a
ee655a920cb4b50bafa2af2c92333a503e40cae6
@@ -1,7 +1,7 @@
From 2884795b7d352e3e45348473a17660a568260d6e Mon Sep 17 00:00:00 2001
From 563f347bf4d59b4a82144e25c3be894a0cd17c8d Mon Sep 17 00:00:00 2001
From: Patrick Nicolas <patricknicolas@laposte.net>
Date: Tue, 22 Oct 2024 15:23:19 +0200
Subject: [PATCH 1/8] c/multi: early wake of compositor
Subject: [PATCH 1/9] c/multi: early wake of compositor
---
.../compositor/multi/comp_multi_compositor.c | 14 +++++++++
@@ -1,17 +1,17 @@
From 8d22720c9574146f7115f5ba7ac39f3c4e4f48ae Mon Sep 17 00:00:00 2001
From 7d7c139b9ed03ec492256760c6acd1c7364c2e2a Mon Sep 17 00:00:00 2001
From: Patrick Nicolas <patricknicolas@laposte.net>
Date: Tue, 8 Oct 2024 22:13:15 +0200
Subject: [PATCH 2/8] Use extern socket fd
Subject: [PATCH 2/9] Use extern socket fd
---
src/xrt/ipc/server/ipc_server_mainloop_linux.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/xrt/ipc/server/ipc_server_mainloop_linux.c b/src/xrt/ipc/server/ipc_server_mainloop_linux.c
index 36bf3e31d..e40447bb2 100644
index 777a31e96..9235375e6 100644
--- a/src/xrt/ipc/server/ipc_server_mainloop_linux.c
+++ b/src/xrt/ipc/server/ipc_server_mainloop_linux.c
@@ -48,6 +48,8 @@
@@ -49,6 +49,8 @@
#endif
@@ -20,7 +20,7 @@ index 36bf3e31d..e40447bb2 100644
/*
*
* Static functions.
@@ -56,6 +58,12 @@
@@ -57,6 +59,12 @@
static int
get_systemd_socket(struct ipc_server_mainloop *ml, int *out_fd)
{
@@ -1,7 +1,7 @@
From dc8c6b0fdd002631827528b0cd831e762cf74c31 Mon Sep 17 00:00:00 2001
From 1328192bc28f312e728460d6c29ab150a9b655bd Mon Sep 17 00:00:00 2001
From: galister <85970-galister@users.noreply.gitlab.freedesktop.org>
Date: Sat, 23 Nov 2024 02:42:12 +0900
Subject: [PATCH 3/8] change environment blend mode selection logic
Subject: [PATCH 3/9] change environment blend mode selection logic
---
src/xrt/compositor/multi/comp_multi_system.c | 26 +++++++++++++-------
@@ -1,7 +1,7 @@
From f4b4c07740dcc58438340171ec473570b002b379 Mon Sep 17 00:00:00 2001
From 18f87ff2f292e2f4cab8718601e6d5ba236a5013 Mon Sep 17 00:00:00 2001
From: Patrick Nicolas <patricknicolas@laposte.net>
Date: Sat, 15 Mar 2025 22:19:48 +0100
Subject: [PATCH 4/8] st/oxr: forward 0 refresh rate
Subject: [PATCH 4/9] st/oxr: forward 0 refresh rate
---
src/xrt/compositor/main/comp_compositor.c | 2 +-
@@ -22,7 +22,7 @@ index b6c4947bf..0e8ed02b7 100644
return result;
}
diff --git a/src/xrt/state_trackers/oxr/oxr_api_session.c b/src/xrt/state_trackers/oxr/oxr_api_session.c
index 587cdf28f..b1f96df54 100644
index 09297f885..9f3a7ebc2 100644
--- a/src/xrt/state_trackers/oxr/oxr_api_session.c
+++ b/src/xrt/state_trackers/oxr/oxr_api_session.c
@@ -455,15 +455,11 @@ oxr_xrRequestDisplayRefreshRateFB(XrSession session, float displayRefreshRate)
@@ -1,14 +1,14 @@
From 73f329eaba1e46bf62ff6579e27cd39f0d9e6730 Mon Sep 17 00:00:00 2001
From 8c322edfafa6179875bfe1dca1517c4043f0c5b4 Mon Sep 17 00:00:00 2001
From: Patrick Nicolas <patricknicolas@laposte.net>
Date: Wed, 11 Sep 2024 22:56:29 +0200
Subject: [PATCH 5/8] Replace distortion with foveation
Subject: [PATCH 5/9] Replace distortion with foveation
---
src/xrt/compositor/main/comp_renderer.c | 6 +-
src/xrt/compositor/main/comp_target.h | 3 +-
src/xrt/compositor/render/CMakeLists.txt | 2 +-
src/xrt/compositor/render/render_compute.c | 410 +++++++-----------
src/xrt/compositor/render/render_interface.h | 95 ++--
src/xrt/compositor/render/render_interface.h | 94 ++--
src/xrt/compositor/render/render_resources.c | 106 ++---
src/xrt/compositor/shaders/CMakeLists.txt | 2 +-
src/xrt/compositor/shaders/clear.comp | 4 +-
@@ -17,7 +17,7 @@ Subject: [PATCH 5/8] Replace distortion with foveation
.../compositor/util/comp_high_level_render.h | 9 +-
src/xrt/compositor/util/comp_render.h | 11 +-
src/xrt/compositor/util/comp_render_cs.c | 112 ++---
13 files changed, 356 insertions(+), 592 deletions(-)
13 files changed, 355 insertions(+), 592 deletions(-)
diff --git a/src/xrt/compositor/main/comp_renderer.c b/src/xrt/compositor/main/comp_renderer.c
index f6c403015..ff9728a59 100644
@@ -647,10 +647,10 @@ index 62d7138b9..44c3f0aee 100644
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.image = target_image,
diff --git a/src/xrt/compositor/render/render_interface.h b/src/xrt/compositor/render/render_interface.h
index 2b7893881..3c59645dc 100644
index 8a198707f..a4b5c53a2 100644
--- a/src/xrt/compositor/render/render_interface.h
+++ b/src/xrt/compositor/render/render_interface.h
@@ -82,12 +82,8 @@ extern "C" {
@@ -83,12 +83,8 @@ extern "C" {
#define RENDER_MAX_LAYER_RUNS_SIZE (XRT_MAX_VIEWS)
#define RENDER_MAX_LAYER_RUNS_COUNT(RENDER_RESOURCES) (RENDER_RESOURCES->view_count)
@@ -665,7 +665,7 @@ index 2b7893881..3c59645dc 100644
//! The binding that the layer projection and quad shader have their UBO on.
#define RENDER_BINDING_LAYER_SHARED_UBO 0
@@ -120,12 +116,6 @@ extern "C" {
@@ -121,12 +117,6 @@ extern "C" {
uint32_t
render_max_layers_capable(const struct vk_bundle *vk, bool use_compute, uint32_t desired_max_layers);
@@ -678,7 +678,7 @@ index 2b7893881..3c59645dc 100644
/*!
* Calculates a timewarp matrix which takes in NDC coords and gives out results
* in [-1, 1] space that needs a perspective divide.
@@ -465,7 +455,8 @@ struct render_resources
@@ -466,7 +456,8 @@ struct render_resources
uint32_t distortion_binding;
//! Writing the image out too.
@@ -688,7 +688,7 @@ index 2b7893881..3c59645dc 100644
//! Uniform data binding.
uint32_t ubo_binding;
@@ -502,9 +493,6 @@ struct render_resources
@@ -503,9 +494,6 @@ struct render_resources
//! Doesn't depend on target so is static.
VkPipeline pipeline;
@@ -698,7 +698,7 @@ index 2b7893881..3c59645dc 100644
//! Target info.
struct render_buffer ubo;
} distortion;
@@ -526,17 +514,11 @@ struct render_resources
@@ -527,17 +515,11 @@ struct render_resources
//! Transform to go from UV to tangle angles.
struct xrt_normalized_rect uv_to_tanangle[XRT_MAX_VIEWS];
@@ -720,15 +720,7 @@ index 2b7893881..3c59645dc 100644
} distortion;
};
@@ -1262,6 +1244,7 @@ struct render_compute_layer_ubo_data
//! Timewarp matrices
struct xrt_matrix_4x4 transforms_timewarp[RENDER_MAX_LAYERS];
+
/*!
* For quad layers
*/
@@ -1307,6 +1290,14 @@ struct render_compute_distortion_ubo_data
@@ -1315,6 +1297,14 @@ struct render_compute_distortion_ubo_data
struct xrt_matrix_4x4 transform_timewarp_scanout_end[XRT_MAX_VIEWS];
};
@@ -743,7 +735,7 @@ index 2b7893881..3c59645dc 100644
/*!
* Init struct and create resources needed for compute rendering.
*
@@ -1360,7 +1351,8 @@ render_compute_layers(struct render_compute *render,
@@ -1368,7 +1358,8 @@ render_compute_layers(struct render_compute *render,
VkSampler src_samplers[RENDER_MAX_IMAGES_SIZE],
VkImageView src_image_views[RENDER_MAX_IMAGES_SIZE],
uint32_t num_srcs,
@@ -753,7 +745,7 @@ index 2b7893881..3c59645dc 100644
const struct render_viewport_data *view,
bool timewarp);
@@ -1368,44 +1360,14 @@ render_compute_layers(struct render_compute *render,
@@ -1376,44 +1367,14 @@ render_compute_layers(struct render_compute *render,
* @public @memberof render_compute
*/
void
@@ -806,7 +798,7 @@ index 2b7893881..3c59645dc 100644
/*!
* @public @memberof render_compute
@@ -1413,7 +1375,8 @@ render_compute_projection_no_timewarp(struct render_compute *render,
@@ -1421,7 +1382,8 @@ render_compute_projection_no_timewarp(struct render_compute *render,
void
render_compute_clear(struct render_compute *render,
VkImage target_image,
@@ -817,7 +809,7 @@ index 2b7893881..3c59645dc 100644
diff --git a/src/xrt/compositor/render/render_resources.c b/src/xrt/compositor/render/render_resources.c
index d28caaed8..5232a774d 100644
index e1b4f0916..9a993dc81 100644
--- a/src/xrt/compositor/render/render_resources.c
+++ b/src/xrt/compositor/render/render_resources.c
@@ -184,14 +184,15 @@ init_mesh_ubo_buffers(struct vk_bundle *vk, struct render_buffer ubo[XRT_MAX_VIE
@@ -906,7 +898,7 @@ index d28caaed8..5232a774d 100644
};
VkDescriptorSetLayoutCreateInfo set_layout_info = {
@@ -295,12 +309,6 @@ struct compute_layer_params
@@ -294,12 +308,6 @@ struct compute_layer_params
uint32_t image_array_size;
};
@@ -919,7 +911,7 @@ index d28caaed8..5232a774d 100644
XRT_CHECK_RESULT static VkResult
create_compute_layer_pipeline(struct vk_bundle *vk,
VkPipelineCache pipeline_cache,
@@ -345,35 +353,15 @@ create_compute_distortion_pipeline(struct vk_bundle *vk,
@@ -343,35 +351,15 @@ create_compute_distortion_pipeline(struct vk_bundle *vk,
VkPipelineCache pipeline_cache,
VkShaderModule shader,
VkPipelineLayout pipeline_layout,
@@ -956,7 +948,7 @@ index d28caaed8..5232a774d 100644
out_compute_pipeline); // out_compute_pipeline
}
@@ -539,8 +527,9 @@ render_resources_init(struct render_resources *r,
@@ -537,8 +525,9 @@ render_resources_init(struct render_resources *r,
}
r->compute.src_binding = 0;
r->compute.distortion_binding = 1;
@@ -967,7 +959,7 @@ index d28caaed8..5232a774d 100644
r->compute.layer.image_array_size =
MIN(vk->limits.max_per_stage_descriptor_sampled_images, RENDER_MAX_IMAGES_SIZE);
@@ -834,9 +823,9 @@ render_resources_init(struct render_resources *r,
@@ -832,9 +821,9 @@ render_resources_init(struct render_resources *r,
struct vk_descriptor_pool_info compute_pool_info = {
.uniform_per_descriptor_count = 1,
// layer images
@@ -979,7 +971,7 @@ index d28caaed8..5232a774d 100644
.descriptor_count = compute_descriptor_count,
.freeable = false,
};
@@ -856,7 +845,8 @@ render_resources_init(struct render_resources *r,
@@ -854,7 +843,8 @@ render_resources_init(struct render_resources *r,
ret = create_compute_layer_descriptor_set_layout( //
vk, // vk_bundle
r->compute.src_binding, // src_binding,
@@ -989,7 +981,7 @@ index d28caaed8..5232a774d 100644
r->compute.ubo_binding, // ubo_binding,
r->compute.layer.image_array_size, // source_images_count,
&r->compute.layer.descriptor_set_layout); // out_descriptor_set_layout
@@ -937,7 +927,8 @@ render_resources_init(struct render_resources *r,
@@ -933,7 +923,8 @@ render_resources_init(struct render_resources *r,
vk, // vk_bundle
r->compute.src_binding, // src_binding,
r->compute.distortion_binding, // distortion_binding,
@@ -999,7 +991,7 @@ index d28caaed8..5232a774d 100644
r->compute.ubo_binding, // ubo_binding,
&r->compute.distortion.descriptor_set_layout); // out_descriptor_set_layout
VK_CHK_WITH_RET(ret, "create_compute_distortion_descriptor_set_layout", false);
@@ -954,39 +945,16 @@ render_resources_init(struct render_resources *r,
@@ -950,39 +941,16 @@ render_resources_init(struct render_resources *r,
VK_NAME_PIPELINE_LAYOUT(vk, r->compute.distortion.pipeline_layout,
"render_resources compute distortion pipeline layout");
@@ -1039,7 +1031,7 @@ index d28caaed8..5232a774d 100644
size_t distortion_ubo_size = sizeof(struct render_compute_distortion_ubo_data);
ret = render_buffer_init( //
@@ -1039,15 +1007,8 @@ render_resources_init(struct render_resources *r,
@@ -1035,15 +1003,8 @@ render_resources_init(struct render_resources *r,
* Compute distortion textures, not created until later.
*/
@@ -1057,7 +1049,7 @@ index d28caaed8..5232a774d 100644
/*
@@ -1124,7 +1085,6 @@ render_resources_fini(struct render_resources *r)
@@ -1120,7 +1081,6 @@ render_resources_fini(struct render_resources *r)
D(DescriptorSetLayout, r->compute.distortion.descriptor_set_layout);
D(Pipeline, r->compute.distortion.pipeline);
@@ -1066,10 +1058,10 @@ index d28caaed8..5232a774d 100644
D(Pipeline, r->compute.clear.pipeline);
diff --git a/src/xrt/compositor/shaders/CMakeLists.txt b/src/xrt/compositor/shaders/CMakeLists.txt
index d8aca97e2..ffc79ca6e 100644
index c8c3ce3ab..b5d899cc9 100644
--- a/src/xrt/compositor/shaders/CMakeLists.txt
+++ b/src/xrt/compositor/shaders/CMakeLists.txt
@@ -25,7 +25,7 @@ set(SHADERS
@@ -26,7 +26,7 @@ set(SHADERS
spirv_shaders(
SHADER_HEADERS
SPIRV_VERSION
@@ -1415,7 +1407,7 @@ index bd7ab2957..c2b95d68d 100644
bool do_timewarp);
diff --git a/src/xrt/compositor/util/comp_render_cs.c b/src/xrt/compositor/util/comp_render_cs.c
index 6e93eabe8..4a304c6f7 100644
index a2b6e0d01..0868e515b 100644
--- a/src/xrt/compositor/util/comp_render_cs.c
+++ b/src/xrt/compositor/util/comp_render_cs.c
@@ -370,7 +370,8 @@ crc_clear_output(struct render_compute *render, const struct comp_render_dispatc
@@ -1,17 +1,17 @@
From 9d1294834f49fc90ea22f5d841d7c0e5c0c1045d Mon Sep 17 00:00:00 2001
From b9acd6d83db324c6f31572615fb6738a6f93d63c Mon Sep 17 00:00:00 2001
From: no name <git-am@invalid>
Date: Sun, 28 Sep 2025 11:33:10 +0200
Subject: [PATCH 6/8] d/steamvr_lh: prevent crash on vive pro2/WiVRn
Subject: [PATCH 6/9] d/steamvr_lh: prevent crash on vive pro2/WiVRn
---
src/xrt/drivers/steamvr_lh/steamvr_lh.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/xrt/drivers/steamvr_lh/steamvr_lh.cpp b/src/xrt/drivers/steamvr_lh/steamvr_lh.cpp
index 25c68a0ea..86baa9fd4 100644
index 0fbe4f563..dc9e3d3a5 100644
--- a/src/xrt/drivers/steamvr_lh/steamvr_lh.cpp
+++ b/src/xrt/drivers/steamvr_lh/steamvr_lh.cpp
@@ -913,7 +913,7 @@ steamvr_lh_create_devices(struct xrt_prober *xp, struct xrt_system_devices **out
@@ -954,7 +954,7 @@ steamvr_lh_create_devices(struct xrt_prober *xp, struct xrt_system_devices **out
// Include the HMD
if (svrs->ctx->hmd) {
@@ -1,18 +1,18 @@
From b9af535cf229acdbf7f1b534e9804c1b4e3fa3e1 Mon Sep 17 00:00:00 2001
From 8c6580e84690ffe8f082cdff5ead8443d1f6bf23 Mon Sep 17 00:00:00 2001
From: Sapphire <imsapphire0@gmail.com>
Date: Fri, 7 Nov 2025 20:41:16 -0600
Subject: [PATCH 7/8] st/oxr: push XrEventDataInteractionProfileChanged when
Subject: [PATCH 7/9] st/oxr: push XrEventDataInteractionProfileChanged when
profile changes to NULL
---
src/xrt/state_trackers/oxr/oxr_input.c | 15 +++++----------
src/xrt/state_trackers/oxr/actions/oxr_input.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/src/xrt/state_trackers/oxr/oxr_input.c b/src/xrt/state_trackers/oxr/oxr_input.c
index df2b479eb..c4b36ba81 100644
--- a/src/xrt/state_trackers/oxr/oxr_input.c
+++ b/src/xrt/state_trackers/oxr/oxr_input.c
@@ -1881,26 +1881,21 @@ oxr_session_update_action_bindings(struct oxr_logger *log, struct oxr_session *s
diff --git a/src/xrt/state_trackers/oxr/actions/oxr_input.c b/src/xrt/state_trackers/oxr/actions/oxr_input.c
index 349c9adcb..667163142 100644
--- a/src/xrt/state_trackers/oxr/actions/oxr_input.c
+++ b/src/xrt/state_trackers/oxr/actions/oxr_input.c
@@ -1945,26 +1945,21 @@ oxr_session_update_action_bindings(struct oxr_logger *log, struct oxr_session *s
}
}
@@ -1,40 +0,0 @@
From 02206ede3aae832be5024263a805cafee2264080 Mon Sep 17 00:00:00 2001
From: no name <git-am@invalid>
Date: Thu, 15 Jan 2026 12:13:06 +0100
Subject: [PATCH 8/8] Don't get pose data for fast path
---
src/xrt/compositor/main/comp_renderer.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/src/xrt/compositor/main/comp_renderer.c b/src/xrt/compositor/main/comp_renderer.c
index ff9728a59..08cdef540 100644
--- a/src/xrt/compositor/main/comp_renderer.c
+++ b/src/xrt/compositor/main/comp_renderer.c
@@ -972,14 +972,15 @@ dispatch_compute(struct comp_renderer *r,
struct xrt_pose world_poses_scanout_begin[XRT_MAX_VIEWS];
struct xrt_pose world_poses_scanout_end[XRT_MAX_VIEWS];
struct xrt_pose eye_poses[XRT_MAX_VIEWS];
- calc_pose_data( //
- r, //
- fov_source, //
- fovs, //
- world_poses_scanout_begin, //
- world_poses_scanout_end, //
- eye_poses, //
- render->r->view_count); //
+ if (!c->base.frame_params.one_projection_layer_fast_path)
+ calc_pose_data( //
+ r, //
+ fov_source, //
+ fovs, //
+ world_poses_scanout_begin, //
+ world_poses_scanout_end, //
+ eye_poses, //
+ render->r->view_count); //
// Target Vulkan resources..
VkImage target_image = r->c->target->images[r->acquired_buffer].handle;
--
2.53.0
@@ -0,0 +1,83 @@
From 3ec6ede2610ebbaa4ac6e9a76b387a2867db13a2 Mon Sep 17 00:00:00 2001
From: no name <git-am@invalid>
Date: Thu, 15 Jan 2026 12:13:06 +0100
Subject: [PATCH 8/9] Don't get pose data in compositor
Reproject onto the first projection layer's pose, if there isn't any get
it from device instead.
---
src/xrt/compositor/main/comp_renderer.c | 51 +++++++++++++++++++++----
1 file changed, 43 insertions(+), 8 deletions(-)
diff --git a/src/xrt/compositor/main/comp_renderer.c b/src/xrt/compositor/main/comp_renderer.c
index ff9728a59..1f01662b6 100644
--- a/src/xrt/compositor/main/comp_renderer.c
+++ b/src/xrt/compositor/main/comp_renderer.c
@@ -948,6 +948,24 @@ dispatch_graphics(struct comp_renderer *r,
*
*/
+static struct comp_layer *
+get_projection_layer(struct comp_layer_accum *layers)
+{
+ for (uint32_t layer = 0; layer < layers->layer_count; ++layer) {
+ switch (layers->layers[layer].data.type) {
+ case XRT_LAYER_PROJECTION:
+ case XRT_LAYER_PROJECTION_DEPTH: return &layers->layers[layer];
+ case XRT_LAYER_QUAD:
+ case XRT_LAYER_CUBE:
+ case XRT_LAYER_CYLINDER:
+ case XRT_LAYER_EQUIRECT1:
+ case XRT_LAYER_EQUIRECT2:
+ case XRT_LAYER_PASSTHROUGH: break;
+ }
+ }
+ return NULL;
+}
+
/*!
* @pre render_compute_init(render, &c->nr)
*/
@@ -972,14 +990,31 @@ dispatch_compute(struct comp_renderer *r,
struct xrt_pose world_poses_scanout_begin[XRT_MAX_VIEWS];
struct xrt_pose world_poses_scanout_end[XRT_MAX_VIEWS];
struct xrt_pose eye_poses[XRT_MAX_VIEWS];
- calc_pose_data( //
- r, //
- fov_source, //
- fovs, //
- world_poses_scanout_begin, //
- world_poses_scanout_end, //
- eye_poses, //
- render->r->view_count); //
+ if (!c->base.frame_params.one_projection_layer_fast_path) {
+ struct comp_layer *proj_layer = get_projection_layer(&c->base.layer_accum);
+ if (proj_layer) {
+ struct xrt_layer_projection_view_data *data = proj_layer->data.proj.v;
+ // depth has the same first member as proj
+ for (int view = 0; view < XRT_MAX_VIEWS; ++view) {
+ fovs[view] = data[view].fov;
+ world_poses_scanout_begin[view] = data[view].pose;
+ world_poses_scanout_end[view] = data[view].pose;
+ eye_poses[view] = data[view].pose;
+
+ r->c->base.frame_params.fovs[view] = data[view].fov;
+ r->c->base.frame_params.poses[view] = data[view].pose;
+ }
+ } else {
+ calc_pose_data( //
+ r, //
+ fov_source, //
+ fovs, //
+ world_poses_scanout_begin, //
+ world_poses_scanout_end, //
+ eye_poses, //
+ render->r->view_count); //
+ }
+ }
// Target Vulkan resources..
VkImage target_image = r->c->target->images[r->acquired_buffer].handle;
--
2.53.0
@@ -0,0 +1,33 @@
From 14e5d4a2f29b95f0f7933dbf2dde5000c0a98866 Mon Sep 17 00:00:00 2001
From: no name <git-am@invalid>
Date: Sun, 25 Jan 2026 10:09:10 +0100
Subject: [PATCH 9/9] don't verify GL stuff
---
src/xrt/state_trackers/oxr/oxr_verify.c | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/src/xrt/state_trackers/oxr/oxr_verify.c b/src/xrt/state_trackers/oxr/oxr_verify.c
index 68906d7de..239f87fba 100644
--- a/src/xrt/state_trackers/oxr/oxr_verify.c
+++ b/src/xrt/state_trackers/oxr/oxr_verify.c
@@ -610,16 +610,6 @@ oxr_verify_XrGraphicsBindingOpenGLXlibKHR(struct oxr_logger *log, const XrGraphi
"XrGraphicsBindingOpenGLXlibKHR::glxDrawable is NULL");
}
- if (next->glxFBConfig == NULL) {
- return oxr_error(log, XR_ERROR_GRAPHICS_DEVICE_INVALID,
- "XrGraphicsBindingOpenGLXlibKHR::glxFBConfig is NULL");
- }
-
- if (next->visualid == 0) {
- return oxr_error(log, XR_ERROR_GRAPHICS_DEVICE_INVALID,
- "XrGraphicsBindingOpenGLXlibKHR::visualid is 0");
- }
-
return XR_SUCCESS;
}
--
2.53.0
+2 -2
View File
@@ -22,8 +22,8 @@
#include "util/u_logging.h"
#include "utils/overloaded.h"
#include "driver/configuration.h"
#include "driver/wivrn_session.h"
#include "wivrn_config.h"
#include "wivrn_ipc.h"
#include "wivrn_sockets.h"
@@ -33,7 +33,7 @@ std::unique_ptr<wivrn::TCP> wivrn::accept_connection(wivrn_session & cnx, std::s
{
wivrn_ipc_socket_monado->send(from_monado::headset_disconnected{});
wivrn::TCPListener listener(wivrn::default_port);
wivrn::TCPListener listener(configuration().port);
pollfd fds[2]{
{.fd = listener.get_fd(), .events = POLLIN},
+11
View File
@@ -61,6 +61,7 @@ struct pipewire_device : public audio_device
std::atomic<size_t> mic_buffer_size_bytes;
audio_data mic_current;
std::unique_ptr<pw_stream, deleter> microphone;
std::atomic<std::underlying_type_t<pw_stream_state>> mic_state{PW_STREAM_STATE_UNCONNECTED};
pw_stream_events mic_events{
.version = PW_VERSION_STREAM_EVENTS,
.state_changed = &pipewire_device::mic_state_changed,
@@ -78,6 +79,7 @@ struct pipewire_device : public audio_device
static void mic_state_changed(void * self_v, pw_stream_state old, pw_stream_state state, const char * error);
void process_mic_data(wivrn::audio_data &&) override;
void on_connect() override;
~pipewire_device()
{
@@ -342,6 +344,11 @@ void pipewire_device::mic_process(void * self_v)
void pipewire_device::mic_state_changed(void * self_v, pw_stream_state old, pw_stream_state state, const char * error)
{
auto self = (pipewire_device *)self_v;
self->mic_state = state;
if (error)
U_LOG_I("Microphone state changed from %s to %s (error: %s)", magic_enum::enum_name(old).data(), magic_enum::enum_name(state).data(), error);
else
U_LOG_I("Microphone state changed from %s to %s", magic_enum::enum_name(old).data(), magic_enum::enum_name(state).data());
switch (state)
{
case PW_STREAM_STATE_ERROR:
@@ -408,6 +415,10 @@ void pipewire_device::process_mic_data(wivrn::audio_data && sample)
if (mic_samples.write(std::move(sample)))
mic_buffer_size_bytes += size;
}
void pipewire_device::on_connect()
{
session.send_control(to_headset::feature_control{to_headset::feature_control::microphone, mic_state == PW_STREAM_STATE_STREAMING});
}
std::unique_ptr<audio_device> create_pipewire_handle(
const std::string & source_name,
+5
View File
@@ -404,6 +404,11 @@ struct pulse_device : public audio_device
mic_buffer.push(std::move(mic_data));
}
void on_connect() override
{
session.send_control(to_headset::feature_control{to_headset::feature_control::microphone, true});
}
pulse_device(
const std::string & source_name,
const std::string & source_description,
+1
View File
@@ -36,6 +36,7 @@ struct audio_device
virtual wivrn::to_headset::audio_stream_description description() const = 0;
virtual void process_mic_data(wivrn::audio_data &&) = 0;
virtual void on_connect() = 0;
static std::unique_ptr<audio_device> create(
const std::string & source_name,
+6
View File
@@ -204,6 +204,12 @@ configuration::configuration()
if (auto it = json.find("tcp-only"); it != json.end())
tcp_only = *it;
if (auto it = json.find("port"); it != json.end())
port = *it;
if (auto it = json.find("hostname"); it != json.end())
hostname = *it;
if (auto it = json.find("publish-service"); it != json.end())
{
publication = *it;
+4
View File
@@ -19,6 +19,8 @@
#pragma once
#include "hostname.h"
#include "wivrn_config.h"
#include <array>
#include <chrono>
#include <filesystem>
@@ -57,6 +59,8 @@ struct configuration
bool use_steamvr_lh = false;
bool hid_forwarding = false;
bool tcp_only = false;
int port = wivrn::default_port;
std::string hostname = wivrn::hostname();
service_publication publication = service_publication::avahi;
// monostate: default value, string: user defined, nullptr: disabled
+4
View File
@@ -175,6 +175,10 @@ public:
if (not closest->y)
return *closest;
// Avoid returning obviously wrong data
if (std::abs(closest->timestamp - timestamp) > 1'000'000'000)
return {};
// Not enough data to extrapolate
if (row < 2)
{
+12 -7
View File
@@ -107,7 +107,7 @@ std::pair<XrTime, XrTime> pose_list::get_bounds() const
void pose_list::update_tracking(const from_headset::tracking & tracking, const clock_offset & offset)
{
if (source)
if (source or not offset)
return;
for (const auto & pose: tracking.device_poses)
@@ -260,13 +260,18 @@ std::pair<XrTime, xrt_space_relation> pose_list::get_at(XrTime at_timestamp_ns)
if (orientation.y)
{
flags(XRT_SPACE_RELATION_ORIENTATION_VALID_BIT | XRT_SPACE_RELATION_ORIENTATION_TRACKED_BIT);
if (auto norm2 = orientation.y->squaredNorm(); norm2 > 0.1)
{
flags(XRT_SPACE_RELATION_ORIENTATION_VALID_BIT | XRT_SPACE_RELATION_ORIENTATION_TRACKED_BIT);
ret.pose.orientation = {
.x = (*orientation.y)[1],
.y = (*orientation.y)[2],
.z = (*orientation.y)[3],
.w = (*orientation.y)[0]};
orientation.y->normalize();
ret.pose.orientation = {
.x = (*orientation.y)[1],
.y = (*orientation.y)[2],
.z = (*orientation.y)[3],
.w = (*orientation.y)[0]};
}
if (orientation.dy)
{
+1 -1
View File
@@ -40,7 +40,7 @@ class view_list
{
pose_list head_poses{device_id::HEAD};
std::mutex mutex;
XrViewStateFlags flags;
XrViewStateFlags flags{};
std::array<xrt_pose, 2> poses;
std::array<xrt_fov, 2> fovs;
+5 -41
View File
@@ -27,7 +27,6 @@
#include "xrt/xrt_defines.h"
#include <array>
#include <charconv>
#include <cmath>
#include <map>
#include <ranges>
@@ -218,44 +217,6 @@ static void fill_param_2d(
out.resize(count * 2 - 1);
}
static float get_angle_offset()
{
if (const char * cvar = std::getenv("WIVRN_FOVEATION_OFFSET"))
{
std::string_view var(cvar);
float res;
auto e = std::from_chars(var.begin(), var.end(), res);
if (e.ec == std::errc())
{
// No clamping, we don’t know the range
// of actual values for all headsets for sure.
return -res * M_PI / 180;
}
else
U_LOG_W("Malformed WIVRN_FOVEATION_OFFSET, must be a number (angle in °)");
}
// normal sight line is between 10° and 15° below horizontal
// https://apps.dtic.mil/sti/tr/pdf/AD0758339.pdf pages 393-394
// testing shows 10° looks better
return 10 * M_PI / 180;
}
static float get_convergence_distance()
{
if (const char * cvar = std::getenv("WIVRN_FOVEATION_DISTANCE"))
{
std::string_view var(cvar);
float res;
auto e = std::from_chars(var.begin(), var.end(), res);
if (e.ec == std::errc())
return std::max(res, 0.05f);
else
U_LOG_W("Malformed WIVRN_FOVEATION_DISTANCE, must be a number (distance in meters)");
}
// 1m by default
return 1;
}
namespace wivrn
{
@@ -303,8 +264,11 @@ void wivrn_foveation::compute_params(
wivrn_foveation::wivrn_foveation(wivrn_vk_bundle & bundle, const xrt_hmd_parts & hmd) :
foveated_width(hmd.screens[0].w_pixels),
foveated_height(hmd.screens[0].h_pixels),
angle_offset(get_angle_offset()),
convergence_distance(get_convergence_distance()),
// normal sight line is between 10° and 15° below horizontal
// https://apps.dtic.mil/sti/tr/pdf/AD0758339.pdf pages 393-394
// testing shows 10° looks better
angle_offset(10 * M_PI / 180),
convergence_distance(1 /* meter*/),
command_pool(bundle.device, vk::CommandPoolCreateInfo{.queueFamilyIndex = bundle.queue_family_index}),
cmd(std::move(bundle.device.allocateCommandBuffers({
.commandPool = *command_pool,
+3
View File
@@ -18,6 +18,7 @@
*/
#include "wivrn_hmd.h"
#include "math/m_api.h"
#include "os/os_time.h"
#include "wivrn_config.h"
#include "wivrn_session.h"
@@ -188,6 +189,8 @@ xrt_result_t wivrn_hmd::get_view_poses(const xrt_vec3 * default_eye_relation,
view.relation.relation_flags = (xrt_space_relation_flags)flags;
*out_head_relation = view.relation;
assert((out_head_relation->relation_flags & XRT_SPACE_RELATION_ORIENTATION_VALID_BIT) == 0 or math_quat_ensure_normalized(&out_head_relation->pose.orientation));
assert(view_count == 2);
for (size_t eye = 0; eye < 2; ++eye)
{
+19 -38
View File
@@ -146,7 +146,10 @@ wivrn::wivrn_session::wivrn_session(std::unique_ptr<wivrn_connection> connection
get_info(),
*this);
if (audio_handle)
{
send_control(audio_handle->description());
audio_handle->on_connect();
}
}
catch (const std::exception & e)
{
@@ -225,33 +228,18 @@ wivrn::wivrn_session::wivrn_session(std::unique_ptr<wivrn_connection> connection
if (get_info().eye_gaze || is_forced_extension("EXT_eye_gaze_interaction"))
{
// The tracker space needs to be attached to the head pose once the space overseer is created
eye_tracker = std::make_unique<wivrn_eye_tracker>(*this);
static_roles.eyes = eye_tracker.get();
xdevs[xdev_count++] = eye_tracker.get();
xdevs[xdev_count++] = static_roles.eyes = &eye_tracker.emplace(*this);
}
auto face = get_info().face_tracking;
if (face == from_headset::face_type::android || is_forced_extension("ANDROID_face_tracking"))
{
android_face_tracker = std::make_unique<wivrn_android_face_tracker>(&hmd, *this);
static_roles.face = android_face_tracker.get();
xdevs[xdev_count++] = android_face_tracker.get();
}
if (face == from_headset::face_type::fb2 || is_forced_extension("FB_face_tracking2"))
{
fb_face2_tracker = std::make_unique<wivrn_fb_face2_tracker>(&hmd, *this);
static_roles.face = fb_face2_tracker.get();
xdevs[xdev_count++] = fb_face2_tracker.get();
}
if (face == wivrn::from_headset::face_type::htc || is_forced_extension("HTC_facial_tracking"))
{
htc_face_tracker = std::make_unique<wivrn_htc_face_tracker>(&hmd, *this);
static_roles.face = htc_face_tracker.get();
xdevs[xdev_count++] = htc_face_tracker.get();
}
xdevs[xdev_count++] = static_roles.face = &android_face_tracker.emplace(&hmd, *this);
else if (face == from_headset::face_type::fb2 || is_forced_extension("FB_face_tracking2"))
xdevs[xdev_count++] = static_roles.face = &fb_face2_tracker.emplace(&hmd, *this);
else if (face == wivrn::from_headset::face_type::htc || is_forced_extension("HTC_facial_tracking"))
xdevs[xdev_count++] = static_roles.face = &htc_face_tracker.emplace(&hmd, *this);
auto num_generic_trackers = get_info().num_generic_trackers;
generic_trackers.reserve(num_generic_trackers);
if (num_generic_trackers > 0)
{
if (num_generic_trackers > from_headset::body_tracking::max_tracked_poses)
@@ -271,11 +259,7 @@ wivrn::wivrn_session::wivrn_session(std::unique_ptr<wivrn_connection> connection
U_LOG_I("Creating %d generic trackers", num_generic_trackers);
for (int i = 0; i < num_generic_trackers; ++i)
{
auto dev = std::make_unique<wivrn_generic_tracker>(i, &hmd, *this);
xdevs[xdev_count++] = dev.get();
generic_trackers.push_back(std::move(dev));
}
xdevs[xdev_count++] = &generic_trackers.emplace_back(i, &hmd, *this);
}
#if WIVRN_FEATURE_SOLARXR
@@ -365,7 +349,7 @@ xrt_result_t wivrn::wivrn_session::create_session(std::unique_ptr<wivrn_connecti
u_builder_create_space_overseer_legacy(
&self->xrt_system.broadcast,
&self->hmd,
self->eye_tracker.get(),
self->static_roles.eyes,
&self->left_controller,
&self->right_controller,
nullptr,
@@ -382,13 +366,14 @@ xrt_result_t wivrn::wivrn_session::create_session(std::unique_ptr<wivrn_connecti
auto res = xrt_space_overseer_create_pose_space(self->space_overseer, &self->hmd, XRT_INPUT_GENERIC_HEAD_POSE, &head_space);
if (res == XRT_SUCCESS)
{
res = xrt_space_overseer_attach_device(self->space_overseer, self->eye_tracker.get(), head_space);
res = xrt_space_overseer_attach_device(self->space_overseer, self->static_roles.eyes, head_space);
xrt_space_reference(&head_space, NULL);
}
if (res != XRT_SUCCESS)
{
U_LOG_W("failed to initialize eye tracker: %s", xrt_result_to_string(res).c_str());
self->eye_tracker = nullptr;
self->static_roles.eyes = nullptr;
self->eye_tracker.reset();
}
}
@@ -631,10 +616,7 @@ void wivrn_session::operator()(from_headset::override_foveation_center && foveat
void wivrn_session::operator()(from_headset::derived_pose && derived)
{
left_controller.set_derived_pose(derived);
left_hand_interaction.set_derived_pose(derived);
right_controller.set_derived_pose(derived);
right_hand_interaction.set_derived_pose(derived);
}
void wivrn_session::operator()(from_headset::hand_tracking && hand_tracking)
@@ -648,12 +630,8 @@ void wivrn_session::operator()(from_headset::body_tracking && body_tracking)
{
auto offset = offset_est.get_offset();
assert(generic_trackers.size() <= from_headset::body_tracking::max_tracked_poses);
for (int i = 0; i < generic_trackers.size(); i++)
{
auto pose = body_tracking.poses ? (*body_tracking.poses)[i] : from_headset::body_tracking::pose{};
generic_trackers[i]->update_tracking(body_tracking, pose, offset);
}
for (auto [tracker, pose]: std::ranges::zip_view(generic_trackers, *body_tracking.poses))
tracker.update_tracking(body_tracking, pose, offset);
}
void wivrn_session::operator()(from_headset::inputs && inputs)
{
@@ -1128,7 +1106,10 @@ void wivrn_session::reconnect(std::stop_token stop)
comp_target->reset_encoders();
}
if (audio_handle)
{
send_control(audio_handle->description());
audio_handle->on_connect();
}
event.state.visible = true;
event.state.focused = true;
+13 -6
View File
@@ -19,13 +19,19 @@
#pragma once
#include "app_pacer.h"
#include "clock_offset.h"
#include "driver/app_pacer.h"
#include "inplace_vector.hpp"
#include "tracking_control.h"
#include "utils/thread_safe.h"
#include "wivrn_android_face_tracker.h"
#include "wivrn_connection.h"
#include "wivrn_controller.h"
#include "wivrn_eye_tracker.h"
#include "wivrn_fb_face2_tracker.h"
#include "wivrn_generic_tracker.h"
#include "wivrn_hmd.h"
#include "wivrn_htc_face_tracker.h"
#include "wivrn_ipc.h"
#include "wivrn_packets.h"
#include "wivrn_uinput.h"
@@ -35,6 +41,7 @@
#include <map>
#include <memory>
#include <mutex>
#include <optional>
#include <shared_mutex>
#include <thread>
@@ -85,11 +92,11 @@ class wivrn_session : public xrt_system_devices
int32_t left_hand_interaction_index;
wivrn_controller right_hand_interaction;
int32_t right_hand_interaction_index;
std::unique_ptr<wivrn_eye_tracker> eye_tracker;
std::unique_ptr<wivrn_android_face_tracker> android_face_tracker;
std::unique_ptr<wivrn_fb_face2_tracker> fb_face2_tracker;
std::unique_ptr<wivrn_htc_face_tracker> htc_face_tracker;
std::vector<std::unique_ptr<wivrn_generic_tracker>> generic_trackers;
std::optional<wivrn_eye_tracker> eye_tracker;
std::optional<wivrn_android_face_tracker> android_face_tracker;
std::optional<wivrn_fb_face2_tracker> fb_face2_tracker;
std::optional<wivrn_htc_face_tracker> htc_face_tracker;
beman::inplace_vector::inplace_vector<wivrn_generic_tracker, from_headset::body_tracking::max_tracked_poses> generic_trackers;
std::optional<wivrn_uinput> uinput_handler;
std::shared_mutex comp_target_mutex;
+25 -2
View File
@@ -222,6 +222,26 @@ video_encoder_nvenc::video_encoder_nvenc(
}
}
const uint32_t intra_refresh_period = 100;
const uint32_t intra_refresh_cnt = 50;
auto set_intra_refresh = [&](auto & codec_config) {
NV_ENC_CAPS_PARAM cap_param{
.version = NV_ENC_CAPS_PARAM_VER,
.capsToQuery = NV_ENC_CAPS_SUPPORT_INTRA_REFRESH,
};
int res = 0;
NVENC_CHECK(shared_state->fn.nvEncGetEncodeCaps(session_handle, encodeGUID, &cap_param, &res));
if (res != 1)
{
U_LOG_W("nvenc: intra refresh not supported, disabling feature");
return;
}
codec_config.enableIntraRefresh = 1;
codec_config.intraRefreshPeriod = intra_refresh_period;
codec_config.intraRefreshCnt = intra_refresh_cnt;
};
switch (settings.codec)
{
case video_codec::h264:
@@ -230,8 +250,9 @@ video_encoder_nvenc::video_encoder_nvenc(
config.encodeCodecConfig.h264Config.repeatSPSPPS = 1;
config.encodeCodecConfig.h264Config.maxNumRefFrames = 0;
config.encodeCodecConfig.h264Config.idrPeriod = NVENC_INFINITE_GOPLENGTH;
config.encodeCodecConfig.h264Config.h264VUIParameters.videoFullRangeFlag = 1;
config.encodeCodecConfig.h264Config.idrPeriod = NVENC_INFINITE_GOPLENGTH;
set_intra_refresh(config.encodeCodecConfig.h264Config);
break;
case video_codec::h265:
@@ -246,8 +267,9 @@ video_encoder_nvenc::video_encoder_nvenc(
config.encodeCodecConfig.hevcConfig.repeatSPSPPS = 1;
config.encodeCodecConfig.hevcConfig.maxNumRefFramesInDPB = 0;
config.encodeCodecConfig.hevcConfig.idrPeriod = NVENC_INFINITE_GOPLENGTH;
config.encodeCodecConfig.hevcConfig.hevcVUIParameters.videoFullRangeFlag = 1;
config.encodeCodecConfig.hevcConfig.idrPeriod = NVENC_INFINITE_GOPLENGTH;
set_intra_refresh(config.encodeCodecConfig.hevcConfig);
break;
case video_codec::av1:
@@ -263,6 +285,7 @@ video_encoder_nvenc::video_encoder_nvenc(
config.encodeCodecConfig.av1Config.repeatSeqHdr = 1;
config.encodeCodecConfig.av1Config.maxNumRefFramesInDPB = 0;
config.encodeCodecConfig.av1Config.idrPeriod = NVENC_INFINITE_GOPLENGTH;
set_intra_refresh(config.encodeCodecConfig.av1Config);
break;
case video_codec::raw:
+109 -73
View File
@@ -21,6 +21,7 @@
#include "encoder/encoder_settings.h"
#include "util/u_logging.h"
#include "utils/scoped_lock.h"
#include "utils/wivrn_vk_bundle.h"
#include <iostream>
#include <stdexcept>
@@ -292,10 +293,12 @@ void wivrn::video_encoder_vulkan::init(const vk::VideoCapabilitiesKHR & video_ca
output_buffer_size = align(output_buffer_size, video_caps.minBitstreamBufferSizeAlignment);
item.output_buffer = buffer_allocation(
vk.device,
{.pNext = &video_profile_list,
.size = output_buffer_size,
.usage = vk::BufferUsageFlagBits::eVideoEncodeDstKHR | vk::BufferUsageFlagBits::eTransferSrc,
.sharingMode = vk::SharingMode::eExclusive},
{
.pNext = &video_profile_list,
.size = output_buffer_size,
.usage = vk::BufferUsageFlagBits::eVideoEncodeDstKHR | vk::BufferUsageFlagBits::eTransferSrc,
.sharingMode = vk::SharingMode::eExclusive,
},
{
.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT | VMA_ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT,
.usage = VMA_MEMORY_USAGE_AUTO,
@@ -304,14 +307,17 @@ void wivrn::video_encoder_vulkan::init(const vk::VideoCapabilitiesKHR & video_ca
if (not(item.output_buffer.properties() & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT))
{
U_LOG_D("Using staging buffer for vulkan encode output");
item.host_buffer = buffer_allocation(
vk.device,
{.size = output_buffer_size,
.usage = vk::BufferUsageFlagBits::eTransferDst,
.sharingMode = vk::SharingMode::eExclusive},
{
.size = output_buffer_size,
.usage = vk::BufferUsageFlagBits::eTransferDst,
.sharingMode = vk::SharingMode::eExclusive,
},
{
.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT,
.usage = VMA_MEMORY_USAGE_AUTO,
.usage = VMA_MEMORY_USAGE_AUTO_PREFER_HOST,
},
"vulkan encode host buffer");
}
@@ -477,7 +483,6 @@ void wivrn::video_encoder_vulkan::init(const vk::VideoCapabilitiesKHR & video_ca
vk::QueryPoolVideoEncodeFeedbackCreateInfoKHR{
.pNext = &video_profile,
.encodeFeedbackFlags =
vk::VideoEncodeFeedbackFlagBitsKHR::eBitstreamBufferOffset |
vk::VideoEncodeFeedbackFlagBitsKHR::eBitstreamBytesWritten,
},
};
@@ -554,18 +559,58 @@ std::optional<wivrn::video_encoder::data> wivrn::video_encoder_vulkan::encode(ui
throw std::runtime_error("wait for fences: " + vk::to_string(res));
}
// Feedback = offset / size / has overrides
auto [res, feedback] = query_pool.getResults<uint32_t>(encode_slot, 1, 3 * sizeof(uint32_t), 0, vk::QueryResultFlagBits::eWait);
auto [res, size] = query_pool.getResult<uint32_t>(encode_slot, 1, 0, vk::QueryResultFlagBits::eWait);
if (res != vk::Result::eSuccess)
{
std::cerr << "device.getQueryPoolResults: " << vk::to_string(res) << std::endl;
}
// We don't copy the whole buffer, but an estimate of how much we'll need
// If that wasn't enough, we have to issue a second copy command for the rest
if (slot_item.host_buffer and size > slot_item.copy_size)
{
U_LOG_D("additional copy needed: %ld", size - slot_item.copy_size);
const bool main_queue = *slot_item.transfer_cmd_buf;
// The encoded image is larger than expected, we need to copy some more data
vk::raii::CommandBuffer & cmd_buf = main_queue ? slot_item.transfer_cmd_buf : slot_item.video_cmd_buf;
cmd_buf.reset();
cmd_buf.begin({.flags = vk::CommandBufferUsageFlagBits::eOneTimeSubmit});
cmd_buf.copyBuffer(
slot_item.output_buffer,
slot_item.host_buffer,
vk::BufferCopy{
.srcOffset = slot_item.copy_size,
.dstOffset = slot_item.copy_size,
.size = size - slot_item.copy_size,
});
cmd_buf.end();
vk.device.resetFences(*slot_item.fence);
{
wivrn::scoped_lock lock(main_queue ? vk.vk.main_queue->mutex : vk.vk.encode_queue->mutex);
auto & queue = main_queue ? vk.queue : vk.encode_queue;
queue.submit(vk::SubmitInfo{
.commandBufferCount = 1,
.pCommandBuffers = &*cmd_buf,
},
*slot_item.fence);
}
if (auto res = vk.device.waitForFences(*slot_item.fence, true, 1'000'000'000);
res != vk::Result::eSuccess)
{
throw std::runtime_error("wait for fences: " + vk::to_string(res));
}
}
void * mapped = slot_item.host_buffer ? slot_item.host_buffer.map() : slot_item.output_buffer.map();
return data{
.encoder = this,
.span = std::span(((uint8_t *)mapped) + feedback[0], feedback[1]),
.span = std::span(((uint8_t *)mapped), size),
.prefer_control = slot_item.idr,
};
}
@@ -815,6 +860,11 @@ std::pair<bool, vk::Semaphore> wivrn::video_encoder_vulkan::present_image(vk::Im
.flags = vk::VideoCodingControlFlagBitsKHR::eEncodeRateControl,
});
if (rate_control)
slot_item.copy_size = (rate_control_layer.maxBitrate * rate_control_layer.frameRateDenominator) / rate_control_layer.frameRateNumerator;
else
slot_item.copy_size = slot_item.output_buffer.info().size;
vk::VideoEncodeInfoKHR encode_info{
.pNext = encode_info_next(dpb.frame_num, slot_index, ref_slot ? std::make_optional(ref_slot->info.slotIndex) : std::nullopt),
.dstBuffer = slot_item.output_buffer,
@@ -840,66 +890,48 @@ std::pair<bool, vk::Semaphore> wivrn::video_encoder_vulkan::present_image(vk::Im
// When output buffer is not visible, we have to issue a transfer operation
if (slot_item.host_buffer)
{
// encode queue may not allow transfer commands
vk::BufferMemoryBarrier2 barrier{
.srcStageMask = vk::PipelineStageFlagBits2::eAllCommands,
.srcAccessMask = vk::AccessFlagBits2::eMemoryWrite,
.dstStageMask = vk::PipelineStageFlagBits2::eAllCommands,
.dstAccessMask = vk::AccessFlagBits2::eMemoryRead,
.srcQueueFamilyIndex = vk.encode_queue_family_index,
.dstQueueFamilyIndex = vk.encode_queue_family_index,
.buffer = slot_item.output_buffer,
.size = vk::WholeSize,
};
vk::raii::CommandBuffer * transfer_cmd_buf;
if (*slot_item.transfer_cmd_buf)
{
vk::BufferMemoryBarrier2 barrier{
.srcStageMask = vk::PipelineStageFlagBits2::eAllCommands,
.srcAccessMask = vk::AccessFlagBits2::eMemoryWrite,
.dstStageMask = vk::PipelineStageFlagBits2::eAllCommands,
.dstAccessMask = vk::AccessFlagBits2::eMemoryRead,
.srcQueueFamilyIndex = vk.encode_queue_family_index,
.dstQueueFamilyIndex = vk.queue_family_index,
.buffer = slot_item.output_buffer,
.size = vk::WholeSize,
};
video_cmd_buf.pipelineBarrier2({
// We need to transfer the buffer on the main queue
barrier.dstQueueFamilyIndex = vk.queue_family_index;
transfer_cmd_buf = &slot_item.transfer_cmd_buf;
transfer_cmd_buf->reset();
transfer_cmd_buf->begin({.flags = vk::CommandBufferUsageFlagBits::eOneTimeSubmit});
transfer_cmd_buf->pipelineBarrier2({
.bufferMemoryBarrierCount = 1,
.pBufferMemoryBarriers = &barrier,
});
auto & cmd_buf = slot_item.transfer_cmd_buf;
cmd_buf.reset();
cmd_buf.begin({.flags = vk::CommandBufferUsageFlagBits::eOneTimeSubmit});
cmd_buf.pipelineBarrier2({
.bufferMemoryBarrierCount = 1,
.pBufferMemoryBarriers = &barrier,
});
cmd_buf.copyBuffer(
slot_item.output_buffer,
slot_item.host_buffer,
vk::BufferCopy{
.size = slot_item.output_buffer.info().size,
});
cmd_buf.end();
}
else
{
vk::BufferMemoryBarrier2 barrier{
.srcStageMask = vk::PipelineStageFlagBits2::eAllCommands,
.srcAccessMask = vk::AccessFlagBits2::eMemoryWrite,
.dstStageMask = vk::PipelineStageFlagBits2::eAllCommands,
.dstAccessMask = vk::AccessFlagBits2::eMemoryRead,
.srcQueueFamilyIndex = vk.encode_queue_family_index,
.dstQueueFamilyIndex = vk.encode_queue_family_index,
.buffer = slot_item.output_buffer,
.size = vk::WholeSize,
};
video_cmd_buf.pipelineBarrier2({
.bufferMemoryBarrierCount = 1,
.pBufferMemoryBarriers = &barrier,
});
transfer_cmd_buf = &video_cmd_buf;
video_cmd_buf.copyBuffer(
slot_item.output_buffer,
slot_item.host_buffer,
vk::BufferCopy{
.size = slot_item.output_buffer.info().size,
});
}
video_cmd_buf.pipelineBarrier2({
.bufferMemoryBarrierCount = 1,
.pBufferMemoryBarriers = &barrier,
});
transfer_cmd_buf->copyBuffer(
slot_item.output_buffer,
slot_item.host_buffer,
vk::BufferCopy{
.size = slot_item.copy_size,
});
if (*slot_item.transfer_cmd_buf)
transfer_cmd_buf->end();
}
video_cmd_buf.end();
@@ -928,17 +960,21 @@ void wivrn::video_encoder_vulkan::post_submit(uint8_t slot)
.commandBuffer = slot_item.video_cmd_buf,
};
vk.encode_queue.submit2(vk::SubmitInfo2{
.waitSemaphoreInfoCount = 1,
.pWaitSemaphoreInfos = &wait_sem_info,
.commandBufferInfoCount = 1,
.pCommandBufferInfos = &cmd_info,
.signalSemaphoreInfoCount = need_transfer ? 1u : 0,
.pSignalSemaphoreInfos = &sem_info,
},
need_transfer ? nullptr : *slot_item.fence);
{
scoped_lock lock(vk.vk.encode_queue->mutex);
vk.encode_queue.submit2(vk::SubmitInfo2{
.waitSemaphoreInfoCount = 1,
.pWaitSemaphoreInfos = &wait_sem_info,
.commandBufferInfoCount = 1,
.pCommandBufferInfos = &cmd_info,
.signalSemaphoreInfoCount = need_transfer ? 1u : 0,
.pSignalSemaphoreInfos = &sem_info,
},
need_transfer ? nullptr : *slot_item.fence);
}
if (need_transfer)
{
// caller already holds the lock
vk::CommandBufferSubmitInfo cmd_info{
.commandBuffer = slot_item.transfer_cmd_buf,
};
+1
View File
@@ -53,6 +53,7 @@ class video_encoder_vulkan : public video_encoder
vk::raii::ImageView view = nullptr;
buffer_allocation output_buffer;
buffer_allocation host_buffer;
vk::DeviceSize copy_size;
bool idr = false;
};
std::array<slot_item, num_slots> slot_data;
+7 -3
View File
@@ -15,7 +15,6 @@
#include "driver/configuration.h"
#include "driver/wivrn_connection.h"
#include "exit_codes.h"
#include "hostname.h"
#include "ipc_server_cb.h"
#include "protocol_version.h"
#include "start_application.h"
@@ -243,6 +242,10 @@ void start_server(configuration config)
setenv("AMD_DEBUG", "lowlatencyenc", false);
// https://github.com/WiVRn/WiVRn/issues/695
// something is broken with Intel CCS under vaapi
setenv("INTEL_DEBUG", "noccs", false);
wivrn::ipc_server_cb server_cb;
ipc_server_main_info server_info{
@@ -311,7 +314,7 @@ void start_listening()
assert(listener_watch == 0);
listener = std::make_unique<TCPListener>(wivrn::default_port);
listener = std::make_unique<TCPListener>(configuration().port);
auto source_listener = g_unix_fd_source_new(listener->get_fd(), GIOCondition::G_IO_IN);
g_source_set_callback(source_listener, G_SOURCE_FUNC(&headset_connected), nullptr, nullptr);
listener_watch = g_source_attach(source_listener, nullptr);
@@ -348,7 +351,8 @@ void start_publishing()
{"version", wivrn::display_version()},
{"cookie", server_cookie()},
};
publisher.emplace(poll_api, hostname(), "_wivrn._tcp", wivrn::default_port, TXT);
auto configuration = wivrn::configuration();
publisher.emplace(poll_api, configuration.hostname, "_wivrn._tcp", configuration.port, TXT);
}
}
}