mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-22 05:30:31 +01:00
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 <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33634>
This commit is contained in:
parent
3fc52ac0e0
commit
49facd7d54
5 changed files with 3 additions and 24 deletions
|
|
@ -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('')
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue