Replace the patches to Monado's main compositor with a local implementation, reusing code when relevant. The layer squasher is very close to comp_render_cs, while distortion is completely replaced by foveation.
48 lines
2.0 KiB
Diff
48 lines
2.0 KiB
Diff
From c0d86e77f011f0d75f17e5c30fb20bbf166dfc08 Mon Sep 17 00:00:00 2001
|
|
From: Patrick Nicolas <patricknicolas@laposte.net>
|
|
Date: Sat, 15 Mar 2025 22:19:48 +0100
|
|
Subject: [PATCH 4/8] st/oxr: forward 0 refresh rate
|
|
|
|
---
|
|
src/xrt/compositor/main/comp_compositor.c | 2 +-
|
|
src/xrt/state_trackers/oxr/oxr_api_session.c | 6 +-----
|
|
2 files changed, 2 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/src/xrt/compositor/main/comp_compositor.c b/src/xrt/compositor/main/comp_compositor.c
|
|
index 3364aaead..deec90a73 100644
|
|
--- a/src/xrt/compositor/main/comp_compositor.c
|
|
+++ b/src/xrt/compositor/main/comp_compositor.c
|
|
@@ -377,7 +377,7 @@ compositor_request_display_refresh_rate(struct xrt_compositor *xc, float display
|
|
if (c->target && c->target->request_refresh_rate) {
|
|
xrt_result_t result = comp_target_request_refresh_rate(c->target, display_refresh_rate_hz);
|
|
// Assume refresh rate change is immediate
|
|
- if (result == XRT_SUCCESS)
|
|
+ if (result == XRT_SUCCESS && display_refresh_rate_hz > 0)
|
|
c->frame_interval_ns = U_TIME_1S_IN_NS / display_refresh_rate_hz;
|
|
return result;
|
|
}
|
|
diff --git a/src/xrt/state_trackers/oxr/oxr_api_session.c b/src/xrt/state_trackers/oxr/oxr_api_session.c
|
|
index 09297f885..9f3a7ebc2 100644
|
|
--- a/src/xrt/state_trackers/oxr/oxr_api_session.c
|
|
+++ b/src/xrt/state_trackers/oxr/oxr_api_session.c
|
|
@@ -455,15 +455,11 @@ oxr_xrRequestDisplayRefreshRateFB(XrSession session, float displayRefreshRate)
|
|
OXR_VERIFY_SESSION_AND_INIT_LOG(&log, session, sess, "xrRequestDisplayRefreshRateFB");
|
|
OXR_VERIFY_SESSION_NOT_LOST(&log, sess);
|
|
|
|
- if (displayRefreshRate == 0.0f) {
|
|
- return XR_SUCCESS;
|
|
- }
|
|
-
|
|
/*
|
|
* For the requested display refresh rate, truncating to two decimal
|
|
* places and checking if it's in the supported refresh rates.
|
|
*/
|
|
- bool found = false;
|
|
+ bool found = displayRefreshRate == 0.0f;
|
|
for (int i = 0; i < (int)sess->sys->xsysc->info.refresh_rate_count; ++i) {
|
|
if ((int)(displayRefreshRate * 100.0f) == (int)(sess->sys->xsysc->info.refresh_rates_hz[i] * 100.0f)) {
|
|
found = true;
|
|
--
|
|
2.53.0
|
|
|