From a91c541c5bbb249b95433c67024f643151afb5ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sun, 9 Mar 2025 15:44:38 -0400 Subject: [PATCH] glapi: remove noop_generic callbacks There are named and generic noop callbacks. The named ones can print the GL function being called, while the generic ones can't. Remove the generic ones. Reviewed-by: Adam Jackson Part-of: --- src/mapi/mapi_abi.py | 18 +++--------------- src/mapi/new/gen_gldispatch_mapi.py | 10 +--------- src/mapi/shared-glapi/core.c | 7 ------- 3 files changed, 4 insertions(+), 31 deletions(-) diff --git a/src/mapi/mapi_abi.py b/src/mapi/mapi_abi.py index c7232a487ed..7a1d984d428 100644 --- a/src/mapi/mapi_abi.py +++ b/src/mapi/mapi_abi.py @@ -368,13 +368,9 @@ class ABIPrinter(object): return '\n\n'.join(noops) - def c_noop_initializer(self, use_generic): + def c_noop_initializer(self): """Return an initializer for the noop dispatch table.""" - entries = [self._c_function(ent, 'noop') - for ent in self.entries if not ent.alias] - if use_generic: - entries = ['noop_generic'] * len(entries) - + entries = [self._c_function(ent, 'noop') for ent in self.entries if not ent.alias] pre = self.indent + '(_glapi_proc) ' return pre + (',\n' + pre).join(entries) @@ -430,21 +426,13 @@ class ABIPrinter(object): if self.is_shared: print() print('#ifdef MAPI_TMP_NOOP_ARRAY') - print('#if MESA_DEBUG') print() print(self.c_noop_functions()) print() print('const _glapi_proc table_noop_array[] = {') - print(self.c_noop_initializer(False)) + print(self.c_noop_initializer()) print('};') print() - print('#else /* !MESA_DEBUG */') - print() - print('const _glapi_proc table_noop_array[] = {') - print(self.c_noop_initializer(True)) - print('};') - print() - print('#endif /* MESA_DEBUG */') print('#undef MAPI_TMP_NOOP_ARRAY') print('#endif /* MAPI_TMP_NOOP_ARRAY */') diff --git a/src/mapi/new/gen_gldispatch_mapi.py b/src/mapi/new/gen_gldispatch_mapi.py index fbd266fe0c0..4b950ee7c73 100755 --- a/src/mapi/new/gen_gldispatch_mapi.py +++ b/src/mapi/new/gen_gldispatch_mapi.py @@ -77,8 +77,7 @@ def generate_defines(functions): return text def generate_noop_array(functions): - text = "#ifdef MAPI_TMP_NOOP_ARRAY\n" - text += "#if MESA_DEBUG\n\n" + text = "#ifdef MAPI_TMP_NOOP_ARRAY\n\n" for func in functions: text += "static {f.rt} GLAPIENTRY noop{f.basename}({f.decArgs})\n".format(f=func) @@ -97,13 +96,6 @@ def generate_noop_array(functions): for func in functions: text += " (_glapi_proc) noop{f.basename},\n".format(f=func) text += "};\n\n" - text += "#else /* !MESA_DEBUG */\n\n" - text += "const _glapi_proc table_noop_array[] = {\n" - for i in range(len(functions)): - text += " (_glapi_proc) noop_generic,\n" - - text += "};\n\n" - text += "#endif /* MESA_DEBUG */\n" text += "#undef MAPI_TMP_NOOP_ARRAY\n" text += "#endif /* MAPI_TMP_NOOP_ARRAY */\n" return text diff --git a/src/mapi/shared-glapi/core.c b/src/mapi/shared-glapi/core.c index 1bbf64fda06..d00d02c67c0 100644 --- a/src/mapi/shared-glapi/core.c +++ b/src/mapi/shared-glapi/core.c @@ -38,13 +38,6 @@ noop_warn(const char *name) } } -static int -noop_generic(void) -{ - noop_warn("function"); - return 0; -} - #define MAPI_TMP_NOOP_ARRAY #define MAPI_TMP_PUBLIC_STUBS