diff options
Diffstat (limited to 'src/mesa/glapi/gl_procs.py')
-rw-r--r-- | src/mesa/glapi/gl_procs.py | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/mesa/glapi/gl_procs.py b/src/mesa/glapi/gl_procs.py index 76131b83a0b..145243ee0e9 100644 --- a/src/mesa/glapi/gl_procs.py +++ b/src/mesa/glapi/gl_procs.py @@ -87,8 +87,13 @@ class PrintGlProcs(gl_XML.gl_print_base): base_offset = 0 table = [] for func in api.functionIterateByOffset(): + if func.static_dispatch: + name = func.name + else: + name = "_dispatch_stub_%u" % (func.offset) + self.printFunctionString( func.name ) - table.append((base_offset, func.name, func.name)) + table.append((base_offset, name, func.name)) # The length of the function's name, plus 2 for "gl", # plus 1 for the NUL. @@ -99,8 +104,13 @@ class PrintGlProcs(gl_XML.gl_print_base): for func in api.functionIterateByOffset(): for n in func.entry_points: if n != func.name: + if func.static_dispatch: + name = n + else: + name = "_dispatch_stub_%u" % (func.offset) + self.printFunctionString( n ) - table.append((base_offset, n, func.name)) + table.append((base_offset, name, func.name)) base_offset += len(n) + 3 @@ -110,6 +120,14 @@ class PrintGlProcs(gl_XML.gl_print_base): print '};' print '' + print '/* FIXME: Having these (incorrect) prototypes here is ugly. */' + print '#ifdef NEED_FUNCTION_POINTER' + for func in api.functionIterateByOffset(): + if not func.static_dispatch: + print 'extern void gl_dispatch_stub_%u(void);' % (func.offset) + print '#endif /* NEED_FUNCTION_POINTER */' + + print '' print 'static const glprocs_table_t static_functions[] = {' for (offset, disp_name, real_name) in table: |