Mesa (master): glapi: Don't emit remap data for individual extensions

Ian Romanick idr at kemper.freedesktop.org
Mon Sep 19 19:03:53 UTC 2011


Module: Mesa
Branch: master
Commit: c78baae79696b38622fa18fe9a0f2ad0ab361c1c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c78baae79696b38622fa18fe9a0f2ad0ab361c1c

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Tue Sep  6 13:02:13 2011 -0700

glapi: Don't emit remap data for individual extensions

All of the extensions actually supported by Mesa have been remapped by
remap.c for a long time.  Emitting all of these data structures is
just clutter.

Drivers that need additional functions remapped, should add
'offset="assign"' to the function definition in the .xml file.

The changes to remap_helper.h are in a follow-on ~8700 line patch that
would surely be rejected by the mailing list.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Chia-I Wu <olv at lunarg.com>

---

 src/mapi/glapi/gen/remap_helper.py |   43 ++++-------------------------------
 1 files changed, 5 insertions(+), 38 deletions(-)

diff --git a/src/mapi/glapi/gen/remap_helper.py b/src/mapi/glapi/gen/remap_helper.py
index 367ae24..0008634 100644
--- a/src/mapi/glapi/gen/remap_helper.py
+++ b/src/mapi/glapi/gen/remap_helper.py
@@ -74,7 +74,11 @@ class PrintGlRemap(gl_XML.gl_print_base):
 		pool_indices = {}
 
 		print '/* this is internal to remap.c */'
-		print '#ifdef need_MESA_remap_table'
+		print '#ifndef need_MESA_remap_table'
+		print '#error Only remap.c should include this file!'
+		print '#endif /* need_MESA_remap_table */'
+		print ''
+
 		print ''
 		print 'static const char _mesa_function_pool[] ='
 
@@ -156,43 +160,6 @@ class PrintGlRemap(gl_XML.gl_print_base):
 		print '   {    -1, -1 }'
 		print '};'
 		print ''
-
-		print '#endif /* need_MESA_remap_table */'
-		print ''
-
-		# output remap helpers for DRI drivers
-
-		for ext in extensions:
-			funcs = []
-			remapped = []
-			for f in extension_functions[ext]:
-				if f.assign_offset:
-					# these are handled above
-					remapped.append(f)
-				else:
-					# these functions are either in the
-					# abi, or have offset -1
-					funcs.append(f)
-
-			print '#if defined(need_%s)' % (ext)
-			if remapped:
-				print '/* functions defined in MESA_remap_table_functions are excluded */'
-
-			# output extension functions that need to be mapped
-			print 'static const struct gl_function_remap %s_functions[] = {' % (ext)
-			for f in funcs:
-				if f.offset >= 0:
-					print '   { %5d, _gloffset_%s },' \
-							% (pool_indices[f], f.name)
-				else:
-					print '   { %5d, -1 }, /* %s */' % \
-							(pool_indices[f], f.name)
-			print '   {    -1, -1 }'
-			print '};'
-
-			print '#endif'
-			print ''
-
 		return
 
 




More information about the mesa-commit mailing list