aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/glapi/gen
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/glapi/gen')
-rw-r--r--src/mesa/glapi/gen/Makefile6
-rw-r--r--src/mesa/glapi/gen/gl_enums.py26
-rw-r--r--src/mesa/glapi/gen/remap_helper.py12
3 files changed, 21 insertions, 23 deletions
diff --git a/src/mesa/glapi/gen/Makefile b/src/mesa/glapi/gen/Makefile
index 84600bdd980..10998b2ce23 100644
--- a/src/mesa/glapi/gen/Makefile
+++ b/src/mesa/glapi/gen/Makefile
@@ -151,8 +151,10 @@ $(MESA_DIR)/sparc/glapi_sparc.S: gl_SPARC_asm.py $(COMMON)
######################################################################
-$(MESA_DIR)/main/enums.c: gl_enums.py $(COMMON)
- $(PYTHON2) $(PYTHON_FLAGS) $< > $@
+$(MESA_DIR)/main/enums.c: gl_enums.py $(COMMON) $(ES_API)
+ $(PYTHON2) $(PYTHON_FLAGS) $< -f gl_API.xml \
+ -f $(MESA_DIR)/es/glapi/es1_API.xml \
+ -f $(MESA_DIR)/es/glapi/es2_API.xml > $@
$(MESA_DIR)/main/remap_helper.h: remap_helper.py $(COMMON)
$(PYTHON2) $(PYTHON_FLAGS) $< > $@
diff --git a/src/mesa/glapi/gen/gl_enums.py b/src/mesa/glapi/gen/gl_enums.py
index 3a9ea3c86c7..644e0855229 100644
--- a/src/mesa/glapi/gen/gl_enums.py
+++ b/src/mesa/glapi/gen/gl_enums.py
@@ -151,8 +151,10 @@ int _mesa_lookup_enum_by_name( const char *symbol )
return
- def printBody(self, api):
- self.process_enums( api )
+ def printBody(self, api_list):
+ self.enum_table = {}
+ for api in api_list:
+ self.process_enums( api )
keys = self.enum_table.keys()
keys.sort()
@@ -209,16 +211,20 @@ int _mesa_lookup_enum_by_name( const char *symbol )
def process_enums(self, api):
- self.enum_table = {}
-
for obj in api.enumIterateByName():
if obj.value not in self.enum_table:
self.enum_table[ obj.value ] = []
+ enum = self.enum_table[ obj.value ]
name = "GL_" + obj.name
priority = obj.priority()
- self.enum_table[ obj.value ].append( [name, priority] )
+ already_in = False;
+ for n, p in enum:
+ if n == name:
+ already_in = True
+ if not already_in:
+ enum.append( [name, priority] )
def show_usage():
@@ -226,18 +232,16 @@ def show_usage():
sys.exit(1)
if __name__ == '__main__':
- file_name = "gl_API.xml"
-
try:
(args, trail) = getopt.getopt(sys.argv[1:], "f:")
except Exception,e:
show_usage()
+ api_list = []
for (arg,val) in args:
if arg == "-f":
- file_name = val
-
- api = gl_XML.parse_GL_API( file_name )
+ api = gl_XML.parse_GL_API( val )
+ api_list.append(api);
printer = PrintGlEnums()
- printer.Print( api )
+ printer.Print( api_list )
diff --git a/src/mesa/glapi/gen/remap_helper.py b/src/mesa/glapi/gen/remap_helper.py
index 8b50526d2b0..69b8e5e9d02 100644
--- a/src/mesa/glapi/gen/remap_helper.py
+++ b/src/mesa/glapi/gen/remap_helper.py
@@ -65,17 +65,12 @@ class PrintGlRemap(gl_XML.gl_print_base):
def printRealHeader(self):
print '#include "main/dispatch.h"'
+ print '#include "main/remap.h"'
print ''
return
def printBody(self, api):
- print 'struct gl_function_remap {'
- print ' GLint func_index;'
- print ' GLint dispatch_offset; /* for sanity check */'
- print '};'
- print ''
-
pool_indices = {}
print '/* this is internal to remap.c */'
@@ -108,10 +103,7 @@ class PrintGlRemap(gl_XML.gl_print_base):
print ''
print '/* these functions need to be remapped */'
- print 'static const struct {'
- print ' GLint pool_index;'
- print ' GLint remap_index;'
- print '} MESA_remap_table_functions[] = {'
+ print 'static const struct gl_function_pool_remap MESA_remap_table_functions[] = {'
# output all functions that need to be remapped
# iterate by offsets so that they are sorted by remap indices
for f in api.functionIterateByOffset():