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

[Impeller] Give a fixed timeout for acquireNextImageKHR. #44241

Merged
merged 1 commit into from
Aug 2, 2023
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
8 changes: 4 additions & 4 deletions impeller/renderer/backend/vulkan/swapchain_impl_vk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was about to say, "if this is a magic number anyway, let's make it the same as the Metal backend.". The docs for [CAMetalLayer nextDrawable] say "If all drawables are in use, the layer waits up to one second for one to become available, after which it returns nil.". If this was intentional, amazing attention to detail!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😉

*sync->render_ready, // signal semaphore
nullptr // fence
);

if (acq_result == vk::Result::eSuboptimalKHR) {
Expand Down