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 <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@google.com>
This commit is contained in:
Stephen White 2020-06-22 13:48:34 -04:00 committed by Skia Commit-Bot
parent 15ee455939
commit 362db5828f

View File

@ -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;