From 81abdfee3e49b51b6dfe8648a98bbe32c2d456b0 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Tue, 5 Aug 2025 13:31:45 +0200 Subject: [PATCH] Update Monado --- flake.nix | 2 +- monado-rev | 2 +- ...001-c-multi-early-wake-of-compositor.patch | 2 +- ...02-ipc-server-Always-listen-to-stdin.patch | 2 +- .../monado/0003-Use-extern-socket-fd.patch | 2 +- ...Add-storage-usage-to-distortion-mesh.patch | 2 +- ...vironment-blend-mode-selection-logic.patch | 2 +- .../0006-Convert-to-YCbCr-in-Monado.patch | 79 ++++++++++++++++--- .../0007-store-alpha-channel-in-layer-1.patch | 2 +- ...t-oxr-bind-to-dynamic-role-s-profile.patch | 2 +- ...main-allow-custom-pacing-app-factory.patch | 2 +- .../0010-st-oxr-forward-0-refresh-rate.patch | 2 +- ...tortion-with-pixel-aligned-foveation.patch | 4 +- 13 files changed, 82 insertions(+), 23 deletions(-) diff --git a/flake.nix b/flake.nix index e490c997..302d44fa 100644 --- a/flake.nix +++ b/flake.nix @@ -40,7 +40,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-9t+v3+i5lD7eBapDQ1VE5q/3DG+UPpmibNvXzfTu8do="; + hash = "sha256-o3gh/8kDoRMfcC54TcaRWyvf1smyx8xVvn7ZssiqjF0="; }; }; diff --git a/monado-rev b/monado-rev index 0adfe2a2..1601391d 100644 --- a/monado-rev +++ b/monado-rev @@ -1 +1 @@ -ea9fff0517614ecbd21f2c918c0496cc025d218c +37fcdbb4d78549c27416922f131a8d6d6905465c 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 1e4a784f..7644e618 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 98c30d9d240c7763b829bace57203e1cd4ab869d Mon Sep 17 00:00:00 2001 +From e9c8b10fe0f9d52c171a49474d5cd5b96d5456db Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Tue, 22 Oct 2024 15:23:19 +0200 Subject: [PATCH 01/11] 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 0a18b010..2948ee8b 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 006c23e5c59dba924d716f482ea13964ba5ea906 Mon Sep 17 00:00:00 2001 +From 8f16a8ee15d2d553fb95ca7a317f1177fa8a42ae Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Tue, 2 Apr 2024 17:14:42 +0200 Subject: [PATCH 02/11] 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 34a4dae7..6ccc317e 100644 --- a/patches/monado/0003-Use-extern-socket-fd.patch +++ b/patches/monado/0003-Use-extern-socket-fd.patch @@ -1,4 +1,4 @@ -From 35d4d3a774ca65f883aad708de1591e5e142ab43 Mon Sep 17 00:00:00 2001 +From 14ae1c3a6bb93a07918659177db1b22f33e5181a Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Tue, 8 Oct 2024 22:13:15 +0200 Subject: [PATCH 03/11] Use extern socket fd diff --git a/patches/monado/0004-c-render-Add-storage-usage-to-distortion-mesh.patch b/patches/monado/0004-c-render-Add-storage-usage-to-distortion-mesh.patch index d6e81359..00539e7a 100644 --- a/patches/monado/0004-c-render-Add-storage-usage-to-distortion-mesh.patch +++ b/patches/monado/0004-c-render-Add-storage-usage-to-distortion-mesh.patch @@ -1,4 +1,4 @@ -From 3a9aec50d2487b873562304406e520107a546189 Mon Sep 17 00:00:00 2001 +From fbef8daefb312712f4f54254c80e84240b7b515f Mon Sep 17 00:00:00 2001 From: galister <3123227-galister@users.noreply.gitlab.com> Date: Mon, 19 Aug 2024 18:51:45 +0900 Subject: [PATCH 04/11] c/render: Add storage usage to distortion mesh diff --git a/patches/monado/0005-change-environment-blend-mode-selection-logic.patch b/patches/monado/0005-change-environment-blend-mode-selection-logic.patch index 657359c1..4bf5e220 100644 --- a/patches/monado/0005-change-environment-blend-mode-selection-logic.patch +++ b/patches/monado/0005-change-environment-blend-mode-selection-logic.patch @@ -1,4 +1,4 @@ -From 847328febed05f01d6cd55fea1cb6fd9e89ead6c Mon Sep 17 00:00:00 2001 +From 284c14f5b62f43404dd1f6c233693bed51ddae90 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 05/11] change environment blend mode selection logic diff --git a/patches/monado/0006-Convert-to-YCbCr-in-Monado.patch b/patches/monado/0006-Convert-to-YCbCr-in-Monado.patch index f2918f30..3c4b770b 100644 --- a/patches/monado/0006-Convert-to-YCbCr-in-Monado.patch +++ b/patches/monado/0006-Convert-to-YCbCr-in-Monado.patch @@ -1,18 +1,20 @@ -From 5fcfe965429f8c49b2b77f365de44935d4573a0c Mon Sep 17 00:00:00 2001 +From 851f5276b1cf1be5fccd3147e6b45e91de5ad053 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Wed, 11 Sep 2024 22:56:29 +0200 Subject: [PATCH 06/11] Convert to YCbCr in Monado --- - src/xrt/compositor/main/comp_renderer.c | 6 +- - src/xrt/compositor/main/comp_target.h | 3 +- - src/xrt/compositor/render/render_compute.c | 104 +++++++++++++------ - src/xrt/compositor/render/render_interface.h | 15 ++- - src/xrt/compositor/render/render_resources.c | 35 +++++-- - src/xrt/compositor/shaders/distortion.comp | 62 +++++++---- - src/xrt/compositor/util/comp_render.h | 11 +- - src/xrt/compositor/util/comp_render_cs.c | 19 ++-- - 8 files changed, 174 insertions(+), 81 deletions(-) + src/xrt/compositor/main/comp_renderer.c | 6 +- + src/xrt/compositor/main/comp_target.h | 3 +- + src/xrt/compositor/render/render_compute.c | 104 ++++++++++++------ + src/xrt/compositor/render/render_interface.h | 15 ++- + src/xrt/compositor/render/render_resources.c | 35 ++++-- + src/xrt/compositor/shaders/distortion.comp | 62 +++++++---- + .../compositor/util/comp_high_level_render.c | 6 +- + .../compositor/util/comp_high_level_render.h | 9 +- + src/xrt/compositor/util/comp_render.h | 11 +- + src/xrt/compositor/util/comp_render_cs.c | 19 +++- + 10 files changed, 184 insertions(+), 86 deletions(-) diff --git a/src/xrt/compositor/main/comp_renderer.c b/src/xrt/compositor/main/comp_renderer.c index f5227e02b..782ef0283 100644 @@ -583,6 +585,63 @@ index 08b44d4cf..e1dd1cb58 100644 + vec2 cbcr = mix(mix(cbcrs[0], cbcrs[1], 0.5), mix(cbcrs[2], cbcrs[3], 0.5), 0.5); + imageStore(chroma, ivec2(offset.xy/2 + gl_GlobalInvocationID.xy), vec4(cbcr.x, cbcr.y, 0, 0)); } +diff --git a/src/xrt/compositor/util/comp_high_level_render.c b/src/xrt/compositor/util/comp_high_level_render.c +index f1c9aa145..2e5e048a5 100644 +--- a/src/xrt/compositor/util/comp_high_level_render.c ++++ b/src/xrt/compositor/util/comp_high_level_render.c +@@ -192,14 +192,16 @@ chl_frame_state_cs_set_views(struct chl_frame_state *frame_state, + void + chl_frame_state_cs_set_target(struct chl_frame_state *frame_state, + VkImage target_image, +- VkImageView target_storage_view, ++ VkImageView target_storage_view_y, ++ VkImageView target_storage_view_cbcr, + const struct render_viewport_data views[XRT_MAX_VIEWS]) + { + // Add the target info. + comp_render_cs_add_target( // + &frame_state->data, // data + target_image, // target_image +- target_storage_view); // target_unorm_view ++ target_storage_view_y, ++ target_storage_view_cbcr); // target_unorm_view + + for (uint32_t i = 0; i < frame_state->view_count; i++) { + // Which image of the scratch images for this view are we using. +diff --git a/src/xrt/compositor/util/comp_high_level_render.h b/src/xrt/compositor/util/comp_high_level_render.h +index 46edfd669..ba5f3f45f 100644 +--- a/src/xrt/compositor/util/comp_high_level_render.h ++++ b/src/xrt/compositor/util/comp_high_level_render.h +@@ -187,7 +187,8 @@ chl_frame_state_cs_set_views(struct chl_frame_state *frame_state, + void + chl_frame_state_cs_set_target(struct chl_frame_state *frame_state, + VkImage target_image, +- VkImageView target_storage_view, ++ VkImageView target_storage_view_y, ++ VkImageView target_storage_view_cbcr, + const struct render_viewport_data views[XRT_MAX_VIEWS]); + + /*! +@@ -204,7 +205,8 @@ chl_frame_state_cs_default_pipeline(struct chl_frame_state *frame_state, + const struct xrt_pose eye_poses[XRT_MAX_VIEWS], + const struct xrt_fov fovs[XRT_MAX_VIEWS], + VkImage target_image, +- VkImageView target_storage_view, ++ VkImageView target_storage_view_y, ++ VkImageView target_storage_view_cbcr, + const struct render_viewport_data target_viewport_datas[XRT_MAX_VIEWS]) + { + chl_frame_state_cs_set_views( // +@@ -217,7 +219,8 @@ chl_frame_state_cs_default_pipeline(struct chl_frame_state *frame_state, + chl_frame_state_cs_set_target( // + frame_state, // + target_image, // +- target_storage_view, // ++ target_storage_view_y, // ++ target_storage_view_cbcr, // + target_viewport_datas); // + + // Start the compute pipeline. diff --git a/src/xrt/compositor/util/comp_render.h b/src/xrt/compositor/util/comp_render.h index 334464256..f4a9140a2 100644 --- a/src/xrt/compositor/util/comp_render.h diff --git a/patches/monado/0007-store-alpha-channel-in-layer-1.patch b/patches/monado/0007-store-alpha-channel-in-layer-1.patch index ae0370e1..f3aba717 100644 --- a/patches/monado/0007-store-alpha-channel-in-layer-1.patch +++ b/patches/monado/0007-store-alpha-channel-in-layer-1.patch @@ -1,4 +1,4 @@ -From a548af96b22969a85e75454d7d136a4cdbd46f36 Mon Sep 17 00:00:00 2001 +From 293e895f98e2ae8bd11acb63b42271d76a5b5427 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Sun, 3 Nov 2024 13:40:00 +0100 Subject: [PATCH 07/11] store alpha channel in layer 1 diff --git a/patches/monado/0008-st-oxr-bind-to-dynamic-role-s-profile.patch b/patches/monado/0008-st-oxr-bind-to-dynamic-role-s-profile.patch index 556fbb51..499d4e87 100644 --- a/patches/monado/0008-st-oxr-bind-to-dynamic-role-s-profile.patch +++ b/patches/monado/0008-st-oxr-bind-to-dynamic-role-s-profile.patch @@ -1,4 +1,4 @@ -From 35c2915478e736fa1013160fd320401a2a947535 Mon Sep 17 00:00:00 2001 +From 49fc1df97203114bc1421f8404bcba9a1df9c8b3 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Wed, 19 Feb 2025 10:13:36 +0100 Subject: [PATCH 08/11] st/oxr: bind to dynamic role's profile diff --git a/patches/monado/0009-c-main-allow-custom-pacing-app-factory.patch b/patches/monado/0009-c-main-allow-custom-pacing-app-factory.patch index 7c00efd3..df45684e 100644 --- a/patches/monado/0009-c-main-allow-custom-pacing-app-factory.patch +++ b/patches/monado/0009-c-main-allow-custom-pacing-app-factory.patch @@ -1,4 +1,4 @@ -From 0616565306836fa24c1a5c92fe7742a060f411f9 Mon Sep 17 00:00:00 2001 +From 57c79e9f03cc99365d48cfebef84387a3c04a170 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Thu, 27 Feb 2025 22:45:36 +0100 Subject: [PATCH 09/11] c/main: allow custom pacing app factory diff --git a/patches/monado/0010-st-oxr-forward-0-refresh-rate.patch b/patches/monado/0010-st-oxr-forward-0-refresh-rate.patch index 324753e6..75a6b0f6 100644 --- a/patches/monado/0010-st-oxr-forward-0-refresh-rate.patch +++ b/patches/monado/0010-st-oxr-forward-0-refresh-rate.patch @@ -1,4 +1,4 @@ -From e7282236100a88cbdc3f606f1acab6eb51831d77 Mon Sep 17 00:00:00 2001 +From f335c0e9660ac37ea461d67c6ea048ec5795531a Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Sat, 15 Mar 2025 22:19:48 +0100 Subject: [PATCH 10/11] st/oxr: forward 0 refresh rate diff --git a/patches/monado/0011-Replace-distortion-with-pixel-aligned-foveation.patch b/patches/monado/0011-Replace-distortion-with-pixel-aligned-foveation.patch index 53538d71..a97565d6 100644 --- a/patches/monado/0011-Replace-distortion-with-pixel-aligned-foveation.patch +++ b/patches/monado/0011-Replace-distortion-with-pixel-aligned-foveation.patch @@ -1,4 +1,4 @@ -From 6888508cb1ba85ffc23623c76bd479d1e5ab23a6 Mon Sep 17 00:00:00 2001 +From 0e1001f8a885140b239ce183c21171f5b1409e4b Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Mon, 2 Jun 2025 14:51:11 +0200 Subject: [PATCH 11/11] Replace distortion with pixel-aligned foveation @@ -13,7 +13,7 @@ Subject: [PATCH 11/11] Replace distortion with pixel-aligned foveation 6 files changed, 76 insertions(+), 378 deletions(-) diff --git a/src/xrt/compositor/CMakeLists.txt b/src/xrt/compositor/CMakeLists.txt -index 46834bde8..e76c69dd0 100644 +index 1ba5ec438..f1defe77a 100644 --- a/src/xrt/compositor/CMakeLists.txt +++ b/src/xrt/compositor/CMakeLists.txt @@ -115,7 +115,7 @@ if(XRT_HAVE_VULKAN)