Don't load libEGL.dll from a global path on windows

* EGL emulators are not sufficiently stable to run RenderDoc, so we want to be
  able to fall back to EXT_create_context_es2_profile unless the libEGL.dll is
  explicitly placed in our plugin path.
This commit is contained in:
baldurk
2019-09-09 11:00:04 +01:00
parent 54291b0e29
commit ba4ccca62f
+16 -1
View File
@@ -25,11 +25,26 @@
#include "core/plugins.h"
#include "driver/gl/egl_dispatch_table.h"
#include "driver/gl/gl_common.h"
#include "strings/string_utils.h"
static void *GetEGLHandle()
{
#if ENABLED(RDOC_WIN32)
return Process::LoadModule(LocatePluginFile("gles", "libEGL.dll").c_str());
std::string libEGL = LocatePluginFile("gles", "libEGL.dll");
// refuse to load libEGL.dll globally, as this is too likely to pick up ANGLE from some program
// with poor PATH control. Instead try to explicitly load it from next to the DLL in case someone
// has put it there.
if(libEGL == "libEGL.dll")
{
std::string libpath;
FileIO::GetLibraryFilename(libpath);
libpath = get_dirname(libpath);
libEGL = libpath + "/libEGL.dll";
}
return Process::LoadModule(libEGL.c_str());
#else
void *handle = Process::LoadModule("libEGL.so");