Skip to content

Commit

Permalink
GL/Context: Prefer EGL over GLX on all platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Nov 23, 2022
1 parent 27b0847 commit 0d178a2
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/common/gl/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,17 +137,11 @@ std::unique_ptr<GL::Context> Context::Create(const WindowInfo& wi, const Version
if (wi.type == WindowInfo::Type::X11)
{
#ifdef USE_EGL
// Always prefer EGL when running on ARM. Mali drivers don't support GLX,
// and anything using Mesa will support EGL anyway.
#if defined(__arm__) || defined(__aarch64__)
context = ContextEGLX11::Create(wi, versions_to_try, num_versions_to_try);
#else
const char* use_egl_x11 = std::getenv("USE_EGL_X11");
if (use_egl_x11 && std::strcmp(use_egl_x11, "1") == 0)
context = ContextEGLX11::Create(wi, versions_to_try, num_versions_to_try);
else
const char* use_glx = std::getenv("USE_GLX");
if (use_glx && std::strcmp(use_glx, "1") == 0)
context = ContextGLX::Create(wi, versions_to_try, num_versions_to_try);
#endif
else
context = ContextEGLX11::Create(wi, versions_to_try, num_versions_to_try);
#else
context = ContextGLX::Create(wi, versions_to_try, num_versions_to_try);
#endif
Expand Down

0 comments on commit 0d178a2

Please sign in to comment.