From 1744ad88d1f954d5ef1942c6772e1961751191ef Mon Sep 17 00:00:00 2001 From: Andrew Osmond Date: Tue, 17 Oct 2023 19:37:23 +0000 Subject: [PATCH] Bug 1859591 - Add gfxCriticalNote when failing to load EGL/GLES DLLs on Windows. r=gfx-reviewers,jrmuizel Differential Revision: https://phabricator.services.mozilla.com/D191206 --- gfx/gl/GLLibraryEGL.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gfx/gl/GLLibraryEGL.cpp b/gfx/gl/GLLibraryEGL.cpp index ebb14be70e52..a90d73d2a270 100644 --- a/gfx/gl/GLLibraryEGL.cpp +++ b/gfx/gl/GLLibraryEGL.cpp @@ -24,6 +24,7 @@ #ifdef XP_WIN # include "mozilla/gfx/DeviceManagerDx.h" # include "nsWindowsHelpers.h" +# include "prerror.h" # include #endif @@ -150,7 +151,12 @@ static PRLibrary* LoadLibraryForEGLOnWindows(const nsAString& filename) { PRLibSpec lspec; lspec.type = PR_LibSpec_PathnameU; lspec.value.pathname_u = path.get(); - return PR_LoadLibraryWithFlags(lspec, PR_LD_LAZY | PR_LD_LOCAL); + PRLibrary* lib = PR_LoadLibraryWithFlags(lspec, PR_LD_LAZY | PR_LD_LOCAL); + if (!lib) { + gfxCriticalNote << "Failed to load " << path.get() << " " << PR_GetError() + << " " << PR_GetOSError(); + } + return lib; } #endif // XP_WIN