summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmil Velikov <emil.velikov@collabora.com>2019-06-05 16:45:03 +0100
committerDylan Baker <dylan@pnwbakers.com>2019-06-20 10:32:11 -0700
commit8066847b8ef39169e59890691a38efdd9c60a7ed (patch)
treea9227a7cc1035798bfc90c77233a80e22d99e427
parenta4f5616c60f02a8f05295abc5702b056063a96c8 (diff)
downloadmesa-8066847b8ef39169e59890691a38efdd9c60a7ed.tar.gz
mapi: correctly handle the full offset table
Earlier commit converted ES1 and ES2 to a new, much simpler, dispatch generator. At the same time, GL/glapi and the driver side are still using the old code. There is a hidden ABI between GL*.so and glapi.so, former referencing entry-points by offset in the _glapi_table. Hence earlier commit added the full table of entry-points, alongside a marker for other cases like indirect GL(X) and driver-size remapping. Yet the patches did not handle things fully, thus it was possible to get different interpretations of the dispatch table after the marker. This commit fixes that adding an indicative error message to catch future bugs. While here correct the marker (MAX_OFFSETS) comment. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110302 Fixes: cf317bf0937 ("mapi: add all _glapi_table entrypoints tostatic_data.py") Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit a379b1c0ee31a792bba250cc466ad4b161a610ec)
-rw-r--r--src/mapi/glapi/gen/gl_XML.py8
-rw-r--r--src/mapi/glapi/gen/static_data.py2
2 files changed, 7 insertions, 3 deletions
diff --git a/src/mapi/glapi/gen/gl_XML.py b/src/mapi/glapi/gen/gl_XML.py
index 478f82ca314..2854a9a5688 100644
--- a/src/mapi/glapi/gen/gl_XML.py
+++ b/src/mapi/glapi/gen/gl_XML.py
@@ -49,7 +49,7 @@ def parse_GL_API( file_name, factory = None ):
# that are not part of the ABI.
for func in api.functionIterateByCategory():
- if func.assign_offset:
+ if func.assign_offset and func.offset < 0:
func.offset = api.next_offset;
api.next_offset += 1
@@ -683,8 +683,12 @@ class gl_function( gl_item ):
if name in static_data.offsets and static_data.offsets[name] <= static_data.MAX_OFFSETS:
self.offset = static_data.offsets[name]
+ elif name in static_data.offsets and static_data.offsets[name] > static_data.MAX_OFFSETS:
+ self.offset = static_data.offsets[name]
+ self.assign_offset = True
else:
- self.offset = -1
+ if self.exec_flavor != "skip":
+ raise RuntimeError("Entry-point %s is missing offset in static_data.py. Add one at the bottom of the list." % (name))
self.assign_offset = self.exec_flavor != "skip" or name in static_data.unused_functions
if not self.name:
diff --git a/src/mapi/glapi/gen/static_data.py b/src/mapi/glapi/gen/static_data.py
index bc49324348f..5357bd30edc 100644
--- a/src/mapi/glapi/gen/static_data.py
+++ b/src/mapi/glapi/gen/static_data.py
@@ -29,7 +29,7 @@ MAX_OFFSETS = 407
"""Table of functions that have ABI-mandated offsets in the dispatch table.
The first MAX_OFFSETS entries are required by indirect GLX. The rest are
-required to preserve the glapi <> drivers ABI. This is to be addressed shortly.
+required to preserve the glapi <> GL/GLES ABI. This is to be addressed shortly.
This list will never change."""
offsets = {