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 <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
This commit is contained in:
Austin Eng 2022-08-29 18:46:10 +00:00 committed by Dawn LUCI CQ
parent fe6d72dc4f
commit c165937955
1 changed files with 3 additions and 0 deletions

View File

@ -734,6 +734,9 @@ bool DeviceBase::IsDeviceIdle() {
if (mAsyncTaskManager->HasPendingTasks()) { if (mAsyncTaskManager->HasPendingTasks()) {
return false; return false;
} }
if (!mCallbackTaskManager->IsEmpty()) {
return false;
}
ExecutionSerial maxSerial = std::max(mLastSubmittedSerial, mFutureSerial); ExecutionSerial maxSerial = std::max(mLastSubmittedSerial, mFutureSerial);
if (mCompletedSerial == maxSerial) { if (mCompletedSerial == maxSerial) {