From c0218d904015166cf45c03350ef2816c75305584 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Thu, 25 Jul 2024 14:34:02 +0200 Subject: [PATCH] Set distortion model when scale is known --- server/driver/wivrn_hmd.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/driver/wivrn_hmd.cpp b/server/driver/wivrn_hmd.cpp index da0a5244..7068e2b7 100644 --- a/server/driver/wivrn_hmd.cpp +++ b/server/driver/wivrn_hmd.cpp @@ -220,8 +220,8 @@ wivrn_hmd::wivrn_hmd(std::shared_ptr cnx, hmd->view_count = 2; hmd->blend_modes[0] = XRT_BLEND_MODE_OPAQUE; hmd->blend_mode_count = 1; - hmd->distortion.models = XRT_DISTORTION_MODEL_COMPUTE; - hmd->distortion.preferred = XRT_DISTORTION_MODEL_COMPUTE; + hmd->distortion.models = XRT_DISTORTION_MODEL_NONE; + hmd->distortion.preferred = XRT_DISTORTION_MODEL_NONE; hmd->screens[0].w_pixels = eye_width * 2; hmd->screens[0].h_pixels = eye_height; hmd->screens[0].nominal_frame_interval_ns = 1000000000 / info.preferred_refresh_rate; @@ -239,6 +239,7 @@ wivrn_hmd::wivrn_hmd(std::shared_ptr cnx, // FOV from headset info packet hmd->distortion.fov[0] = xrt_cast(info.fov[0]); hmd->distortion.fov[1] = xrt_cast(info.fov[1]); + u_distortion_mesh_fill_in_compute(this); } void wivrn_hmd::update_inputs() @@ -354,6 +355,8 @@ decltype(wivrn_hmd::foveation_parameters) wivrn_hmd::set_foveated_size(uint32_t // Distortion information compute_distortion = wivrn_hmd_compute_distortion; + hmd->distortion.models = XRT_DISTORTION_MODEL_COMPUTE; + hmd->distortion.preferred = XRT_DISTORTION_MODEL_COMPUTE; u_distortion_mesh_fill_in_compute(this); return foveation_parameters; }