diff --git a/flake.nix b/flake.nix index 1c9219c3..5a595c74 100644 --- a/flake.nix +++ b/flake.nix @@ -58,7 +58,7 @@ # Keep in sync with CMakeLists.txt monado rev rev = builtins.readFile ./monado-rev; # Nix will output the correct hash when it doesn't match - hash = "sha256-HLPj4H7y0lphLHq5pZ608QvSRr5YDPvH2KVvhTTGC0Q="; + hash = "sha256-cVXP/iveB77Sp+TArE5ZYm3Xd/PkjN0keuNJY8GU0f0="; }; }; diff --git a/monado-rev b/monado-rev index 8b849bc0..9b23a9ec 100644 --- a/monado-rev +++ b/monado-rev @@ -1 +1 @@ -c7a5451db264fed72d9a781067cffaf9e8e77e35 +1cafc3a42dafa126227b7782a04fdcb62f1e403e diff --git a/patches/monado/0001-c-multi-early-wake-of-compositor.patch b/patches/monado/0001-c-multi-early-wake-of-compositor.patch index e4c76e28..fe99d5f3 100644 --- a/patches/monado/0001-c-multi-early-wake-of-compositor.patch +++ b/patches/monado/0001-c-multi-early-wake-of-compositor.patch @@ -1,4 +1,4 @@ -From d91cd28e85d3b0e774c467de686eb0cfeeedb41c Mon Sep 17 00:00:00 2001 +From 104babdb5929b053824a0ac4436a4a1a25d99259 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Tue, 22 Oct 2024 15:23:19 +0200 Subject: [PATCH 1/8] c/multi: early wake of compositor diff --git a/patches/monado/0002-ipc-server-Always-listen-to-stdin.patch b/patches/monado/0002-ipc-server-Always-listen-to-stdin.patch index 66282224..de761cee 100644 --- a/patches/monado/0002-ipc-server-Always-listen-to-stdin.patch +++ b/patches/monado/0002-ipc-server-Always-listen-to-stdin.patch @@ -1,4 +1,4 @@ -From ff256f4d1758a442fe388dc20248d85f89dd7601 Mon Sep 17 00:00:00 2001 +From 67ce4429a092565582c0932413b1a132e6a66ea4 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Tue, 2 Apr 2024 17:14:42 +0200 Subject: [PATCH 2/8] ipc/server: Always listen to stdin diff --git a/patches/monado/0003-Use-extern-socket-fd.patch b/patches/monado/0003-Use-extern-socket-fd.patch index cd1d02d1..3fbbd656 100644 --- a/patches/monado/0003-Use-extern-socket-fd.patch +++ b/patches/monado/0003-Use-extern-socket-fd.patch @@ -1,4 +1,4 @@ -From 7b053e42fa6e7ae65d6fc8109b068ccbe1ec7de3 Mon Sep 17 00:00:00 2001 +From 9a4aee03233c05306e252c6cf33543d3a64fff6d Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Tue, 8 Oct 2024 22:13:15 +0200 Subject: [PATCH 3/8] Use extern socket fd diff --git a/patches/monado/0004-change-environment-blend-mode-selection-logic.patch b/patches/monado/0004-change-environment-blend-mode-selection-logic.patch index d996f10e..e3f1227e 100644 --- a/patches/monado/0004-change-environment-blend-mode-selection-logic.patch +++ b/patches/monado/0004-change-environment-blend-mode-selection-logic.patch @@ -1,4 +1,4 @@ -From 5a9d5a831c7f8fb2b195221357c081e8fbbe4f9a Mon Sep 17 00:00:00 2001 +From 4435e995c0ced6d670167256cad69b0de1f72e16 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 4/8] change environment blend mode selection logic diff --git a/patches/monado/0005-st-oxr-forward-0-refresh-rate.patch b/patches/monado/0005-st-oxr-forward-0-refresh-rate.patch index 49bfe39f..2ffae083 100644 --- a/patches/monado/0005-st-oxr-forward-0-refresh-rate.patch +++ b/patches/monado/0005-st-oxr-forward-0-refresh-rate.patch @@ -1,4 +1,4 @@ -From 7793b48c6aa745309d9f0de02966a9f560787fdc Mon Sep 17 00:00:00 2001 +From cb1191f81a027972d050f9f30a0e418a31b35f5a Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Sat, 15 Mar 2025 22:19:48 +0100 Subject: [PATCH 5/8] st/oxr: forward 0 refresh rate diff --git a/patches/monado/0006-Replace-distortion-with-foveation.patch b/patches/monado/0006-Replace-distortion-with-foveation.patch index 454cfb65..a4c9c873 100644 --- a/patches/monado/0006-Replace-distortion-with-foveation.patch +++ b/patches/monado/0006-Replace-distortion-with-foveation.patch @@ -1,11 +1,11 @@ -From 95028abb771e09f7325b27a217e3bb66cf8f88e5 Mon Sep 17 00:00:00 2001 +From e22cf0edf3abedc59e98416ac4d62e9253d6ddd8 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Wed, 11 Sep 2024 22:56:29 +0200 Subject: [PATCH 6/8] Replace distortion with foveation --- src/xrt/compositor/CMakeLists.txt | 4 +- - src/xrt/compositor/main/comp_renderer.c | 17 +- + src/xrt/compositor/main/comp_renderer.c | 6 +- src/xrt/compositor/main/comp_target.h | 3 +- src/xrt/compositor/render/render_compute.c | 267 +++++------------- src/xrt/compositor/render/render_interface.h | 48 ++-- @@ -16,7 +16,7 @@ Subject: [PATCH 6/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 | 44 ++- - 12 files changed, 247 insertions(+), 441 deletions(-) + 12 files changed, 245 insertions(+), 432 deletions(-) diff --git a/src/xrt/compositor/CMakeLists.txt b/src/xrt/compositor/CMakeLists.txt index 1ba5ec438..eb068f5fc 100644 @@ -41,25 +41,10 @@ index 1ba5ec438..eb068f5fc 100644 render/render_interface.h render/render_resources.c diff --git a/src/xrt/compositor/main/comp_renderer.c b/src/xrt/compositor/main/comp_renderer.c -index e05e2d263..755e39d8c 100644 +index c5ec9e7de..fecc368a8 100644 --- a/src/xrt/compositor/main/comp_renderer.c +++ b/src/xrt/compositor/main/comp_renderer.c -@@ -275,14 +275,6 @@ calc_pose_data(struct comp_renderer *r, - return false; - } - -- // Check if pose is valid (has valid position and orientation) -- bool pose_valid = (head_relation.relation_flags & XRT_SPACE_RELATION_POSITION_VALID_BIT) && -- (head_relation.relation_flags & XRT_SPACE_RELATION_ORIENTATION_VALID_BIT); -- -- if (!pose_valid) { -- return false; -- } -- - struct xrt_fov dist_fov[XRT_MAX_VIEWS] = XRT_STRUCT_INIT; - for (uint32_t i = 0; i < view_count; i++) { - dist_fov[i] = r->c->xdev->hmd->distortion.fov[i]; -@@ -952,7 +944,8 @@ dispatch_compute(struct comp_renderer *r, +@@ -936,7 +936,8 @@ dispatch_compute(struct comp_renderer *r, // Target Vulkan resources.. VkImage target_image = r->c->target->images[r->acquired_buffer].handle; @@ -69,26 +54,16 @@ index e05e2d263..755e39d8c 100644 // Target view information. struct render_viewport_data target_viewport_datas[XRT_MAX_VIEWS]; -@@ -960,7 +953,8 @@ dispatch_compute(struct comp_renderer *r, - - // Show clear shader when pose is invalid, otherwise normal rendering - if (!pose_valid) { -- render_compute_clear(render, target_image, target_storage_view, target_viewport_datas); -+ render_compute_clear(render, target_image, target_storage_view_y, target_storage_view_cbcr, -+ target_viewport_datas); - } else { - chl_frame_state_cs_default_pipeline( // - frame_state, // -@@ -971,7 +965,8 @@ dispatch_compute(struct comp_renderer *r, - eye_poses, // - fovs, // - target_image, // -- target_storage_view, // -+ target_storage_view_y, // -+ target_storage_view_cbcr, // - target_viewport_datas); // - } +@@ -952,7 +953,8 @@ dispatch_compute(struct comp_renderer *r, + eye_poses, // + fovs, // + target_image, // +- target_storage_view, // ++ target_storage_view_y, // ++ target_storage_view_cbcr, // + target_viewport_datas); // + // Everything is ready, submit to the queue. diff --git a/src/xrt/compositor/main/comp_target.h b/src/xrt/compositor/main/comp_target.h index 2122f46e7..53dcd631b 100644 --- a/src/xrt/compositor/main/comp_target.h diff --git a/patches/monado/0007-Limit-foveation-samples-per-pixel.patch b/patches/monado/0007-Limit-foveation-samples-per-pixel.patch index dadb8255..61413a14 100644 --- a/patches/monado/0007-Limit-foveation-samples-per-pixel.patch +++ b/patches/monado/0007-Limit-foveation-samples-per-pixel.patch @@ -1,4 +1,4 @@ -From a480e5963d05a159902efb5309af468d90e50bc5 Mon Sep 17 00:00:00 2001 +From 6d3a2857d6495e89b4e85adc752f31c4d1ef9665 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Sun, 31 Aug 2025 17:05:49 +0200 Subject: [PATCH 7/8] Limit foveation samples per pixel diff --git a/patches/monado/0008-ipc-Add-callbacks-and-unify-main-functions.patch b/patches/monado/0008-ipc-Add-callbacks-and-unify-main-functions.patch index c6e5e161..854ac1fe 100644 --- a/patches/monado/0008-ipc-Add-callbacks-and-unify-main-functions.patch +++ b/patches/monado/0008-ipc-Add-callbacks-and-unify-main-functions.patch @@ -1,4 +1,4 @@ -From bfda435bdd7e1916bbeda31594b1e6fdca0caf5a Mon Sep 17 00:00:00 2001 +From e6a73b6e07465ea7efc9d7c39ed7e817a4de4242 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 15 Nov 2024 22:51:32 +0000 Subject: [PATCH 8/8] ipc: Add callbacks and unify main functions diff --git a/patches/monado/0009-d-steamvr_lh-prevent-crash-on-vive-pro2-WiVRn.patch b/patches/monado/0009-d-steamvr_lh-prevent-crash-on-vive-pro2-WiVRn.patch new file mode 100644 index 00000000..bd432f0a --- /dev/null +++ b/patches/monado/0009-d-steamvr_lh-prevent-crash-on-vive-pro2-WiVRn.patch @@ -0,0 +1,25 @@ +From 9c8627778ec263f6443fe726de88ca84bace3b00 Mon Sep 17 00:00:00 2001 +From: no name +Date: Sun, 28 Sep 2025 11:33:10 +0200 +Subject: [PATCH 9/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 8a4c55ed4..723cbb196 100644 +--- a/src/xrt/drivers/steamvr_lh/steamvr_lh.cpp ++++ b/src/xrt/drivers/steamvr_lh/steamvr_lh.cpp +@@ -862,7 +862,7 @@ steamvr_lh_create_devices(struct xrt_prober *xp, struct xrt_system_devices **out + + // Include the HMD + if (svrs->ctx->hmd) { +- if (svrs->ctx->hmd->variant == VIVE_VARIANT_PRO2 && !svrs->ctx->hmd->init_vive_pro_2(xp)) { ++ if (xp && svrs->ctx->hmd->variant == VIVE_VARIANT_PRO2 && !svrs->ctx->hmd->init_vive_pro_2(xp)) { + U_LOG_IFL_W(level, "Found Vive Pro 2, but failed to initialize."); + } + +-- +2.51.0 + diff --git a/server/driver/wivrn_session.cpp b/server/driver/wivrn_session.cpp index c13559c0..f82cf424 100644 --- a/server/driver/wivrn_session.cpp +++ b/server/driver/wivrn_session.cpp @@ -198,7 +198,7 @@ wivrn::wivrn_session::wivrn_session(std::unique_ptr connection auto use_steamvr_lh = configuration().use_steamvr_lh || std::getenv("WIVRN_USE_STEAMVR_LH"); xrt_system_devices * lhdevs = NULL; - if (use_steamvr_lh && steamvr_lh_create_devices(&lhdevs) == XRT_SUCCESS) + if (use_steamvr_lh && steamvr_lh_create_devices(nullptr, &lhdevs) == XRT_SUCCESS) { for (int i = 0; i < lhdevs->xdev_count; i++) {