summaryrefslogtreecommitdiff
path: root/src/render/Renderer.cpp
diff options
context:
space:
mode:
authorLee Bousfield <ljbousfield@gmail.com>2025-03-22 11:01:14 -0500
committerGitHub <noreply@github.com>2025-03-22 17:01:14 +0100
commit279b06044c583bfaa207d6fbd373c752967a4a2e (patch)
treed4d8757269b9d04d1ebe570ace2cf6fbfdb8e439 /src/render/Renderer.cpp
parentccbdba7ee2ccb835306de89a6023134fa6b8006f (diff)
screencopy, render: Use explicit sync for screencopy (#9697)
* screencopy, render: Use explicit sync for screencopy * screencopy: Check if explicit sync is enabled * screencopy: Don't require explicit KMS enabled
Diffstat (limited to 'src/render/Renderer.cpp')
-rw-r--r--src/render/Renderer.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index a89fd329..cf77c000 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -1447,8 +1447,6 @@ static hdr_output_metadata createHDRMetadata(SImageDescription settings, A
}
bool CHyprRenderer::commitPendingAndDoExplicitSync(PHLMONITOR pMonitor) {
- pMonitor->commitSeq++;
-
static auto PPASS = CConfigValue<Hyprlang::INT>("render:cm_fs_passthrough");
const bool PHDR = pMonitor->imageDescription.transferFunction == CM_TRANSFER_FUNCTION_ST2084_PQ;
@@ -2250,37 +2248,39 @@ void CHyprRenderer::endRender() {
if (m_eRenderMode == RENDER_MODE_FULL_FAKE)
return;
- if (m_eRenderMode == RENDER_MODE_NORMAL) {
+ if (m_eRenderMode == RENDER_MODE_NORMAL)
PMONITOR->output->state->setBuffer(m_pCurrentBuffer);
- auto explicitOptions = getExplicitSyncSettings(PMONITOR->output);
+ auto explicitOptions = getExplicitSyncSettings(PMONITOR->output);
- if (PMONITOR->inTimeline && explicitOptions.explicitEnabled && explicitOptions.explicitKMSEnabled) {
- PMONITOR->eglSync = g_pHyprOpenGL->createEGLSync();
- if (!PMONITOR->eglSync) {
- Debug::log(ERR, "renderer: couldn't create an EGLSync for out in endRender");
- return;
- }
+ if (PMONITOR->inTimeline && explicitOptions.explicitEnabled) {
+ PMONITOR->eglSync = g_pHyprOpenGL->createEGLSync();
+ if (!PMONITOR->eglSync) {
+ Debug::log(ERR, "renderer: couldn't create an EGLSync for out in endRender");
+ return;
+ }
- bool ok = PMONITOR->inTimeline->importFromSyncFileFD(PMONITOR->commitSeq, PMONITOR->eglSync->fd());
- if (!ok) {
- Debug::log(ERR, "renderer: couldn't import from sync file fd in endRender");
- return;
- }
+ PMONITOR->inTimelinePoint++;
+ bool ok = PMONITOR->inTimeline->importFromSyncFileFD(PMONITOR->inTimelinePoint, PMONITOR->eglSync->fd());
+ if (!ok) {
+ Debug::log(ERR, "renderer: couldn't import from sync file fd in endRender");
+ return;
+ }
- PMONITOR->inFence = CFileDescriptor{PMONITOR->inTimeline->exportAsSyncFileFD(PMONITOR->commitSeq)};
+ if (m_eRenderMode == RENDER_MODE_NORMAL && explicitOptions.explicitKMSEnabled) {
+ PMONITOR->inFence = CFileDescriptor{PMONITOR->inTimeline->exportAsSyncFileFD(PMONITOR->inTimelinePoint)};
if (!PMONITOR->inFence.isValid()) {
Debug::log(ERR, "renderer: couldn't export from sync timeline in endRender");
return;
}
PMONITOR->output->state->setExplicitInFence(PMONITOR->inFence.get());
- } else {
- if (isNvidia() && *PNVIDIAANTIFLICKER)
- glFinish();
- else
- glFlush();
}
+ } else {
+ if (isNvidia() && *PNVIDIAANTIFLICKER)
+ glFinish();
+ else
+ glFlush();
}
}