egl: inline driver.GetProcAddress() as it's always _glapi_get_proc_address()
authorEric Engestrom <eric@igalia.com>
Thu, 2 Feb 2023 18:39:10 +0000 (18:39 +0000)
committerMarge Bot <emma+marge@anholt.net>
Wed, 19 Apr 2023 13:57:59 +0000 (13:57 +0000)
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21399>

src/egl/drivers/dri2/egl_dri2.c
src/egl/drivers/haiku/egl_haiku.cpp
src/egl/drivers/wgl/egl_wgl.c
src/egl/main/eglapi.c
src/egl/main/egldriver.h

index 0ebc46e..ff17f02 100644 (file)
@@ -1758,15 +1758,6 @@ dri2_surface_get_dri_drawable(_EGLSurface *surf)
    return dri2_surf->dri_drawable;
 }
 
-/*
- * Called from eglGetProcAddress() via drv->GetProcAddress().
- */
-static _EGLProc
-dri2_get_proc_address(const char *procname)
-{
-   return _glapi_get_proc_address(procname);
-}
-
 static _EGLSurface*
 dri2_create_window_surface(_EGLDisplay *disp, _EGLConfig *conf,
                            void *native_window, const EGLint *attrib_list)
@@ -3673,7 +3664,6 @@ const _EGLDriver _eglDriver = {
    .CreatePixmapSurface = dri2_create_pixmap_surface,
    .CreatePbufferSurface = dri2_create_pbuffer_surface,
    .DestroySurface = dri2_destroy_surface,
-   .GetProcAddress = dri2_get_proc_address,
    .WaitClient = dri2_wait_client,
    .WaitNative = dri2_wait_native,
    .BindTexImage = dri2_bind_tex_image,
index 3069c7e..f75eace 100644 (file)
@@ -517,5 +517,4 @@ const _EGLDriver _eglDriver = {
        .CreatePbufferSurface = haiku_create_pbuffer_surface,
        .DestroySurface = haiku_destroy_surface,
        .SwapBuffers = haiku_swap_buffers,
-       .GetProcAddress = _glapi_get_proc_address,
 };
index a06574a..7de0e00 100644 (file)
@@ -1179,7 +1179,6 @@ struct _egl_driver _eglDriver = {
    .QuerySurface = wgl_query_surface,
    .BindTexImage = wgl_bind_tex_image,
    .ReleaseTexImage = _eglReleaseTexImage,
-   .GetProcAddress = _glapi_get_proc_address,
    .SwapInterval = wgl_swap_interval,
    .SwapBuffers = wgl_swap_buffers,
    .WaitClient = wgl_wait_client,
index f65a9a9..019a2af 100644 (file)
@@ -94,6 +94,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include "c11/threads.h"
+#include "mapi/glapi/glapi.h"
 #include "util/u_debug.h"
 #include "util/macros.h"
 #include "util/perf/cpu_trace.h"
@@ -2885,8 +2886,8 @@ eglGetProcAddress(const char *procname)
          ret = entrypoint->function;
    }
 
-   if (!ret && _eglDriver.GetProcAddress)
-      ret = _eglDriver.GetProcAddress(procname);
+   if (!ret)
+      ret = _glapi_get_proc_address(procname);
 
    RETURN_EGL_SUCCESS(NULL, ret);
 }
index da2281e..6a1b2e1 100644 (file)
@@ -125,9 +125,6 @@ struct _egl_driver
    EGLBoolean (*WaitClient)(_EGLDisplay *disp, _EGLContext *ctx);
    EGLBoolean (*WaitNative)(EGLint engine);
 
-   /* this function may be called from multiple threads at the same time */
-   _EGLProc (*GetProcAddress)(const char *procname);
-
    /* for EGL_KHR_image_base */
    _EGLImage *(*CreateImageKHR)(_EGLDisplay *disp, _EGLContext *ctx,
                                 EGLenum target, EGLClientBuffer buffer,