From 16c02bef0bbf6dca8755338b8b241c985aa9e418 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 27 Aug 2024 13:32:54 -0700 Subject: [PATCH] [Impeller] Use infinite swapchain present timeouts to avoid logspam. --- .../swapchain/khr/khr_swapchain_impl_vk.cc | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/impeller/renderer/backend/vulkan/swapchain/khr/khr_swapchain_impl_vk.cc b/impeller/renderer/backend/vulkan/swapchain/khr/khr_swapchain_impl_vk.cc index 8be88832bb470..fa6564e43fa44 100644 --- a/impeller/renderer/backend/vulkan/swapchain/khr/khr_swapchain_impl_vk.cc +++ b/impeller/renderer/backend/vulkan/swapchain/khr/khr_swapchain_impl_vk.cc @@ -20,11 +20,6 @@ namespace impeller { static constexpr size_t kMaxFramesInFlight = 3u; -// Number of frames to poll for orientation changes. For example `1u` means -// that the orientation will be polled every frame, while `2u` means that the -// orientation will be polled every other frame. -static constexpr size_t kPollFramesForOrientation = 1u; - struct KHRFrameSynchronizerVK { vk::UniqueFence acquire; vk::UniqueSemaphore render_ready; @@ -334,11 +329,15 @@ KHRSwapchainImplVK::AcquireResult KHRSwapchainImplVK::AcquireNextDrawable() { //---------------------------------------------------------------------------- /// Get the next image index. /// + /// @bug Non-infinite timeouts are not supported on some older Android + /// devices and the only indication we get is log spam which serves to + /// add confusion. Just use an infinite timeout instead of being + /// defensive. auto [acq_result, index] = context.GetDevice().acquireNextImageKHR( - *swapchain_, // swapchain - 1'000'000'000, // timeout (ns) 1000ms - *sync->render_ready, // signal semaphore - nullptr // fence + *swapchain_, // swapchain + std::numeric_limits::max(), // timeout (ns) + *sync->render_ready, // signal semaphore + nullptr // fence ); switch (acq_result) {