Commit 4069a6b6 authored by Peng Huang's avatar Peng Huang Committed by Chromium LUCI CQ

Fix crash in VulaknSwapChain during shutdown

Suppose VulkanSwapChain::PostSubBuffer() and
VulkanSwapChain::PostSubBufferAsync() should not be called, if previous
call is pending. However we got some crash reports during shutdown,
seems they are called with pending PostSubBuffer(). To fix the problem,
we will always call WaitUntilPostSubBufferAsyncFinished() to make sure
previous request is finished.

Bug: 1155507
Change-Id: Id2456ea160c0fe0ebefabedbe2d7e915f5c97a34
Cq-Include-Trybots: luci.chromium.try:gpu-fyi-try-android-p-pixel-2-skv-32,gpu-fyi-try-linux-intel-skv,gpu-fyi-try-linux-nvidia-skv
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2601229Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
Auto-Submit: Peng Huang <penghuang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#839138}
parent 669c3747
......@@ -123,6 +123,8 @@ void VulkanSwapChain::Destroy() {
gfx::SwapResult VulkanSwapChain::PostSubBuffer(const gfx::Rect& rect) {
base::AutoLock auto_lock(lock_);
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
WaitUntilPostSubBufferAsyncFinished();
DCHECK(!has_pending_post_sub_buffer_);
if (UNLIKELY(!PresentBuffer(rect)))
......@@ -139,6 +141,8 @@ void VulkanSwapChain::PostSubBufferAsync(
PostSubBufferCompletionCallback callback) {
base::AutoLock auto_lock(lock_);
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
WaitUntilPostSubBufferAsyncFinished();
DCHECK(!has_pending_post_sub_buffer_);
if (UNLIKELY(!PresentBuffer(rect))) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment