@@ -53,104 +53,7 @@ auto AllowEglCoreGetProcAddressFallback() -> bool
5353 return enabled;
5454}
5555
56- #ifdef _WIN32
57-
58- // Windows GL/EGL library name candidates
59-
60- constexpr std::array<const char *, 3 > kNativeEglNames = {
61- " libEGL.dll" ,
62- " EGL.dll" ,
63- nullptr };
64-
65- constexpr std::array<const char *, 2 > kNativeGlNames = {
66- " opengl32.dll" ,
67- nullptr };
68-
69- constexpr std::array<const char *, 5 > kNativeGlesNames = {
70- " libGLESv3.dll" ,
71- " GLESv3.dll" ,
72- " libGLESv2.dll" ,
73- " GLESv2.dll" ,
74- nullptr };
75-
76- #elif defined(__APPLE__)
77-
78- // macOS GL/EGL library name candidates
79- // macOS native OpenGL uses CGL (OpenGL.framework). ANGLE (and other portability layers).
80- // commonly provide EGL/GLES dylibs in the application bundle / @rpath.
81-
82- constexpr std::array<const char *, 6 > kNativeEglNames = {
83- " @rpath/libEGL.dylib" ,
84- " @rpath/libEGL.1.dylib" ,
85- " libEGL.dylib" ,
86- " libEGL.1.dylib" ,
87- " EGL" ,
88- nullptr };
89-
90- constexpr std::array<const char *, 2 > kNativeGlNames = {
91- " /System/Library/Frameworks/OpenGL.framework/OpenGL" ,
92- nullptr };
93-
94- constexpr std::array<const char *, 7 > kNativeGlesNames = {
95- " @rpath/libGLESv3.dylib" ,
96- " @rpath/libGLESv2.dylib" ,
97- " @rpath/libGLESv2_with_capture.dylib" ,
98- " libGLESv3.dylib" ,
99- " libGLESv2.dylib" ,
100- " libGLESv2_with_capture.dylib" ,
101- nullptr };
102- #elif defined(__ANDROID__)
103-
104- // Android EGL + GLES (no desktop libGL / GLX) library name candidates
105-
106- constexpr std::array<const char *, 2 > kNativeEglNames = {
107- " libEGL.so" ,
108- nullptr };
109-
110- constexpr std::array<const char *, 3 > kNativeGlesNames = {
111- " libGLESv3.so" ,
112- " libGLESv2.so" ,
113- nullptr };
114-
115- #else // #ifdef _WIN32
116-
117- // Unix GL/EGL library name candidates
118-
119- constexpr std::array<const char *, 3 > kNativeEglNames = {" libEGL.so.1" , " libEGL.so" , nullptr };
120-
121- /* *
122- * Linux / GLES:
123- * Prefer libGLESv3/libGLESv2 sonames. Core GLES entry points are expected
124- * to be available as library exports. eglGetProcAddress is not guaranteed
125- * to return core symbols unless EGL_KHR_get_all_proc_addresses (or its
126- * client variant) is advertised.
127- */
128- constexpr std::array<const char *, 6 > kNativeGlesNames = {
129- " libGLESv3.so.3" ,
130- " libGLESv3.so" ,
131- " libGLESv2.so.2" ,
132- " libGLESv2.so.1" ,
133- " libGLESv2.so" ,
134- nullptr };
135-
136- /* *
137- * Linux / GLVND note:
138- * Many modern distributions use GLVND, which splits OpenGL entry points (libOpenGL) from
139- * window-system glue such as GLX (libGLX). Prefer GLVND-facing libs first, but keep legacy
140- * libGL names in the candidate list for compatibility with older or non-GLVND stacks.
141- */
142- constexpr std::array<const char *, 6 > kNativeGlNames = {
143- " libOpenGL.so.1" , // GLVND OpenGL dispatcher (core gl* entry points)
144- " libOpenGL.so.0" , // older GLVND soname
145- " libGL.so.1" , // legacy/compat umbrella (often provided by GLVND)
146- " libGL.so.0" , // sometimes shipped as .so.0
147- " libGL.so" ,
148- nullptr };
149-
150- constexpr std::array<const char *, 3 > kNativeGlxNames = {
151- " libGLX.so.1" , // GLVND GLX dispatcher (glXGetProcAddress*)
152- " libGLX.so.0" , // older GLVND soname
153- nullptr };
56+ #if !defined(_WIN32) && !defined(__APPLE__) && !defined(__ANDROID__)
15457
15558/* *
15659 * GLX fallback for resolving non-extension gl* names via glXGetProcAddress*.
@@ -169,7 +72,7 @@ auto AllowGlxCoreGetProcAddressFallback() -> bool
16972 return enabled;
17073}
17174
172- #endif // #ifdef _WIN32
75+ #endif // #if !defined( _WIN32) && !defined(__APPLE__) && !defined(__ANDROID__)
17376
17477#ifdef __APPLE__
17578
@@ -484,8 +387,7 @@ auto GLResolver::Initialize(UserResolver resolver, void* userData) -> bool
484387 " egl=\" " + state.m_eglLib .LoadedName () + " \" " +
485388 " gl=\" " + state.m_glLib .LoadedName () + " \" " +
486389 " glx=\" " + state.m_glxLib .LoadedName () + " \" " +
487- " egl_get_proc=\" " + (state.m_eglGetProcAddress != nullptr ? " yes" : " no" ) + " \" " +
488- " egl_all_proc=\" " + (state.m_eglGetAllProcAddresses ? " yes" : " no" ) + " \" "
390+ " egl_get_proc=\" " + (state.m_eglGetProcAddress != nullptr ? " yes" : " no" ) + " \" "
489391
490392#endif
491393 ;
@@ -496,21 +398,22 @@ auto GLResolver::Initialize(UserResolver resolver, void* userData) -> bool
496398
497399 diag += std::string (" glx_get_proc=\" " ) + (state.m_glxGetProcAddress != nullptr ? " yes" : " no" ) + " \" " ;
498400
499- if (AllowGlxCoreGetProcAddressFallback ())
500- {
501- diag += " glx_policy=\" ext+fallback\" " ;
502- }
503- else
504- {
505- diag += " glx_policy=\" ext-only\" " ;
506- }
401+ diag += " glx_policy=\" " ;
402+ diag += AllowGlxCoreGetProcAddressFallback () ? " ext+fallback" : " ext-only" ;
403+ diag += " \" " ;
507404
508405#endif // #ifdef _WIN32
509406
510407#ifndef __EMSCRIPTEN__
511408
512- diag += " egl_fallback=\" " ;
513- diag += AllowEglCoreGetProcAddressFallback () ? " yes" : " no" ;
409+ diag += " egl_policy=\" " ;
410+ if (state.m_eglGetAllProcAddresses )
411+ {
412+ diag += " all" ;
413+ } else
414+ {
415+ diag += AllowEglCoreGetProcAddressFallback () ? " ext+fallback" : " ext-only" ;
416+ }
514417 diag += " \" " ;
515418
516419#endif // #ifndef __EMSCRIPTEN__
@@ -1341,7 +1244,6 @@ auto GLResolver::ResolveProcAddress(const ResolverState& state, const char* name
13411244#endif // #ifndef _WIN32 #else
13421245
13431246 // 4) Global symbol table (works if the process already linked/loaded GL libs).
1344- // NOTE: After initialization completes, native libraries are not mutated; m_mutex not needed here.
13451247 void * global = DynamicLibrary::FindGlobalSymbol (name);
13461248 if (global != nullptr )
13471249 {
0 commit comments