Revert to explicit hmd_traits initialization

This commit is contained in:
Patrick Nicolas
2026-05-10 19:11:17 +02:00
committed by xytovl
parent 50a0f1a0ed
commit 1b9b74cce1
11 changed files with 45 additions and 26 deletions
+1 -1
View File
@@ -306,7 +306,7 @@ input_profile::input_profile(scene & scene, const std::filesystem::path & json_p
else
continue;
auto && [ray_entity, ray_node] = scene.add_gltf(hmd_traits.controller_ray_model, layer_mask_ray);
auto && [ray_entity, ray_node] = scene.add_gltf(hmd_traits().controller_ray_model, layer_mask_ray);
ray_node.name = (std::string)layout.key + "_ray";
spdlog::debug("Created entity {}", ray_node.name);
+2 -2
View File
@@ -1114,7 +1114,7 @@ void scenes::lobby::on_focused()
auto views = system.view_configuration_views(viewconfig);
assert(views.size() == 2); // FIXME
stream_view = hmd_traits.override_view(views[0]);
stream_view = hmd_traits().override_view(views[0]);
width = views[0].recommendedImageRectWidth;
height = views[0].recommendedImageRectHeight;
@@ -1135,7 +1135,7 @@ void scenes::lobby::on_focused()
config.save();
}
const auto & profile = hmd_traits.controller_profile;
const auto & profile = hmd_traits().controller_profile;
input.emplace(
*this,
"assets://controllers/" + profile + "/profile.json",
+4 -4
View File
@@ -217,7 +217,7 @@ std::shared_ptr<scenes::stream> scenes::stream::create(std::unique_ptr<wivrn_ses
{
auto view = self->system.view_configuration_views(self->viewconfig)[0];
view = hmd_traits.override_view(view);
view = hmd_traits().override_view(view);
info.render_eye_width = view.recommendedImageRectWidth * config.resolution_scale;
info.render_eye_height = view.recommendedImageRectHeight * config.resolution_scale;
@@ -421,7 +421,7 @@ void scenes::stream::on_focused()
{
gui_status_last_change = instance.now();
const auto & profile = hmd_traits.controller_profile;
const auto & profile = hmd_traits().controller_profile;
input.emplace(
*this,
"assets://controllers/" + profile + "/profile.json",
@@ -684,7 +684,7 @@ void scenes::stream::update_gui_position(xr::spaces controller)
{
std::optional<std::pair<glm::vec3, glm::quat>> aim;
if (hmd_traits.view_locate)
if (hmd_traits().view_locate)
{
aim = application::locate_controller(
application::space(controller),
@@ -934,7 +934,7 @@ void scenes::stream::render(const XrFrameState & frame_state)
}
// Allow the headset to time warp if we are redisplaying a frame
if ((not hmd_traits.discard_frame) or
if ((not hmd_traits().discard_frame) or
std::ranges::any_of(current_blit_handles, [](const auto & h) { return h and h->feedback.times_displayed < 2; }) or
is_gui_interactable())
{
+1 -1
View File
@@ -127,7 +127,7 @@ stream_defoveator::pipeline_t & stream_defoveator::ensure_pipeline(size_t view,
// Fragment shader
auto specialization = make_specialization_constants(
int32_t(alpha),
VkBool32(hmd_traits.needs_srgb_conversion));
VkBool32(hmd_traits().needs_srgb_conversion));
auto fragment_shader = load_shader(device, "reprojection.frag");
vk::pipeline_builder pipeline_info{
+2 -2
View File
@@ -493,7 +493,7 @@ void scenes::stream::tracking()
break;
case wivrn::device_id::EYE_GAZE:
// Eye gaze uses view pose as the origin
if (hmd_traits.view_locate)
if (hmd_traits().view_locate)
tracking.device_poses.push_back(locate_space(item.device, spaces[item.device], spaces[wivrn::device_id::HEAD], tracking.timestamp));
else
{
@@ -754,7 +754,7 @@ void scenes::stream::send_derived_pose()
{
// This may happen if the runtime does not support palm ext
// check if we have a device specific offset
if (not hmd_traits.hand_interaction_grip_surface)
if (not hmd_traits().hand_interaction_grip_surface)
{
switch (target)
{