mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-05 06:03:34 +00:00
[tests]: Register Device::SetLoggingCallback()
And print this to the Dawn logger. Tests will now print any diagnostic logging calls from Dawn. Change-Id: Idd4bf816303c182809924f9a432570def808e1b6 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57381 Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
parent
5e3e3a020a
commit
93a75930b1
@ -948,6 +948,25 @@ void DawnTestBase::SetUp() {
|
||||
glfwMakeContextCurrent(gTestEnv->GetOpenGLESWindow());
|
||||
}
|
||||
#endif // defined(DAWN_ENABLE_BACKEND_OPENGLES)
|
||||
|
||||
device.SetLoggingCallback(
|
||||
[](WGPULoggingType type, char const* message, void*) {
|
||||
switch (type) {
|
||||
case WGPULoggingType_Verbose:
|
||||
dawn::DebugLog() << message;
|
||||
break;
|
||||
case WGPULoggingType_Warning:
|
||||
dawn::WarningLog() << message;
|
||||
break;
|
||||
case WGPULoggingType_Error:
|
||||
dawn::ErrorLog() << message;
|
||||
break;
|
||||
default:
|
||||
dawn::InfoLog() << message;
|
||||
break;
|
||||
}
|
||||
},
|
||||
nullptr);
|
||||
}
|
||||
|
||||
void DawnTestBase::TearDown() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user