From c165937955b1734571603fe769af33b8b3bb7be4 Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Mon, 29 Aug 2022 18:46:10 +0000 Subject: [PATCH] Return false from IsDeviceIdle if there are pending callback tasks Fixes a race where async pipeline compilations could never see their callbacks called because Chromium stopped calling device.Tick(). Fixed: dawn:1527 Change-Id: I273409d427ef02a7a6817647eb38564adfdf0da8 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/100565 Commit-Queue: Austin Eng Reviewed-by: Corentin Wallez Kokoro: Kokoro Reviewed-by: Loko Kung --- src/dawn/native/Device.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dawn/native/Device.cpp b/src/dawn/native/Device.cpp index a83d1853bb..2093a0a208 100644 --- a/src/dawn/native/Device.cpp +++ b/src/dawn/native/Device.cpp @@ -734,6 +734,9 @@ bool DeviceBase::IsDeviceIdle() { if (mAsyncTaskManager->HasPendingTasks()) { return false; } + if (!mCallbackTaskManager->IsEmpty()) { + return false; + } ExecutionSerial maxSerial = std::max(mLastSubmittedSerial, mFutureSerial); if (mCompletedSerial == maxSerial) {