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

[Impeller] Use infinite swapchain present timeouts to avoid logspam. #54810

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<uint64_t>::max(), // timeout (ns)
*sync->render_ready, // signal semaphore
nullptr // fence
);

switch (acq_result) {
Expand Down