diff options
author | Yonggang Luo <luoyonggang@gmail.com> | 2023-06-25 10:04:42 +0800 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2023-06-29 01:36:09 +0000 |
commit | 1ed7a1282c5952aacaf641e9f400b6e7b06b43b9 (patch) | |
tree | 81f6c1a078a71043fe636981c6dbdc2ebd5a9f86 /src/mapi | |
parent | e3b93887eb67a6179f4a8f50ed25afb8e42d76f7 (diff) |
mapi: Merge get_static_proc_address into _glapi_get_proc_address
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23879>
Diffstat (limited to 'src/mapi')
-rw-r--r-- | src/mapi/glapi/glapi_getproc.c | 49 |
1 files changed, 15 insertions, 34 deletions
diff --git a/src/mapi/glapi/glapi_getproc.c b/src/mapi/glapi/glapi_getproc.c index a31bc0f22a3..4d364c7f504 100644 --- a/src/mapi/glapi/glapi_getproc.c +++ b/src/mapi/glapi/glapi_getproc.c @@ -83,30 +83,6 @@ get_static_proc_offset(const char *funcName) } - -/** - * Return dispatch function address for the named static (built-in) function. - * Return NULL if function not found. - */ -static _glapi_proc -get_static_proc_address(const char *funcName) -{ - const glprocs_table_t * const f = get_static_proc( funcName ); - if (f == NULL) { - return NULL; - } - -#if defined(DISPATCH_FUNCTION_SIZE) && defined(GLX_INDIRECT_RENDERING) - return (f->Address == NULL) - ? get_entrypoint_address(f->Offset) - : f->Address; -#elif defined(DISPATCH_FUNCTION_SIZE) - return get_entrypoint_address(f->Offset); -#else - return f->Address; -#endif -} - /********************************************************************** * Extension function management. */ @@ -148,26 +124,31 @@ _glapi_get_proc_offset(const char *funcName) /** - * Return pointer to the named function. If the function name isn't found - * in the name of static functions, try generating a new API entrypoint on - * the fly with assembly language. + * Return dispatch function address for the named static (built-in) function. + * Return NULL if function not found. */ _glapi_proc _glapi_get_proc_address(const char *funcName) { - _glapi_proc func; - init_glapi_relocs_once(); if (!funcName || funcName[0] != 'g' || funcName[1] != 'l') return NULL; - /* search static functions */ - func = get_static_proc_address(funcName); - if (func) - return func; + const glprocs_table_t *const f = get_static_proc(funcName); + if (f == NULL) { + return NULL; + } - return NULL; +#if defined(DISPATCH_FUNCTION_SIZE) && defined(GLX_INDIRECT_RENDERING) + return (f->Address == NULL) + ? get_entrypoint_address(f->Offset) + : f->Address; +#elif defined(DISPATCH_FUNCTION_SIZE) + return get_entrypoint_address(f->Offset); +#else + return f->Address; +#endif } |