From 4e4b5f40081cb3e4cefe4dce30712d8d330c0774 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 22 Aug 2006 16:34:38 +0000 Subject: Add new attribute called static_dispatch to the 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"'. --- src/mesa/glapi/gl_SPARC_asm.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'src/mesa/glapi/gl_SPARC_asm.py') diff --git a/src/mesa/glapi/gl_SPARC_asm.py b/src/mesa/glapi/gl_SPARC_asm.py index 1a8823cc405..1368e24a087 100644 --- a/src/mesa/glapi/gl_SPARC_asm.py +++ b/src/mesa/glapi/gl_SPARC_asm.py @@ -82,14 +82,24 @@ 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.static_dispatch: + 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.static_dispatch: + 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' @@ -98,9 +108,10 @@ class PrintGenericStubs(gl_XML.gl_print_base): 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.static_dispatch: + 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) return -- cgit v1.2.3