glapi: Add is_abi() to test if a function is in the ABI.
authorChia-I Wu <olvaffe@gmail.com>
Tue, 20 Oct 2009 06:32:39 +0000 (14:32 +0800)
committerBrian Paul <brianp@vmware.com>
Fri, 6 Nov 2009 03:04:10 +0000 (20:04 -0700)
The test is done by checking if the offset is manually assigned.  The
generated headers are unchanged.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
src/mesa/glapi/gl_XML.py
src/mesa/glapi/gl_offsets.py
src/mesa/glapi/gl_table.py
src/mesa/glapi/remap_helper.py

index b98919134fbb5c1a0a386caf59fae544a2336c29..bafb00306f8c8da9672e998054082c7cfd150036 100644 (file)
@@ -738,6 +738,9 @@ class gl_function( gl_item ):
                return p_string
 
 
+       def is_abi(self):
+               return (self.offset >= 0 and not self.assign_offset)
+
        def is_static_entry_point(self, name):
                return name in self.static_entry_points
 
index ca6c90ffd8e93d96acfcd60a911ddd4661b59418..b8b509d09fa8cc8a98d10e4394027990a66c36fb 100644 (file)
@@ -41,8 +41,6 @@ class PrintGlOffsets(gl_XML.gl_print_base):
                return
 
        def printBody(self, api):
-               abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ]
-
                print '/* this file should not be included directly in mesa */'
                print ''
 
@@ -50,8 +48,7 @@ class PrintGlOffsets(gl_XML.gl_print_base):
                abi_functions = []
                count = 0
                for f in api.functionIterateByOffset():
-                       [category, num] = api.get_category_for_name( f.name )
-                       if category not in abi:
+                       if not f.is_abi():
                                functions.append( [f, count] )
                                count += 1
                        else:
index 0e05b3431a17b76cb4d5061d668d821ceef95966..698795fb0ab45d08c65173a0cd90872856077707 100644 (file)
@@ -113,14 +113,11 @@ class PrintRemapTable(gl_XML.gl_print_base):
                print '    } while(0)'
                print ''
 
-               abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ]
-
                functions = []
                abi_functions = []
                count = 0
                for f in api.functionIterateByOffset():
-                       [category, num] = api.get_category_for_name( f.name )
-                       if category not in abi:
+                       if not f.is_abi():
                                functions.append( [f, count] )
                                count += 1
                        else:
index e47583a5d3fb76411773335cb2243e5655f92010..2a1f5adc32a8d041559f7820cd101dc9c6ae4118 100644 (file)
@@ -145,7 +145,7 @@ class PrintGlRemap(gl_XML.gl_print_base):
                        funcs = []
                        for f in extension_functions[ext]:
                                # test if the function is in the ABI
-                               if not f.assign_offset and f.offset >= 0:
+                               if f.is_abi():
                                        funcs.append(f)
                        if not funcs:
                                continue