From 362db5828fbe4e2d568888e143e7fedb1acec395 Mon Sep 17 00:00:00 2001 From: Stephen White Date: Mon, 22 Jun 2020 13:48:34 -0400 Subject: [PATCH] DawnTestContext: print validation errors with SkDebugf. This helps to diagnose errors in DM tests. Change-Id: Ib585e6e78c1d0a03493befe970558e6f9c9731a1 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298136 Reviewed-by: Greg Daniel Commit-Queue: Stephen White --- tools/gpu/dawn/DawnTestContext.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/gpu/dawn/DawnTestContext.cpp b/tools/gpu/dawn/DawnTestContext.cpp index f30c5ecf52..58d755ea5c 100644 --- a/tools/gpu/dawn/DawnTestContext.cpp +++ b/tools/gpu/dawn/DawnTestContext.cpp @@ -77,6 +77,10 @@ private: ProcGetter* ProcGetter::fInstance; #endif +static void PrintDeviceError(WGPUErrorType, const char* message, void*) { + SkDebugf("Device error: %s\n", message); +} + class DawnTestContextImpl : public sk_gpu_test::DawnTestContext { public: static wgpu::Device createDevice(const dawn_native::Instance& instance, @@ -124,6 +128,7 @@ public: #endif #endif device = createDevice(*instance, type); + device.SetUncapturedErrorCallback(PrintDeviceError, 0); } if (!device) { return nullptr;