Mesa (master): glapi/gen: Gather API version info across aliased functions.
Paul Berry
stereotype441 at kemper.freedesktop.org
Tue Nov 6 21:02:39 UTC 2012
Module: Mesa
Branch: master
Commit: 91b5a741f6788412799324ca11ff28f0d6afa066
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=91b5a741f6788412799324ca11ff28f0d6afa066
Author: Paul Berry <stereotype441 at gmail.com>
Date: Tue Oct 30 16:21:18 2012 -0700
glapi/gen: Gather API version info across aliased functions.
gl_XML.py's gl_function class keeps track of an entry_point_api_map
property that tracks, for each set of aliased functions, which ES1 or
ES2 version the given function name first appeared in.
This patch aggregates that information together across aliased
functions, into an easier-to-use api_map property.
Future patches will use this information when code generating
_mesa_create_exec_table(), to determine which set of dispatch table
entries should be populated based on the API.
Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
Reviewed-by: Matt Turner <mattst88 at gmail.com>
---
src/mapi/glapi/gen/gl_XML.py | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/src/mapi/glapi/gen/gl_XML.py b/src/mapi/glapi/gen/gl_XML.py
index a8000b4..92bbb86 100644
--- a/src/mapi/glapi/gen/gl_XML.py
+++ b/src/mapi/glapi/gen/gl_XML.py
@@ -617,6 +617,14 @@ class gl_function( gl_item ):
# Decimal('1.1') }.
self.entry_point_api_map = {}
+ # self.api_map[api] is a decimal value indicating the earliest
+ # version of the given API in which ANY alias for the function
+ # exists. The map only lists APIs which contain the function
+ # in at least one version. For example, for the ClipPlanex
+ # function, self.entry_point_api_map == { 'es1':
+ # Decimal('1.1') }.
+ self.api_map = {}
+
self.assign_offset = 0
self.static_entry_points = []
@@ -651,7 +659,11 @@ class gl_function( gl_item ):
version_str = element.nsProp(api, None)
assert version_str is not None
if version_str != 'none':
- self.entry_point_api_map[name][api] = Decimal(version_str)
+ version_decimal = Decimal(version_str)
+ self.entry_point_api_map[name][api] = version_decimal
+ if api not in self.api_map or \
+ version_decimal < self.api_map[api]:
+ self.api_map[api] = version_decimal
if alias:
true_name = alias
More information about the mesa-commit
mailing list