# Authors:
# Ian Romanick <idr@us.ibm.com>
-import gl_XML, license
+import license
+import gl_XML, glX_XML
import sys, getopt
class PrintGenericStubs(gl_XML.gl_print_base):
def printBody(self, api):
for f in api.functionIterateByOffset():
- print '\t\t.globl gl%s ; .type gl%s,#function' % (f.name, f.name)
+ if f.is_static_entry_point(f.name):
+ name = f.name
+ else:
+ name = "_dispatch_stub_%u" % (f.offset)
+
+ print '\t\t.globl gl%s ; .type gl%s,#function' % (name, name)
print '\t\t.globl _mesa_sparc_glapi_begin ; .type _mesa_sparc_glapi_begin,#function'
print '_mesa_sparc_glapi_begin:'
print ''
for f in api.functionIterateByOffset():
- print '\tGL_STUB(gl%s, _gloffset_%s)' % (f.name, f.name)
+ if f.is_static_entry_point(f.name):
+ name = f.name
+ else:
+ name = "_dispatch_stub_%u" % (f.offset)
+
+ print '\tGL_STUB(gl%s, _gloffset_%s)' % (name, name)
print ''
print '\t\t.globl _mesa_sparc_glapi_end ; .type _mesa_sparc_glapi_end,#function'
for f in api.functionIterateByOffset():
for n in f.entry_points:
if n != f.name:
- print '\t.globl gl%s ; .type gl%s,#function ; gl%s = gl%s' % (n, n, n, f.name)
+ if f.is_static_entry_point(n):
+ text = '\t.globl gl%s ; .type gl%s,#function ; gl%s = gl%s' % (n, n, n, f.name)
+
+ if f.has_different_protocol(n):
+ print '#ifndef GLX_INDIRECT_RENDERING'
+ print text
+ print '#endif'
+ else:
+ print text
return
print "ERROR: Invalid mode \"%s\" specified." % mode
show_usage()
- api = gl_XML.parse_GL_API( file_name )
-
- printer.Print( api )
+ api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory())
+ printer.Print(api)