diff options
author | Ian Romanick <[email protected]> | 2006-08-22 16:34:38 +0000 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2006-08-22 16:34:38 +0000 |
commit | 4e4b5f40081cb3e4cefe4dce30712d8d330c0774 (patch) | |
tree | 65b722305bb81a0c014903d20cf7d3715fbde83f /src/mesa/glapi/gl_x86_asm.py | |
parent | 6423ec914530a84ee16977d95b64116e63eca22c (diff) |
Add new attribute called static_dispatch to the <function> element. This
boolean attribute, which defaults to true, determines whether or not a
static dispatch function is available in libGL for applications to link
against.
Ideally, any new functions that are not part of the ABI should not have
directly accessable dispatch functions. This forces applications to use
glXGetProcAddress to access these functions. By doing this we can
gracefully remove functions from libGL without breaking the linkage of
applications.
Note that the static dispatch functions are still generated. However, they
are given names like gl_dispatch_stub_820 and are marked with the "hidden"
linker attribute.
All extension functions added since the previous Mesa release (6.5) have
been marked as 'static_dispatch="false"'.
Diffstat (limited to 'src/mesa/glapi/gl_x86_asm.py')
-rw-r--r-- | src/mesa/glapi/gl_x86_asm.py | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/mesa/glapi/gl_x86_asm.py b/src/mesa/glapi/gl_x86_asm.py index 899cce64b99..3ce8404f8c9 100644 --- a/src/mesa/glapi/gl_x86_asm.py +++ b/src/mesa/glapi/gl_x86_asm.py @@ -197,20 +197,35 @@ class PrintGenericStubs(gl_XML.gl_print_base): def printBody(self, api): for f in api.functionIterateByOffset(): + if f.static_dispatch: + name = f.name + else: + name = "_dispatch_stub_%u" % (f.offset) + stack = self.get_stack_size(f) - alt = "%s@%u" % (f.name, stack) - print '\tGL_STUB(%s, _gloffset_%s, %s)' % (f.name, f.name, alt) + alt = "%s@%u" % (name, stack) + print '\tGL_STUB(%s, _gloffset_%s, %s)' % (name, f.name, alt) + + if not f.static_dispatch: + print '\tHIDDEN(GL_PREFIX(%s, %s))' % (name, alt) + for f in api.functionIterateByOffset(): + if f.static_dispatch: + name = f.name + else: + name = "_dispatch_stub_%u" % (f.offset) + stack = self.get_stack_size(f) - alt = "%s@%u" % (f.name, stack) + alt = "%s@%u" % (name, stack) - for n in f.entry_points: - if n != f.name: - alt2 = "%s@%u" % (n, stack) - print '\tGL_STUB_ALIAS(%s, _gloffset_%s, %s, %s, %s)' % (n, f.name, alt2, f.name, alt) + if f.static_dispatch: + for n in f.entry_points: + if n != f.name: + alt2 = "%s@%u" % (n, stack) + print '\tGL_STUB_ALIAS(%s, _gloffset_%s, %s, %s, %s)' % (n, f.name, alt2, f.name, alt) return |