[Mesa-dev] [PATCH 02/18] HACK: glapi: print _glapi_table offsets to a file

Emil Velikov emil.l.velikov at gmail.com
Wed Nov 21 12:03:59 UTC 2018


From: Emil Velikov <emil.velikov at collabora.com>

We'll need those in static_data.py
---
 src/mapi/glapi/gen/gl_table.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/mapi/glapi/gen/gl_table.py b/src/mapi/glapi/gen/gl_table.py
index 4b89ef8a856..72ad9426f95 100644
--- a/src/mapi/glapi/gen/gl_table.py
+++ b/src/mapi/glapi/gen/gl_table.py
@@ -45,10 +45,12 @@ class PrintGlTable(gl_XML.gl_print_base):
         return
 
     def printBody(self, api):
-        for f in api.functionIterateByOffset():
-            arg_string = f.get_parameter_string()
-            print('   %s (GLAPIENTRYP %s)(%s); /* %d */' % (
-                f.return_type, f.name, arg_string, f.offset))
+        with open('/tmp/dispatch', 'w') as ff:
+            for f in api.functionIterateByOffset():
+                arg_string = f.get_parameter_string()
+                print('    "%s": %d,' % (f.name, f.offset), file=ff)
+                print('   %s (GLAPIENTRYP %s)(%s); /* %d */' % (
+                    f.return_type, f.name, arg_string, f.offset))
 
     def printRealHeader(self):
         print('#ifndef GLAPIENTRYP')
-- 
2.19.1



More information about the mesa-dev mailing list