Loosens validation for APITick.
- Validation no longer produces an error if the device is destroyed. Instead it just no-ops now. - Internal Ticks are still validated the same as before. - Necessary because Chromium may call Tick after device.destroy() which causes noisy validation errors that can break tests. - Removes the current tests for this bahavior with new follow up tests in child CL. Bug: dawn:628 Change-Id: Idc676490c7dcf1edd104b5dfd0e9fa5c023089ca Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/77200 Reviewed-by: Austin Eng <enga@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Loko Kung <lokokung@google.com>
This commit is contained in:
parent
257e85a7b9
commit
4f37ae7f3e
|
@ -1102,7 +1102,7 @@ namespace dawn::native {
|
||||||
|
|
||||||
// Returns true if future ticking is needed.
|
// Returns true if future ticking is needed.
|
||||||
bool DeviceBase::APITick() {
|
bool DeviceBase::APITick() {
|
||||||
if (ConsumedError(Tick())) {
|
if (IsLost() || ConsumedError(Tick())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return !IsDeviceIdle();
|
return !IsDeviceIdle();
|
||||||
|
|
|
@ -228,11 +228,6 @@ TEST_P(DeviceLostTest, CreateTextureFails) {
|
||||||
ASSERT_DEVICE_ERROR(device.CreateTexture(&descriptor));
|
ASSERT_DEVICE_ERROR(device.CreateTexture(&descriptor));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(DeviceLostTest, TickFails) {
|
|
||||||
LoseForTesting();
|
|
||||||
ASSERT_DEVICE_ERROR(device.Tick());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Test that CreateBuffer fails when device is lost
|
// Test that CreateBuffer fails when device is lost
|
||||||
TEST_P(DeviceLostTest, CreateBufferFails) {
|
TEST_P(DeviceLostTest, CreateBufferFails) {
|
||||||
LoseForTesting();
|
LoseForTesting();
|
||||||
|
@ -413,7 +408,6 @@ TEST_P(DeviceLostTest, QueueOnSubmittedWorkDoneFails) {
|
||||||
EXPECT_CALL(*mockQueueWorkDoneCallback, Call(WGPUQueueWorkDoneStatus_DeviceLost, nullptr))
|
EXPECT_CALL(*mockQueueWorkDoneCallback, Call(WGPUQueueWorkDoneStatus_DeviceLost, nullptr))
|
||||||
.Times(1);
|
.Times(1);
|
||||||
ASSERT_DEVICE_ERROR(queue.OnSubmittedWorkDone(0, ToMockQueueWorkDone, nullptr));
|
ASSERT_DEVICE_ERROR(queue.OnSubmittedWorkDone(0, ToMockQueueWorkDone, nullptr));
|
||||||
ASSERT_DEVICE_ERROR(device.Tick());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test that QueueOnSubmittedWorkDone when the device is lost after calling OnSubmittedWorkDone
|
// Test that QueueOnSubmittedWorkDone when the device is lost after calling OnSubmittedWorkDone
|
||||||
|
@ -424,7 +418,6 @@ TEST_P(DeviceLostTest, QueueOnSubmittedWorkDoneBeforeLossFails) {
|
||||||
queue.OnSubmittedWorkDone(0, ToMockQueueWorkDone, nullptr);
|
queue.OnSubmittedWorkDone(0, ToMockQueueWorkDone, nullptr);
|
||||||
|
|
||||||
LoseForTesting();
|
LoseForTesting();
|
||||||
ASSERT_DEVICE_ERROR(device.Tick());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test that LostForTesting can only be called on one time
|
// Test that LostForTesting can only be called on one time
|
||||||
|
|
Loading…
Reference in New Issue