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 <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34002>
This commit is contained in:
Marek Olšák 2025-03-09 15:44:38 -04:00 committed by Marge Bot
parent 1f56a1ac37
commit a91c541c5b
3 changed files with 4 additions and 31 deletions

View file

@ -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 */')

View file

@ -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

View file

@ -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