Vulkan: Update AcquireNextImageUnlocked() implementation Main goal of this change is to simplify acquire next image operation state change tracking. Key members before this change: 1. `mAcquireOperation.needToAcquireNextSwapchainImage` 2. `unlockedAcquireResult.acquireSemaphore` Possible states: 1: 2: false NULL -> image is acquired or no need true ANY -> need to prepare for and do unlocked ANI false HANDLE -> need to process ANI result Only `mAcquireOperation.state` is used after this change. Possible states: Ready -> image is acquired or no need NeedToAcquire -> need to prepare for and do unlocked ANI NeedToProcessResult -> need to process ANI result Value of `unlockedAcquireResult.acquireSemaphore` is now only used as semaphore in the post process and not as boolean, indicating that result needs processing. Change adds a lot of ASSERTs to protect from invalid scenarios. In order for these ASSERTs to work as expected, `deferAcquireNextImage()` is now called regardless if swapchain is out-of-date or not. Another functional change is that `postProcessUnlockedAcquire()` does not mark image as processed at the start and then defers ANI in case of a failure (so the next ANI fail again), but instead keeps the current state (NeedToProcessResult) allowing failure to be processed again without repeating ANI call in case if there will be no swapchain recreation. State is set to `Ready` only after processing is successful. Bug: angleproject:42265346 Bug: angleproject:42266579 Change-Id: I4a6a66fa3b6f25a788a8959eff5848b7ec5bdd27 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6018094 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>