Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 09365fe

Browse files
authored
[Impeller] Use infinite swapchain present timeouts to avoid logspam. (#54810)
The initial timeout of 1 second was chosen to model the Metal backend where the [default drawable timeout is the same](https://developer.apple.com/documentation/quartzcore/cametallayer/2887086-allowsnextdrawabletimeout?language=objc).
1 parent 4282b72 commit 09365fe

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

impeller/renderer/backend/vulkan/swapchain/khr/khr_swapchain_impl_vk.cc

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ namespace impeller {
2020

2121
static constexpr size_t kMaxFramesInFlight = 3u;
2222

23-
// Number of frames to poll for orientation changes. For example `1u` means
24-
// that the orientation will be polled every frame, while `2u` means that the
25-
// orientation will be polled every other frame.
26-
static constexpr size_t kPollFramesForOrientation = 1u;
27-
2823
struct KHRFrameSynchronizerVK {
2924
vk::UniqueFence acquire;
3025
vk::UniqueSemaphore render_ready;
@@ -334,11 +329,15 @@ KHRSwapchainImplVK::AcquireResult KHRSwapchainImplVK::AcquireNextDrawable() {
334329
//----------------------------------------------------------------------------
335330
/// Get the next image index.
336331
///
332+
/// @bug Non-infinite timeouts are not supported on some older Android
333+
/// devices and the only indication we get is log spam which serves to
334+
/// add confusion. Just use an infinite timeout instead of being
335+
/// defensive.
337336
auto [acq_result, index] = context.GetDevice().acquireNextImageKHR(
338-
*swapchain_, // swapchain
339-
1'000'000'000, // timeout (ns) 1000ms
340-
*sync->render_ready, // signal semaphore
341-
nullptr // fence
337+
*swapchain_, // swapchain
338+
std::numeric_limits<uint64_t>::max(), // timeout (ns)
339+
*sync->render_ready, // signal semaphore
340+
nullptr // fence
342341
);
343342

344343
switch (acq_result) {

0 commit comments

Comments
 (0)