diff options
author | Sarah <9856269+sarahM0@users.noreply.github.com> | 2019-09-05 14:03:52 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-05 14:03:52 -0400 |
commit | eb902004b43c175df0bf75e2fa1a16093b26b3ec (patch) | |
tree | 0cc1bee1dea89e6ca669a33500b5b70f0c635767 /samples | |
parent | 16b8e09b3d934c04bce227874fcc14b6f4051d72 (diff) | |
download | amber-eb902004b43c175df0bf75e2fa1a16093b26b3ec.tar.gz |
[Dawn] update amber to fix dawn bot failure (#630)
Diffstat (limited to 'samples')
-rw-r--r-- | samples/config_helper_dawn.cc | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/samples/config_helper_dawn.cc b/samples/config_helper_dawn.cc index a8043cd..b160756 100644 --- a/samples/config_helper_dawn.cc +++ b/samples/config_helper_dawn.cc @@ -24,8 +24,26 @@ ConfigHelperDawn::~ConfigHelperDawn() = default; namespace { // Callback which prints a message from a Dawn device operation. -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: + case DAWN_ERROR_TYPE_FORCE32: + std::cout << "Unknown "; + break; + case DAWN_ERROR_TYPE_DEVICE_LOST: + std::cout << "Device lost "; + break; + default: + std::cout << "Unreachable"; + return; + } + std::cout << "error: " << message << std::endl; } } // namespace @@ -59,7 +77,8 @@ amber::Result ConfigHelperDawn::CreateConfig( if (!dawn_device_) return amber::Result("could not find Vulkan or Metal backend for Dawn"); - backendProcs.deviceSetErrorCallback(dawn_device_.Get(), PrintDeviceError, 0); + backendProcs.deviceSetUncapturedErrorCallback(dawn_device_.Get(), + PrintDeviceError, nullptr); auto* dawn_config = new amber::DawnEngineConfig; dawn_config->device = &dawn_device_; config->reset(dawn_config); |