summaryrefslogtreecommitdiff
path: root/src/mesa/glapi/gl_apitemp.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/glapi/gl_apitemp.py')
-rw-r--r--src/mesa/glapi/gl_apitemp.py42
1 files changed, 34 insertions, 8 deletions
diff --git a/src/mesa/glapi/gl_apitemp.py b/src/mesa/glapi/gl_apitemp.py
index 7cc434fa89..30ee6596ed 100644
--- a/src/mesa/glapi/gl_apitemp.py
+++ b/src/mesa/glapi/gl_apitemp.py
@@ -39,6 +39,7 @@ class PrintGlOffsets(gl_XML.gl_print_base):
(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM")
self.undef_list.append( "KEYWORD1" )
+ self.undef_list.append( "KEYWORD1_ALT" )
self.undef_list.append( "KEYWORD2" )
self.undef_list.append( "NAME" )
self.undef_list.append( "DISPATCH" )
@@ -54,6 +55,13 @@ class PrintGlOffsets(gl_XML.gl_print_base):
t_string = ""
comma = ""
+ if f.static_dispatch:
+ n = name
+ keyword = "KEYWORD1"
+ else:
+ n = "_dispatch_stub_%u" % (f.offset)
+ keyword = "KEYWORD1_ALT"
+
for p in f.parameterIterator():
if p.is_pointer():
cast = "(const void *) "
@@ -71,8 +79,11 @@ class PrintGlOffsets(gl_XML.gl_print_base):
else:
dispatch = "DISPATCH"
- print 'KEYWORD1 %s KEYWORD2 NAME(%s)(%s)' \
- % (f.return_type, name, f.get_parameter_string(name))
+ if not f.static_dispatch:
+ print '%s %s KEYWORD2 NAME(%s)(%s);' % (keyword, f.return_type, n, f.get_parameter_string(name))
+ print ''
+
+ print '%s %s KEYWORD2 NAME(%s)(%s)' % (keyword, f.return_type, n, f.get_parameter_string(name))
print '{'
if p_string == "":
print ' %s(%s, (), (F, "gl%s();\\n"));' \
@@ -85,6 +96,8 @@ class PrintGlOffsets(gl_XML.gl_print_base):
return
def printRealHeader(self):
+ print ''
+ self.printVisibility( "HIDDEN", "hidden" )
print """
/*
* This file is a template which generates the OpenGL API entry point
@@ -116,6 +129,10 @@ class PrintGlOffsets(gl_XML.gl_print_base):
#define KEYWORD1
#endif
+#ifndef KEYWORD1_ALT
+#define KEYWORD1_ALT HIDDEN
+#endif
+
#ifndef KEYWORD2
#define KEYWORD2
#endif
@@ -149,7 +166,12 @@ class PrintGlOffsets(gl_XML.gl_print_base):
static _glapi_proc DISPATCH_TABLE_NAME[] = {"""
for f in api.functionIterateByOffset():
- print ' TABLE_ENTRY(%s),' % (f.name)
+ if f.static_dispatch:
+ n = f.name
+ else:
+ n = "_dispatch_stub_%u" % (f.offset)
+
+ print ' TABLE_ENTRY(%s),' % (n)
print ' /* A whole bunch of no-op functions. These might be called'
print ' * when someone tries to call a dynamically-registered'
@@ -174,9 +196,10 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {"""
static _glapi_proc UNUSED_TABLE_NAME[] = {"""
for f in api.functionIterateByOffset():
- for n in f.entry_points:
- if n != f.name:
- print ' TABLE_ENTRY(%s),' % (n)
+ if f.static_dispatch:
+ for n in f.entry_points:
+ if n != f.name:
+ print ' TABLE_ENTRY(%s),' % (n)
print '};'
print '#endif /*UNUSED_TABLE_NAME*/'
@@ -186,8 +209,11 @@ static _glapi_proc UNUSED_TABLE_NAME[] = {"""
def printBody(self, api):
for func in api.functionIterateByOffset():
- for n in func.entry_points:
- self.printFunction( func, n )
+ if func.static_dispatch:
+ for n in func.entry_points:
+ self.printFunction( func, n )
+ else:
+ self.printFunction(func, func.name)
self.printInitDispatch(api)
self.printAliasedTable(api)