summaryrefslogtreecommitdiff
path: root/src/helpers/MonitorFrameScheduler.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2025-07-19 12:38:41 +0200
committerGitHub <noreply@github.com>2025-07-19 12:38:41 +0200
commitd84699d8e5e984422da37595ee41fc0d8d93fef5 (patch)
treeb3ed5c1f47d25e961c53c823ead9d0000141a138 /src/helpers/MonitorFrameScheduler.cpp
parentae3cc48f223386b057137400354ed0ca1f7a8b1a (diff)
opengl: detect android fence support and disable explicit if it's missing (#11077)
Checks for explicit sync support via the android fences, and falls back to implicit sync if it isn't
Diffstat (limited to 'src/helpers/MonitorFrameScheduler.cpp')
-rw-r--r--src/helpers/MonitorFrameScheduler.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/helpers/MonitorFrameScheduler.cpp b/src/helpers/MonitorFrameScheduler.cpp
index 09782454..1ab4f19b 100644
--- a/src/helpers/MonitorFrameScheduler.cpp
+++ b/src/helpers/MonitorFrameScheduler.cpp
@@ -8,10 +8,15 @@ CMonitorFrameScheduler::CMonitorFrameScheduler(PHLMONITOR m) : m_monitor(m) {
;
}
-void CMonitorFrameScheduler::onSyncFired() {
+bool CMonitorFrameScheduler::newSchedulingEnabled() {
static auto PENABLENEW = CConfigValue<Hyprlang::INT>("render:new_render_scheduling");
- if (!*PENABLENEW)
+ return *PENABLENEW && g_pHyprOpenGL->explicitSyncSupported();
+}
+
+void CMonitorFrameScheduler::onSyncFired() {
+
+ if (!newSchedulingEnabled())
return;
// Sync fired: reset submitted state, set as rendered. Check the last render time. If we are running
@@ -36,9 +41,7 @@ void CMonitorFrameScheduler::onSyncFired() {
}
void CMonitorFrameScheduler::onPresented() {
- static auto PENABLENEW = CConfigValue<Hyprlang::INT>("render:new_render_scheduling");
-
- if (!*PENABLENEW)
+ if (!newSchedulingEnabled())
return;
if (!m_pendingThird)
@@ -65,8 +68,6 @@ void CMonitorFrameScheduler::onPresented() {
}
void CMonitorFrameScheduler::onFrame() {
- static auto PENABLENEW = CConfigValue<Hyprlang::INT>("render:new_render_scheduling");
-
if (!canRender())
return;
@@ -83,7 +84,7 @@ void CMonitorFrameScheduler::onFrame() {
m_monitor->m_tearingState.frameScheduledWhileBusy = false;
}
- if (!*PENABLENEW) {
+ if (!newSchedulingEnabled()) {
m_monitor->m_lastPresentationTimer.reset();
g_pHyprRenderer->renderMonitor(m_monitor.lock());