This repository has been archived by the owner on Feb 25, 2025. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Impeller] Fix a race between SwapchainImplVK::Present and WaitForFen…
…ce (#49777) The previous implementation used an fml::CountDownLatch to synchronize between FrameSynchronizer::WaitForFence and the task queued by SwapchainImplVK::Present. fml::CountDownLatch:Wait always waits, even if the count is already zero. So the raster thread would deadlock if the present task signals the latch before FrameSynchronizer::WaitForFence enters the wait. This PR instead uses a semaphore that is set each time SwapchainImplVK::Present is called. FrameSynchronizer::WaitForFence will check the semaphore to determine whether a present task is pending and if so wait for its completion.
- Loading branch information