mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 13:38:00 +00:00
Rename DeviceErrorCallback to ErrorCallback and add ErrorType arg
This same callback will be used for push/pop error scope. Bug: dawn:153 Change-Id: I2771539e13f8a4e6a59f13c8082689d25ba44905 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10460 Commit-Queue: Austin Eng <enga@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
5603dc9044
commit
cb0cb658d4
@@ -31,8 +31,25 @@
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
|
||||
void PrintDeviceError(const char* message, void*) {
|
||||
std::cout << "Device error: " << message << std::endl;
|
||||
void PrintDeviceError(DawnErrorType errorType, const char* message, void*) {
|
||||
switch (errorType) {
|
||||
case DAWN_ERROR_TYPE_VALIDATION:
|
||||
std::cout << "Validation ";
|
||||
break;
|
||||
case DAWN_ERROR_TYPE_OUT_OF_MEMORY:
|
||||
std::cout << "Out of memory ";
|
||||
break;
|
||||
case DAWN_ERROR_TYPE_UNKNOWN:
|
||||
std::cout << "Unknown ";
|
||||
break;
|
||||
case DAWN_ERROR_TYPE_DEVICE_LOST:
|
||||
std::cout << "Device lost ";
|
||||
break;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
return;
|
||||
}
|
||||
std::cout << "error: " << message << std::endl;
|
||||
}
|
||||
|
||||
void PrintGLFWError(int code, const char* message) {
|
||||
|
||||
Reference in New Issue
Block a user