From 9df870a7fac296772f641e5e8b698a4ef335eb44 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Thu, 26 Feb 2026 18:19:45 +0100 Subject: [PATCH] Project layers on the first projection one --- ...001-c-multi-early-wake-of-compositor.patch | 2 +- .../monado/0002-Use-extern-socket-fd.patch | 2 +- ...vironment-blend-mode-selection-logic.patch | 2 +- .../0004-st-oxr-forward-0-refresh-rate.patch | 2 +- ...05-Replace-distortion-with-foveation.patch | 2 +- ..._lh-prevent-crash-on-vive-pro2-WiVRn.patch | 2 +- ...entDataInteractionProfileChanged-whe.patch | 6 +- ...08-Don-t-get-pose-data-for-fast-path.patch | 40 --------- ...08-Don-t-get-pose-data-in-compositor.patch | 83 +++++++++++++++++++ .../monado/0009-don-t-verify-GL-stuff.patch | 2 +- 10 files changed, 93 insertions(+), 50 deletions(-) delete mode 100644 patches/monado/0008-Don-t-get-pose-data-for-fast-path.patch create mode 100644 patches/monado/0008-Don-t-get-pose-data-in-compositor.patch 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 d34362f4..487f061f 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 31c816e45b57fe9c19b35ce6c40624608391f5bd Mon Sep 17 00:00:00 2001 +From 563f347bf4d59b4a82144e25c3be894a0cd17c8d Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Tue, 22 Oct 2024 15:23:19 +0200 Subject: [PATCH 1/9] c/multi: early wake of compositor diff --git a/patches/monado/0002-Use-extern-socket-fd.patch b/patches/monado/0002-Use-extern-socket-fd.patch index 6202a610..077363b3 100644 --- a/patches/monado/0002-Use-extern-socket-fd.patch +++ b/patches/monado/0002-Use-extern-socket-fd.patch @@ -1,4 +1,4 @@ -From 282ac382841ec5208b6a8a98b63b50d007eeb5de Mon Sep 17 00:00:00 2001 +From 7d7c139b9ed03ec492256760c6acd1c7364c2e2a Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Tue, 8 Oct 2024 22:13:15 +0200 Subject: [PATCH 2/9] Use extern socket fd diff --git a/patches/monado/0003-change-environment-blend-mode-selection-logic.patch b/patches/monado/0003-change-environment-blend-mode-selection-logic.patch index d48f1f69..3e0450f2 100644 --- a/patches/monado/0003-change-environment-blend-mode-selection-logic.patch +++ b/patches/monado/0003-change-environment-blend-mode-selection-logic.patch @@ -1,4 +1,4 @@ -From b798f1574943241b1ac47feba4f66524a282fc23 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/9] change environment blend mode selection logic diff --git a/patches/monado/0004-st-oxr-forward-0-refresh-rate.patch b/patches/monado/0004-st-oxr-forward-0-refresh-rate.patch index 6a17dabc..dd3a2967 100644 --- a/patches/monado/0004-st-oxr-forward-0-refresh-rate.patch +++ b/patches/monado/0004-st-oxr-forward-0-refresh-rate.patch @@ -1,4 +1,4 @@ -From 085aa329b48a9f43d23c321b6d8badd4f5cc0346 Mon Sep 17 00:00:00 2001 +From 18f87ff2f292e2f4cab8718601e6d5ba236a5013 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Sat, 15 Mar 2025 22:19:48 +0100 Subject: [PATCH 4/9] st/oxr: forward 0 refresh rate diff --git a/patches/monado/0005-Replace-distortion-with-foveation.patch b/patches/monado/0005-Replace-distortion-with-foveation.patch index 6f3a90f6..f35b0569 100644 --- a/patches/monado/0005-Replace-distortion-with-foveation.patch +++ b/patches/monado/0005-Replace-distortion-with-foveation.patch @@ -1,4 +1,4 @@ -From 74d980d760e437dccb2c99591d9224e70d8b0065 Mon Sep 17 00:00:00 2001 +From 8c322edfafa6179875bfe1dca1517c4043f0c5b4 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Wed, 11 Sep 2024 22:56:29 +0200 Subject: [PATCH 5/9] Replace distortion with foveation diff --git a/patches/monado/0006-d-steamvr_lh-prevent-crash-on-vive-pro2-WiVRn.patch b/patches/monado/0006-d-steamvr_lh-prevent-crash-on-vive-pro2-WiVRn.patch index af55cdca..076c45a3 100644 --- a/patches/monado/0006-d-steamvr_lh-prevent-crash-on-vive-pro2-WiVRn.patch +++ b/patches/monado/0006-d-steamvr_lh-prevent-crash-on-vive-pro2-WiVRn.patch @@ -1,4 +1,4 @@ -From e4e8c532a6f5e46e91b67641feeb09d3f4b52bc7 Mon Sep 17 00:00:00 2001 +From b9acd6d83db324c6f31572615fb6738a6f93d63c Mon Sep 17 00:00:00 2001 From: no name Date: Sun, 28 Sep 2025 11:33:10 +0200 Subject: [PATCH 6/9] d/steamvr_lh: prevent crash on vive pro2/WiVRn diff --git a/patches/monado/0007-st-oxr-push-XrEventDataInteractionProfileChanged-whe.patch b/patches/monado/0007-st-oxr-push-XrEventDataInteractionProfileChanged-whe.patch index b0483d1f..6447c583 100644 --- a/patches/monado/0007-st-oxr-push-XrEventDataInteractionProfileChanged-whe.patch +++ b/patches/monado/0007-st-oxr-push-XrEventDataInteractionProfileChanged-whe.patch @@ -1,4 +1,4 @@ -From 78aa739c623f7c797f92f2905b59bc73446f3e32 Mon Sep 17 00:00:00 2001 +From 8c6580e84690ffe8f082cdff5ead8443d1f6bf23 Mon Sep 17 00:00:00 2001 From: Sapphire Date: Fri, 7 Nov 2025 20:41:16 -0600 Subject: [PATCH 7/9] st/oxr: push XrEventDataInteractionProfileChanged when @@ -9,10 +9,10 @@ Subject: [PATCH 7/9] st/oxr: push XrEventDataInteractionProfileChanged when 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/xrt/state_trackers/oxr/actions/oxr_input.c b/src/xrt/state_trackers/oxr/actions/oxr_input.c -index 95eef613a..c76dfcb0c 100644 +index 349c9adcb..667163142 100644 --- a/src/xrt/state_trackers/oxr/actions/oxr_input.c +++ b/src/xrt/state_trackers/oxr/actions/oxr_input.c -@@ -1885,26 +1885,21 @@ oxr_session_update_action_bindings(struct oxr_logger *log, struct oxr_session *s +@@ -1945,26 +1945,21 @@ oxr_session_update_action_bindings(struct oxr_logger *log, struct oxr_session *s } } diff --git a/patches/monado/0008-Don-t-get-pose-data-for-fast-path.patch b/patches/monado/0008-Don-t-get-pose-data-for-fast-path.patch deleted file mode 100644 index 3d95068c..00000000 --- a/patches/monado/0008-Don-t-get-pose-data-for-fast-path.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 8f62c1a61729d0550280d0e4e02ffa7cc3f7fdae Mon Sep 17 00:00:00 2001 -From: no name -Date: Thu, 15 Jan 2026 12:13:06 +0100 -Subject: [PATCH 8/9] 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 - diff --git a/patches/monado/0008-Don-t-get-pose-data-in-compositor.patch b/patches/monado/0008-Don-t-get-pose-data-in-compositor.patch new file mode 100644 index 00000000..bdf83dc8 --- /dev/null +++ b/patches/monado/0008-Don-t-get-pose-data-in-compositor.patch @@ -0,0 +1,83 @@ +From 3ec6ede2610ebbaa4ac6e9a76b387a2867db13a2 Mon Sep 17 00:00:00 2001 +From: no name +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 + diff --git a/patches/monado/0009-don-t-verify-GL-stuff.patch b/patches/monado/0009-don-t-verify-GL-stuff.patch index faac8be9..d9e62ff7 100644 --- a/patches/monado/0009-don-t-verify-GL-stuff.patch +++ b/patches/monado/0009-don-t-verify-GL-stuff.patch @@ -1,4 +1,4 @@ -From 45dec6300290d4b7199f15948206fc6492fe41ed Mon Sep 17 00:00:00 2001 +From 14e5d4a2f29b95f0f7933dbf2dde5000c0a98866 Mon Sep 17 00:00:00 2001 From: no name Date: Sun, 25 Jan 2026 10:09:10 +0100 Subject: [PATCH 9/9] don't verify GL stuff