diff --git a/gfx/gl/GLLibraryEGL.cpp b/gfx/gl/GLLibraryEGL.cpp index 9c16a372eaf7..359df460573c 100644 --- a/gfx/gl/GLLibraryEGL.cpp +++ b/gfx/gl/GLLibraryEGL.cpp @@ -9,6 +9,9 @@ #include "nsDirectoryServiceDefs.h" #include "nsDirectoryServiceUtils.h" #include "nsPrintfCString.h" +#ifdef XP_WIN +#include "nsWindowsHelpers.h" +#endif #include "prenv.h" #include "GLContext.h" #include "gfxPrefs.h" @@ -112,7 +115,14 @@ GLLibraryEGL::EnsureInitialized() #ifndef MOZ_D3DCOMPILER_DLL #error MOZ_D3DCOMPILER_DLL should have been defined by the Makefile #endif - LoadLibraryForEGLOnWindows(NS_LITERAL_STRING(NS_STRINGIFY(MOZ_D3DCOMPILER_DLL))); + // Windows 8.1 has d3dcompiler_47.dll in the system directory. + // Try it first. Note that _46 will never be in the system + // directory and we ship with at least _43. So there is no point + // trying _46 and _43 in the system directory. + if (!LoadLibrarySystem32(L"d3dcompiler_47.dll")) { + // Fall back to the version that we shipped with. + LoadLibraryForEGLOnWindows(NS_LITERAL_STRING(NS_STRINGIFY(MOZ_D3DCOMPILER_DLL))); + } // intentionally leak the D3DCOMPILER_DLL library LoadLibraryForEGLOnWindows(NS_LITERAL_STRING("libGLESv2.dll"));