Log error message if unable to open libEGL.
When attempting to load the libEGL library, we can retrieve the erorr
message for a failed load by providing a string. This CL updates the
call to provide the string and provides the context as to why the load
failed.
Change-Id: Iafa71d72960a415030750f83056354393592f4a1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/170301
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Gregg Tavares <gman@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Stephen White <senorblanco@chromium.org>
diff --git a/src/dawn/native/opengl/BackendGL.cpp b/src/dawn/native/opengl/BackendGL.cpp
index 338754f..34ea163 100644
--- a/src/dawn/native/opengl/BackendGL.cpp
+++ b/src/dawn/native/opengl/BackendGL.cpp
@@ -27,6 +27,8 @@
#include "dawn/native/opengl/BackendGL.h"
+#include <string>
+
#include "dawn/native/ChainUtils.h"
#include "dawn/native/Instance.h"
#include "dawn/native/OpenGLBackend.h"
@@ -67,9 +69,10 @@
#else
const char* eglLib = "libEGL.so";
#endif
- if (!mLibEGL.Valid() && !mLibEGL.Open(eglLib)) {
+ std::string err;
+ if (!mLibEGL.Valid() && !mLibEGL.Open(eglLib, &err)) {
GetInstance()->ConsumedErrorAndWarnOnce(
- DAWN_VALIDATION_ERROR("Failed to load %s", eglLib));
+ DAWN_VALIDATION_ERROR("Failed to load %s: %s", eglLib, err.c_str()));
return {};
}