Skip to content

Commit

Permalink
Call the uncaptured error callback immediately
Browse files Browse the repository at this point in the history
Bug: webgpu-native/webgpu-headers#199
Change-Id: Id30ec55b2eb727ddf6dd0bf09b612ddee99b88da
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/173620
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
  • Loading branch information
austinEng authored and Dawn LUCI CQ committed Feb 6, 2024
1 parent 3e691c9 commit 528a5c6
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/dawn/native/Device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,15 +628,8 @@ void DeviceBase::HandleError(std::unique_ptr<ErrorData> error,
// handled by the lost callback.
bool captured = mErrorScopeStack->HandleError(ToWGPUErrorType(type), messageStr.c_str());
if (!captured && mUncapturedErrorCallback != nullptr) {
mCallbackTaskManager->AddCallbackTask([callback = mUncapturedErrorCallback, type,
messageStr,
userdata = mUncapturedErrorUserdata] {
callback(static_cast<WGPUErrorType>(ToWGPUErrorType(type)), messageStr.c_str(),
userdata);
});
if (IsImmediateErrorHandlingEnabled()) {
mCallbackTaskManager->Flush();
}
mUncapturedErrorCallback(static_cast<WGPUErrorType>(ToWGPUErrorType(type)),
messageStr.c_str(), mUncapturedErrorUserdata);
}
}
}
Expand Down

0 comments on commit 528a5c6

Please sign in to comment.