mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-15 08:06:19 +00:00
Make error scope shutdown iterative instead of recursive.
This avoids a stack overflow when many error scopes are pushed on device shutdown. It also changes the error scopes to return a Unknown error type on shutdown instead of NoError. A regression test is added. Bug: chromium:1078438 Bug: chromium:1081063 Change-Id: Ibfab8dd19480414c1854ec2bd4928939663ba698 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21440 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
c2542cde3e
commit
a6cf7b5b1d
@@ -196,3 +196,11 @@ TEST_F(ErrorScopeValidationTest, DeviceDestroyedBeforeCallback) {
|
||||
EXPECT_CALL(*mockDevicePopErrorScopeCallback, Call(WGPUErrorType_NoError, _, this)).Times(1);
|
||||
device = nullptr;
|
||||
}
|
||||
|
||||
// Regression test that on device shutdown, we don't get a recursion in O(pushed error scope) that
|
||||
// would lead to a stack overflow
|
||||
TEST_F(ErrorScopeValidationTest, ShutdownStackOverflow) {
|
||||
for (size_t i = 0; i < 1'000'000; i++) {
|
||||
device.PushErrorScope(wgpu::ErrorFilter::Validation);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user