mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 18:59:21 +00:00
Handle DeviceLost error
Handle DeviceLostCallback once DeviceLost error occurs. Disallow any other commands or actions on device to happen after device has been lost. Bug: dawn:68 Change-Id: Icbbbadf278cae5e6213050d00439118789c863dc Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12801 Commit-Queue: Natasha Lee <natlee@microsoft.com> Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
0c66bcd13a
commit
0ecc48ecb7
@@ -582,6 +582,7 @@ void DawnTestBase::SetUp() {
|
||||
queue = device.CreateQueue();
|
||||
|
||||
device.SetUncapturedErrorCallback(OnDeviceError, this);
|
||||
device.SetDeviceLostCallback(OnDeviceLost, this);
|
||||
}
|
||||
|
||||
void DawnTestBase::TearDown() {
|
||||
@@ -618,6 +619,10 @@ void DawnTestBase::OnDeviceError(WGPUErrorType type, const char* message, void*
|
||||
self->mError = true;
|
||||
}
|
||||
|
||||
void DawnTestBase::OnDeviceLost(const char* message, void* userdata) {
|
||||
FAIL() << "Device Lost during test: " << message;
|
||||
}
|
||||
|
||||
std::ostringstream& DawnTestBase::AddBufferExpectation(const char* file,
|
||||
int line,
|
||||
const wgpu::Buffer& buffer,
|
||||
|
||||
Reference in New Issue
Block a user