client: Add waitForFrameSync for Vulkan

Frames are processed by mFrameQueue in Qtwayand. However, in vulkan
backend, frames are sent by handleUpdate() but waitForFrameSync()
is not called which should handle frames in mFrameQueue.
For the current vulkan backend, frames are only handled by drivers
like mesa. So in the current vulkan backend, some particular animations
don't run or are slow because frames sent by qtwayland are not being
handled.

Fixes: QTBUG-96222
Change-Id: Ifbab385ca619ef9461104eb8bd778f17093a56b5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: YoungSun Park <cathy.park@lge.com>
This commit is contained in:
Cathy Park 2021-10-15 17:35:26 +09:00
parent 1a2e499e0e
commit 05fefdbf57
2 changed files with 11 additions and 0 deletions

View File

@ -124,6 +124,16 @@ void QWaylandVulkanInstance::presentAboutToBeQueued(QWindow *window)
qWarning() << "Attempted to call presentAboutToBeQueued() without a valid platform window";
return;
}
bool ok;
int frameCallbackTimeout = qEnvironmentVariableIntValue("QT_WAYLAND_FRAME_CALLBACK_TIMEOUT", &ok);
if (ok)
mFrameCallbackTimeout = frameCallbackTimeout;
if (w->format().swapInterval() > 0)
w->waitForFrameSync(mFrameCallbackTimeout);
w->handleUpdate();
}

View File

@ -82,6 +82,7 @@ private:
QVulkanInstance *m_instance = nullptr;
PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR m_getPhysDevPresSupport = nullptr;
PFN_vkCreateWaylandSurfaceKHR m_createSurface = nullptr;
int mFrameCallbackTimeout = 100;
};
} // namespace QtWaylandClient