From 49facd7d545a018661b9969ac66ca897c9cd400e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sat, 25 Jan 2025 16:23:16 -0500 Subject: [PATCH] glapi: remove support for dynamically-registered functions I think this was for when libglapi was older than DRI drivers and didn't know all functions. Reviewed-by: Adam Jackson Part-of: --- src/mapi/glapi/gen/gl_apitemp.py | 7 ------- src/mapi/mapi_abi.py | 9 +-------- src/mapi/new/genCommon.py | 2 -- src/mapi/new/gen_gldispatch_mapi.py | 7 +------ src/mapi/shared-glapi/table.h | 2 +- 5 files changed, 3 insertions(+), 24 deletions(-) diff --git a/src/mapi/glapi/gen/gl_apitemp.py b/src/mapi/glapi/gen/gl_apitemp.py index 8c4514c5824..97b376b13c7 100644 --- a/src/mapi/glapi/gen/gl_apitemp.py +++ b/src/mapi/glapi/gen/gl_apitemp.py @@ -195,13 +195,6 @@ _glapi_proc DISPATCH_TABLE_NAME[] = {""") for f in api.functionIterateByOffset(): print(' TABLE_ENTRY(%s),' % (f.dispatch_name())) - print(' /* A whole bunch of no-op functions. These might be called') - print(' * when someone tries to call a dynamically-registered') - print(' * extension function without a current rendering context.') - print(' */') - for i in range(1, 100): - print(' TABLE_ENTRY(Unused),') - print('};') print('#endif /* DISPATCH_TABLE_NAME */') print('') diff --git a/src/mapi/mapi_abi.py b/src/mapi/mapi_abi.py index 5d0ffe95408..78dfc46720b 100644 --- a/src/mapi/mapi_abi.py +++ b/src/mapi/mapi_abi.py @@ -37,9 +37,6 @@ import gl_XML import glX_XML -# number of dynamic entries -ABI_NUM_DYNAMIC_ENTRIES = 256 - class ABIEntry(object): """Represent an ABI entry.""" @@ -271,9 +268,7 @@ class ABIPrinter(object): def c_mapi_table(self): """Return defines of the dispatch table size.""" num_static_entries = self.entries[-1].slot + 1 - return ('#define MAPI_TABLE_NUM_STATIC %d\n' + \ - '#define MAPI_TABLE_NUM_DYNAMIC %d') % ( - num_static_entries, ABI_NUM_DYNAMIC_ENTRIES) + return '#define MAPI_TABLE_NUM_STATIC %d' % (num_static_entries) def _c_function(self, ent, prefix, mangle=False, stringify=False): """Return the function name of an entry.""" @@ -431,8 +426,6 @@ class ABIPrinter(object): if use_generic: entries = [self.noop_generic] * len(entries) - entries.extend([self.noop_generic] * ABI_NUM_DYNAMIC_ENTRIES) - pre = self.indent + '(mapi_func) ' return pre + (',\n' + pre).join(entries) diff --git a/src/mapi/new/genCommon.py b/src/mapi/new/genCommon.py index 5c6e8c93159..14a63bee23e 100644 --- a/src/mapi/new/genCommon.py +++ b/src/mapi/new/genCommon.py @@ -35,8 +35,6 @@ GLAPI = os.path.join(os.path.dirname(__file__), "..", "glapi", "gen") sys.path.insert(0, GLAPI) import static_data -MAPI_TABLE_NUM_DYNAMIC = 4096 - _LIBRARY_FEATURE_NAMES = { # libGL and libGLdiapatch both include every function. "gl" : None, diff --git a/src/mapi/new/gen_gldispatch_mapi.py b/src/mapi/new/gen_gldispatch_mapi.py index c3b577a5565..69f1ee3be04 100755 --- a/src/mapi/new/gen_gldispatch_mapi.py +++ b/src/mapi/new/gen_gldispatch_mapi.py @@ -86,7 +86,6 @@ def generate_defines(functions): def generate_table(functions, allFunctions): text = "#ifdef MAPI_TMP_TABLE\n" text += "#define MAPI_TABLE_NUM_STATIC %d\n" % (len(allFunctions)) - text += "#define MAPI_TABLE_NUM_DYNAMIC %d\n" % (genCommon.MAPI_TABLE_NUM_DYNAMIC,) text += "#undef MAPI_TMP_TABLE\n" text += "#endif /* MAPI_TMP_TABLE */\n" return text @@ -111,15 +110,11 @@ def generate_noop_array(functions): text += "const mapi_func table_noop_array[] = {\n" for func in functions: text += " (mapi_func) noop{f.basename},\n".format(f=func) - for i in range(genCommon.MAPI_TABLE_NUM_DYNAMIC - 1): - text += " (mapi_func) noop_generic,\n" - text += " (mapi_func) noop_generic\n" text += "};\n\n" text += "#else /* !MESA_DEBUG */\n\n" text += "const mapi_func table_noop_array[] = {\n" - for i in range(len(functions) + genCommon.MAPI_TABLE_NUM_DYNAMIC - 1): + for i in range(len(functions)): text += " (mapi_func) noop_generic,\n" - text += " (mapi_func) noop_generic\n" text += "};\n\n" text += "#endif /* MESA_DEBUG */\n" diff --git a/src/mapi/shared-glapi/table.h b/src/mapi/shared-glapi/table.h index 7c57f690ac0..d97bc45b10d 100644 --- a/src/mapi/shared-glapi/table.h +++ b/src/mapi/shared-glapi/table.h @@ -33,7 +33,7 @@ #define MAPI_TMP_TABLE #include "mapi_tmp.h" -#define MAPI_TABLE_NUM_SLOTS (MAPI_TABLE_NUM_STATIC + MAPI_TABLE_NUM_DYNAMIC) +#define MAPI_TABLE_NUM_SLOTS MAPI_TABLE_NUM_STATIC struct _glapi_table;