mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-19 01:46:35 +00:00
Add DeviceLostCallback to dawn.json and dawn_wire
Bug: dawn:68 Change-Id: I6d8dd071be4ec612c67245bfde218e31e7a998b8 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14660 Commit-Queue: Natasha Lee <natlee@microsoft.com> Reviewed-by: Kai Ninomiya <kainino@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
3d2d62813f
commit
9bba4a936e
@@ -21,6 +21,11 @@ namespace dawn_wire { namespace server {
|
||||
server->OnUncapturedError(type, message);
|
||||
}
|
||||
|
||||
void Server::ForwardDeviceLost(const char* message, void* userdata) {
|
||||
auto server = static_cast<Server*>(userdata);
|
||||
server->OnDeviceLost(message);
|
||||
}
|
||||
|
||||
void Server::OnUncapturedError(WGPUErrorType type, const char* message) {
|
||||
ReturnDeviceUncapturedErrorCallbackCmd cmd;
|
||||
cmd.type = type;
|
||||
@@ -31,6 +36,15 @@ namespace dawn_wire { namespace server {
|
||||
cmd.Serialize(allocatedBuffer);
|
||||
}
|
||||
|
||||
void Server::OnDeviceLost(const char* message) {
|
||||
ReturnDeviceLostCallbackCmd cmd;
|
||||
cmd.message = message;
|
||||
|
||||
size_t requiredSize = cmd.GetRequiredSize();
|
||||
char* allocatedBuffer = static_cast<char*>(GetCmdSpace(requiredSize));
|
||||
cmd.Serialize(allocatedBuffer);
|
||||
}
|
||||
|
||||
bool Server::DoDevicePopErrorScope(WGPUDevice cDevice, uint64_t requestSerial) {
|
||||
ErrorScopeUserdata* userdata = new ErrorScopeUserdata;
|
||||
userdata->server = this;
|
||||
|
||||
Reference in New Issue
Block a user