mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 15:40:41 -05:00
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:
parent
aaae07f9dd
commit
683e917854
@ -52,7 +52,6 @@ _cogl_feature_check (CoglRenderer *renderer,
|
||||
const char *suffix = NULL;
|
||||
int func_num;
|
||||
CoglExtGlesAvailability gles_availability = 0;
|
||||
gboolean in_core;
|
||||
|
||||
switch (driver)
|
||||
{
|
||||
@ -77,7 +76,6 @@ _cogl_feature_check (CoglRenderer *renderer,
|
||||
(data->gles_availability & gles_availability))
|
||||
{
|
||||
suffix = "";
|
||||
in_core = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -130,8 +128,6 @@ _cogl_feature_check (CoglRenderer *renderer,
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
in_core = FALSE;
|
||||
}
|
||||
|
||||
/* 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,
|
||||
suffix, NULL);
|
||||
func = _cogl_renderer_get_proc_address (renderer,
|
||||
full_function_name,
|
||||
in_core);
|
||||
full_function_name);
|
||||
g_free (full_function_name);
|
||||
|
||||
if (func == NULL)
|
||||
|
@ -96,5 +96,4 @@ _cogl_renderer_remove_native_filter (CoglRenderer *renderer,
|
||||
|
||||
void *
|
||||
_cogl_renderer_get_proc_address (CoglRenderer *renderer,
|
||||
const char *name,
|
||||
gboolean in_core);
|
||||
const char *name);
|
||||
|
@ -699,12 +699,11 @@ cogl_renderer_get_winsys_id (CoglRenderer *renderer)
|
||||
|
||||
void *
|
||||
_cogl_renderer_get_proc_address (CoglRenderer *renderer,
|
||||
const char *name,
|
||||
gboolean in_core)
|
||||
const char *name)
|
||||
{
|
||||
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
|
||||
|
@ -59,7 +59,7 @@ cogl_get_proc_address (const char* name)
|
||||
{
|
||||
_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
|
||||
|
@ -430,16 +430,13 @@ _cogl_driver_update_features (CoglContext *ctx,
|
||||
we can expect */
|
||||
ctx->glGetString =
|
||||
(void *) _cogl_renderer_get_proc_address (ctx->display->renderer,
|
||||
"glGetString",
|
||||
TRUE);
|
||||
"glGetString");
|
||||
ctx->glGetStringi =
|
||||
(void *) _cogl_renderer_get_proc_address (ctx->display->renderer,
|
||||
"glGetStringi",
|
||||
TRUE);
|
||||
"glGetStringi");
|
||||
ctx->glGetIntegerv =
|
||||
(void *) _cogl_renderer_get_proc_address (ctx->display->renderer,
|
||||
"glGetIntegerv",
|
||||
TRUE);
|
||||
"glGetIntegerv");
|
||||
|
||||
gl_extensions = _cogl_context_get_gl_extensions (ctx);
|
||||
|
||||
|
@ -579,12 +579,10 @@ _cogl_driver_update_features (CoglContext *context,
|
||||
can expect */
|
||||
context->glGetString =
|
||||
(void *) _cogl_renderer_get_proc_address (context->display->renderer,
|
||||
"glGetString",
|
||||
TRUE);
|
||||
"glGetString");
|
||||
context->glGetStringi =
|
||||
(void *) _cogl_renderer_get_proc_address (context->display->renderer,
|
||||
"glGetStringi",
|
||||
TRUE);
|
||||
"glGetStringi");
|
||||
|
||||
gl_extensions = _cogl_context_get_gl_extensions (context);
|
||||
|
||||
|
@ -111,20 +111,9 @@ static const CoglFeatureData winsys_feature_data[] =
|
||||
|
||||
static GCallback
|
||||
_cogl_winsys_renderer_get_proc_address (CoglRenderer *renderer,
|
||||
const char *name,
|
||||
gboolean in_core)
|
||||
const char *name)
|
||||
{
|
||||
void *ptr = NULL;
|
||||
|
||||
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;
|
||||
return eglGetProcAddress (name);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -141,15 +141,10 @@ static const CoglFeatureData winsys_feature_data[] =
|
||||
|
||||
static GCallback
|
||||
_cogl_winsys_renderer_get_proc_address (CoglRenderer *renderer,
|
||||
const char *name,
|
||||
gboolean in_core)
|
||||
const char *name)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -68,8 +68,7 @@ typedef struct _CoglWinsysVtable
|
||||
|
||||
GCallback
|
||||
(*renderer_get_proc_address) (CoglRenderer *renderer,
|
||||
const char *name,
|
||||
gboolean in_core);
|
||||
const char *name);
|
||||
|
||||
gboolean
|
||||
(*renderer_connect) (CoglRenderer *renderer,
|
||||
|
Loading…
Reference in New Issue
Block a user