From 7a3d647bab633caae270a74d8a398669bbfe8521 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Fri, 4 Oct 2019 14:49:30 +0200 Subject: Vulkan: Add platform hooks before presenting This allows the Wayland plugin to circumvent the frame callback handling of the driver (which blocks until the frame is presented, potentially forever, if the window is minimized). Task-number: QTBUG-78000 Change-Id: Ia7d347019dfeae3bfcfad3d0cca3f4fffdc8c7a9 Reviewed-by: Laszlo Agocs --- src/gui/vulkan/qvulkaninstance.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/gui/vulkan/qvulkaninstance.cpp') diff --git a/src/gui/vulkan/qvulkaninstance.cpp b/src/gui/vulkan/qvulkaninstance.cpp index 0605d88cca..daf37e3dc8 100644 --- a/src/gui/vulkan/qvulkaninstance.cpp +++ b/src/gui/vulkan/qvulkaninstance.cpp @@ -774,6 +774,20 @@ bool QVulkanInstance::supportsPresent(VkPhysicalDevice physicalDevice, uint32_t return d_ptr->platformInst->supportsPresent(physicalDevice, queueFamilyIndex, window); } +/*! + This function should be called by the application's renderer before queuing + a present operation for \a window. + + While on some platforms this will be a no-op, some may perform windowing + system dependent synchronization. For example, on Wayland this will + add send a wl_surface.frame request in order to prevent the driver from + blocking for minimized windows. + */ +void QVulkanInstance::presentAboutToBeQueued(QWindow *window) +{ + d_ptr->platformInst->presentAboutToBeQueued(window); +} + /*! This function should be called by the application's renderer after queuing a present operation for \a window. -- cgit v1.2.3