glx: Pull get_proc_address out of the context vtable

One, only applegl needs this. Two, this isn't a function of the context
in any way so it doesn't belong in the context vtable. Just special-case
applegl for now, we can revisit applegl's dispatch later.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9690>
This commit is contained in:
Adam Jackson 2021-03-18 11:36:12 -04:00
parent cba1d6de22
commit 621b3a4041
8 changed files with 8 additions and 14 deletions

View File

@ -102,7 +102,7 @@ applegl_wait_x(struct glx_context *gc)
apple_glx_waitx(dpy, gc->driContext);
}
static void *
void *
applegl_get_proc_address(const char *symbol)
{
return dlsym(apple_cgl_get_dl_handle(), symbol);
@ -116,7 +116,6 @@ static const struct glx_context_vtable applegl_context_vtable = {
.wait_x = applegl_wait_x,
.bind_tex_image = NULL,
.release_tex_image = NULL,
.get_proc_address = applegl_get_proc_address,
};
struct glx_context *

View File

@ -1049,7 +1049,6 @@ static const struct glx_context_vtable dri2_context_vtable = {
.wait_x = dri2_wait_x,
.bind_tex_image = dri2_bind_tex_image,
.release_tex_image = dri2_release_tex_image,
.get_proc_address = NULL,
.interop_query_device_info = dri2_interop_query_device_info,
.interop_export_object = dri2_interop_export_object
};

View File

@ -716,7 +716,6 @@ static const struct glx_context_vtable dri3_context_vtable = {
.wait_x = dri3_wait_x,
.bind_tex_image = dri3_bind_tex_image,
.release_tex_image = dri3_release_tex_image,
.get_proc_address = NULL,
.interop_query_device_info = dri3_interop_query_device_info,
.interop_export_object = dri3_interop_export_object
};

View File

@ -478,7 +478,6 @@ static const struct glx_context_vtable drisw_context_vtable = {
.wait_x = NULL,
.bind_tex_image = drisw_bind_tex_image,
.release_tex_image = drisw_release_tex_image,
.get_proc_address = NULL,
};
static struct glx_context *

View File

@ -152,7 +152,6 @@ static const struct glx_context_vtable driwindows_context_vtable = {
.wait_x = NULL,
.bind_tex_image = driwindows_bind_tex_image,
.release_tex_image = driwindows_release_tex_image,
.get_proc_address = NULL,
};
static struct glx_context *

View File

@ -231,7 +231,6 @@ struct glx_context_vtable {
GLXDrawable drawable,
int buffer, const int *attrib_list);
void (*release_tex_image)(Display * dpy, GLXDrawable drawable, int buffer);
void * (*get_proc_address)(const char *symbol);
int (*interop_query_device_info)(struct glx_context *ctx,
struct mesa_glinterop_device_info *out);
int (*interop_export_object)(struct glx_context *ctx,
@ -807,6 +806,9 @@ applegl_create_context(struct glx_screen *psc,
extern int
applegl_create_display(struct glx_display *display);
extern void *
applegl_get_proc_address(const char *symbol);
#endif
extern Bool validate_renderType_against_config(const struct glx_config *config,

View File

@ -2648,12 +2648,10 @@ _GLX_PUBLIC void (*glXGetProcAddressARB(const GLubyte * procName)) (void)
#endif
if (!f)
f = (gl_function) _glapi_get_proc_address((const char *) procName);
if (!f) {
struct glx_context *gc = __glXGetCurrentContext();
if (gc != NULL && gc->vtable->get_proc_address != NULL)
f = gc->vtable->get_proc_address((const char *) procName);
}
#ifdef GLX_USE_APPLEGL
if (!f)
f = applegl_get_proc_address((const char *) procName);
#endif
}
return f;
}

View File

@ -320,7 +320,6 @@ static const struct glx_context_vtable indirect_context_vtable = {
.wait_x = indirect_wait_x,
.bind_tex_image = indirect_bind_tex_image,
.release_tex_image = indirect_release_tex_image,
.get_proc_address = NULL,
};
_X_HIDDEN struct glx_context *