From b82c3c83c6a25e18c98891c4db863eda09ce14b9 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Tue, 13 Jun 2023 14:52:30 +0800 Subject: [PATCH] Fix an error in benchmark mode using wayland --- base/vulkanexamplebase.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/base/vulkanexamplebase.cpp b/base/vulkanexamplebase.cpp index c48ab61a..d20dc168 100644 --- a/base/vulkanexamplebase.cpp +++ b/base/vulkanexamplebase.cpp @@ -299,6 +299,16 @@ void VulkanExampleBase::renderLoop() // - for macOS, handle benchmarking within NSApp rendering loop via displayLinkOutputCb() #if !(defined(VK_USE_PLATFORM_IOS_MVK) || defined(VK_USE_PLATFORM_MACOS_MVK)) if (benchmark.active) { +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) + while (!configured) + wl_display_dispatch(display); + while (wl_display_prepare_read(display) != 0) + wl_display_dispatch_pending(display); + wl_display_flush(display); + wl_display_read_events(display); + wl_display_dispatch_pending(display); +#endif + benchmark.run([=] { render(); }, vulkanDevice->properties); vkDeviceWaitIdle(device); if (benchmark.filename != "") {