[Impeller] Give a fixed timeout for acquireNextImageKHR. (flutter/engine#44241)

Fixes https://github.com/flutter/flutter/issues/131610

Since we're not blocking on presentation, we can have multiple images pending. This is generally good, but for the backpressure from acquireNextImageKHR to be valid it needs to have a finite timeout.

Pick a somewhat arbitrary but fairly long ms duration. See also: https://github.com/flutter/flutter/issues/131698
This commit is contained in:
Jonah Williams 2023-08-01 22:30:04 -07:00 committed by GitHub
parent d620528012
commit ac6ec58823

View File

@ -343,10 +343,10 @@ SwapchainImplVK::AcquireResult SwapchainImplVK::AcquireNextDrawable() {
/// Get the next image index.
///
auto [acq_result, index] = context.GetDevice().acquireNextImageKHR(
*swapchain_, // swapchain
std::numeric_limits<uint64_t>::max(), // timeout (nanoseconds)
*sync->render_ready, // signal semaphore
nullptr // fence
*swapchain_, // swapchain
1'000'000'000, // timeout (ns) 1000ms
*sync->render_ready, // signal semaphore
nullptr // fence
);
if (acq_result == vk::Result::eSuboptimalKHR) {