1
0
Fork 0

cogl/winsys: Remove eglGetProcAddress workaround for EGL < 1.5

`eglGetProcAddress()` used to not work for core API in EGL versions
below 1.5. The workaround in place in turn can fail - notably for setups
with a local Mesa build in /usr/local.
EGL 1.5 is almost 10 years old and similar workarounds don't seem to be
in place for toolkits we rely on, notably GTK4. Thus remove it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3655>
This commit is contained in:
Robert Mader 2024-03-09 16:04:09 +01:00
parent aaae07f9dd
commit 683e917854
9 changed files with 14 additions and 43 deletions

View file

@ -52,7 +52,6 @@ _cogl_feature_check (CoglRenderer *renderer,
const char *suffix = NULL; const char *suffix = NULL;
int func_num; int func_num;
CoglExtGlesAvailability gles_availability = 0; CoglExtGlesAvailability gles_availability = 0;
gboolean in_core;
switch (driver) switch (driver)
{ {
@ -77,7 +76,6 @@ _cogl_feature_check (CoglRenderer *renderer,
(data->gles_availability & gles_availability)) (data->gles_availability & gles_availability))
{ {
suffix = ""; suffix = "";
in_core = TRUE;
} }
else else
{ {
@ -130,8 +128,6 @@ _cogl_feature_check (CoglRenderer *renderer,
break; break;
} }
} }
in_core = FALSE;
} }
/* If we couldn't find anything that provides the functions then /* If we couldn't find anything that provides the functions then
@ -148,8 +144,7 @@ _cogl_feature_check (CoglRenderer *renderer,
full_function_name = g_strconcat (data->functions[func_num].name, full_function_name = g_strconcat (data->functions[func_num].name,
suffix, NULL); suffix, NULL);
func = _cogl_renderer_get_proc_address (renderer, func = _cogl_renderer_get_proc_address (renderer,
full_function_name, full_function_name);
in_core);
g_free (full_function_name); g_free (full_function_name);
if (func == NULL) if (func == NULL)

View file

@ -96,5 +96,4 @@ _cogl_renderer_remove_native_filter (CoglRenderer *renderer,
void * void *
_cogl_renderer_get_proc_address (CoglRenderer *renderer, _cogl_renderer_get_proc_address (CoglRenderer *renderer,
const char *name, const char *name);
gboolean in_core);

View file

@ -699,12 +699,11 @@ cogl_renderer_get_winsys_id (CoglRenderer *renderer)
void * void *
_cogl_renderer_get_proc_address (CoglRenderer *renderer, _cogl_renderer_get_proc_address (CoglRenderer *renderer,
const char *name, const char *name)
gboolean in_core)
{ {
const CoglWinsysVtable *winsys = _cogl_renderer_get_winsys (renderer); const CoglWinsysVtable *winsys = _cogl_renderer_get_winsys (renderer);
return winsys->renderer_get_proc_address (renderer, name, in_core); return winsys->renderer_get_proc_address (renderer, name);
} }
void void

View file

@ -59,7 +59,7 @@ cogl_get_proc_address (const char* name)
{ {
_COGL_GET_CONTEXT (ctx, NULL); _COGL_GET_CONTEXT (ctx, NULL);
return _cogl_renderer_get_proc_address (ctx->display->renderer, name, FALSE); return _cogl_renderer_get_proc_address (ctx->display->renderer, name);
} }
gboolean gboolean

View file

@ -430,16 +430,13 @@ _cogl_driver_update_features (CoglContext *ctx,
we can expect */ we can expect */
ctx->glGetString = ctx->glGetString =
(void *) _cogl_renderer_get_proc_address (ctx->display->renderer, (void *) _cogl_renderer_get_proc_address (ctx->display->renderer,
"glGetString", "glGetString");
TRUE);
ctx->glGetStringi = ctx->glGetStringi =
(void *) _cogl_renderer_get_proc_address (ctx->display->renderer, (void *) _cogl_renderer_get_proc_address (ctx->display->renderer,
"glGetStringi", "glGetStringi");
TRUE);
ctx->glGetIntegerv = ctx->glGetIntegerv =
(void *) _cogl_renderer_get_proc_address (ctx->display->renderer, (void *) _cogl_renderer_get_proc_address (ctx->display->renderer,
"glGetIntegerv", "glGetIntegerv");
TRUE);
gl_extensions = _cogl_context_get_gl_extensions (ctx); gl_extensions = _cogl_context_get_gl_extensions (ctx);

View file

@ -579,12 +579,10 @@ _cogl_driver_update_features (CoglContext *context,
can expect */ can expect */
context->glGetString = context->glGetString =
(void *) _cogl_renderer_get_proc_address (context->display->renderer, (void *) _cogl_renderer_get_proc_address (context->display->renderer,
"glGetString", "glGetString");
TRUE);
context->glGetStringi = context->glGetStringi =
(void *) _cogl_renderer_get_proc_address (context->display->renderer, (void *) _cogl_renderer_get_proc_address (context->display->renderer,
"glGetStringi", "glGetStringi");
TRUE);
gl_extensions = _cogl_context_get_gl_extensions (context); gl_extensions = _cogl_context_get_gl_extensions (context);

View file

@ -111,20 +111,9 @@ static const CoglFeatureData winsys_feature_data[] =
static GCallback static GCallback
_cogl_winsys_renderer_get_proc_address (CoglRenderer *renderer, _cogl_winsys_renderer_get_proc_address (CoglRenderer *renderer,
const char *name, const char *name)
gboolean in_core)
{ {
void *ptr = NULL; return eglGetProcAddress (name);
if (!in_core)
ptr = eglGetProcAddress (name);
/* eglGetProcAddress doesn't support fetching core API so we need to
get that separately with GModule */
if (ptr == NULL)
g_module_symbol (renderer->libgl_module, name, &ptr);
return ptr;
} }
static void static void

View file

@ -141,15 +141,10 @@ static const CoglFeatureData winsys_feature_data[] =
static GCallback static GCallback
_cogl_winsys_renderer_get_proc_address (CoglRenderer *renderer, _cogl_winsys_renderer_get_proc_address (CoglRenderer *renderer,
const char *name, const char *name)
gboolean in_core)
{ {
CoglGLXRenderer *glx_renderer = renderer->winsys; CoglGLXRenderer *glx_renderer = renderer->winsys;
/* The GLX_ARB_get_proc_address extension documents that this should
* work for core functions too so we don't need to do anything
* special with in_core */
return glx_renderer->glXGetProcAddress ((const GLubyte *) name); return glx_renderer->glXGetProcAddress ((const GLubyte *) name);
} }

View file

@ -68,8 +68,7 @@ typedef struct _CoglWinsysVtable
GCallback GCallback
(*renderer_get_proc_address) (CoglRenderer *renderer, (*renderer_get_proc_address) (CoglRenderer *renderer,
const char *name, const char *name);
gboolean in_core);
gboolean gboolean
(*renderer_connect) (CoglRenderer *renderer, (*renderer_connect) (CoglRenderer *renderer,