Bug 986811 - Use the latest d3dcompiler dll if available. r=jgilbert

This commit is contained in:
Masatoshi Kimura 2014-03-26 22:41:57 +09:00
parent 674357bdb6
commit 5e7d4335c6

View File

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