From 29397f2e0006e5a3af47b22212faf56579152f65 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Mon, 5 Jun 2023 15:08:43 -0700 Subject: [PATCH] mesa: Drop the function parameter spec from the remap table. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Since we don't generate dynamic dispatch stubs any more, we don't need this data. Acked-by: Marek Olšák Acked-by: Alyssa Rosenzweig Reviewed-by: Adam Jackson Part-of: --- src/mapi/glapi/gen/remap_helper.py | 19 ++----------------- src/mapi/glapi/glapi.h | 3 +-- src/mapi/glapi/glapi_getproc.c | 32 +------------------------------- src/mapi/shared-glapi/glapi.c | 14 +------------- src/mesa/main/remap.c | 15 ++++----------- 5 files changed, 9 insertions(+), 74 deletions(-) diff --git a/src/mapi/glapi/gen/remap_helper.py b/src/mapi/glapi/gen/remap_helper.py index dae9552..799e60f 100644 --- a/src/mapi/glapi/gen/remap_helper.py +++ b/src/mapi/glapi/gen/remap_helper.py @@ -30,23 +30,8 @@ import gl_XML def get_function_spec(func): - sig = "" - # derive parameter signature - for p in func.parameterIterator(): - if p.is_padding: - continue - # FIXME: This is a *really* ugly hack. :( - tn = p.type_expr.get_base_type_node() - if p.is_pointer(): - sig += 'p' - elif tn.integer: - sig += 'i' - elif tn.size == 4: - sig += 'f' - else: - sig += 'd' - - spec = [sig] + spec = [] + for ent in func.entry_points: spec.append("gl" + ent) diff --git a/src/mapi/glapi/glapi.h b/src/mapi/glapi/glapi.h index d51ba0f..feac2a6 100644 --- a/src/mapi/glapi/glapi.h +++ b/src/mapi/glapi/glapi.h @@ -125,8 +125,7 @@ _glapi_get_dispatch_table_size(void); _GLAPI_EXPORT int -_glapi_add_dispatch( const char * const * function_names, - const char * parameter_signature ); +_glapi_add_dispatch( const char * const * function_names ); _GLAPI_EXPORT int _glapi_get_proc_offset(const char *funcName); diff --git a/src/mapi/glapi/glapi_getproc.c b/src/mapi/glapi/glapi_getproc.c index 5689b2ed..501e7c8 100644 --- a/src/mapi/glapi/glapi_getproc.c +++ b/src/mapi/glapi/glapi_getproc.c @@ -140,18 +140,6 @@ struct _glapi_function { * Name of the function. */ const char * name; - - - /** - * Text string that describes the types of the parameters passed to the - * named function. Parameter types are converted to characters using the - * following rules: - * - 'i' for \c GLint, \c GLuint, and \c GLenum - * - 'p' for any pointer type - * - 'f' for \c GLfloat and \c GLclampf - * - 'd' for \c GLdouble and \c GLclampd - */ - const char * parameter_signature; }; @@ -161,14 +149,6 @@ struct _glapi_function { * * \param function_names Array of pointers to function names that should * share a common dispatch offset. - * \param parameter_signature String representing the types of the parameters - * passed to the named function. Parameter types - * are converted to characters using the following - * rules: - * - 'i' for \c GLint, \c GLuint, and \c GLenum - * - 'p' for any pointer type - * - 'f' for \c GLfloat and \c GLclampf - * - 'd' for \c GLdouble and \c GLclampd * * \returns * The offset in the dispatch table of the named function. A pointer to the @@ -185,22 +165,12 @@ struct _glapi_function { * too painful of a limitation. * * \todo - * Determine whether or not \c parameter_signature should be allowed to be - * \c NULL. It doesn't seem like much of a hardship for drivers to have to - * pass in an empty string. - * - * \todo * Determine if code should be added to reject function names that start with * 'glX'. - * - * \bug - * Add code to compare \c parameter_signature with the parameter signature of - * a static function. In order to do that, we need to find a way to \b get - * the parameter signature of a static function. */ int -_glapi_add_dispatch(const char *const *function_names, const char *parameter_signature) +_glapi_add_dispatch(const char *const *function_names) { unsigned i; int offset = ~0; diff --git a/src/mapi/shared-glapi/glapi.c b/src/mapi/shared-glapi/glapi.c index cfb7643..06cbdfd 100644 --- a/src/mapi/shared-glapi/glapi.c +++ b/src/mapi/shared-glapi/glapi.c @@ -60,14 +60,6 @@ _glapi_get_dispatch_table_size(void) * * \param function_names Array of pointers to function names that should * share a common dispatch offset. - * \param parameter_signature String representing the types of the parameters - * passed to the named function. Parameter types - * are converted to characters using the following - * rules: - * - 'i' for \c GLint, \c GLuint, and \c GLenum - * - 'p' for any pointer type - * - 'f' for \c GLfloat and \c GLclampf - * - 'd' for \c GLdouble and \c GLclampd * * \returns * The offset in the dispatch table of the named function. A pointer to the @@ -82,13 +74,9 @@ _glapi_get_dispatch_table_size(void) * 4 (\c glPointParameterfSGIS, \c glPointParameterfEXT, * \c glPointParameterfARB, and \c glPointParameterf), so this should not be * too painful of a limitation. - * - * \todo - * Check parameter_signature. */ int -_glapi_add_dispatch( const char * const * function_names, - const char * parameter_signature ) +_glapi_add_dispatch( const char * const * function_names ) { const struct mapi_stub *alias = NULL; unsigned i; diff --git a/src/mesa/main/remap.c b/src/mesa/main/remap.c index 2110140..c22c7a7 100644 --- a/src/mesa/main/remap.c +++ b/src/mesa/main/remap.c @@ -57,8 +57,7 @@ int driDispatchRemapTable[driDispatchRemapTable_size]; * and the dispatch offset will be returned. * * \param spec a '\0'-separated string array specifying a function. - * It begins with the parameter signature of the function, - * followed by the names of the entry points. An empty entry + * It consists of a list of gl* names followed by \0. An empty name * point name terminates the array. * * \return the offset of the (re-)mapped function in the dispatch @@ -67,16 +66,12 @@ int driDispatchRemapTable[driDispatchRemapTable_size]; static int map_function_spec(const char *spec) { - const char *signature; const char *names[MAX_ENTRY_POINTS + 1]; int num_names = 0; if (!spec) return -1; - signature = spec; - spec += strlen(spec) + 1; - /* spec is terminated by an empty string */ while (*spec) { names[num_names] = spec; @@ -91,7 +86,7 @@ map_function_spec(const char *spec) names[num_names] = NULL; /* add the entry points to the dispatch table */ - return _glapi_add_dispatch(names, signature); + return _glapi_add_dispatch(names); } @@ -113,18 +108,16 @@ _mesa_init_remap_table(void) /* initialize the MESA_remap_table_functions table */ for (i = 0; i < driDispatchRemapTable_size; i++) { int offset; - const char *spec; /* sanity check */ assert(i == MESA_remap_table_functions[i].remap_index); - spec = _mesa_function_pool + MESA_remap_table_functions[i].pool_index; + const char *spec = _mesa_function_pool + MESA_remap_table_functions[i].pool_index; offset = map_function_spec(spec); /* store the dispatch offset in the MESA_remap_table_functions table */ driDispatchRemapTable[i] = offset; if (offset < 0) { - const char *name = spec + strlen(spec) + 1; - _mesa_warning(NULL, "failed to remap %s", name); + _mesa_warning(NULL, "failed to remap %s", spec); } } } -- 2.7.4