Mesa (master): glapi: Remove handling of mesa_name XML attribute.

Paul Berry stereotype441 at kemper.freedesktop.org
Mon Nov 12 18:55:05 UTC 2012


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

Author: Paul Berry <stereotype441 at gmail.com>
Date:   Wed Nov  7 09:29:20 2012 -0800

glapi: Remove handling of mesa_name XML attribute.

Previously, we used the mesa_name XML attribute to make the code
generation scripts aware of any instances where the Mesa
implementation of a function had a different function name suffix than
the primary name in the XML.  Now that all of the Mesa implementation
functions have been renamed to match the XML, this attribute is no
longer necessary.

Acked-by: Brian Paul <brianp at vmware.com>

---

 src/mapi/glapi/gen/gl_API.dtd    |    3 +-
 src/mapi/glapi/gen/gl_XML.py     |   52 +------------------------------------
 src/mapi/glapi/gen/gl_genexec.py |    2 +-
 3 files changed, 4 insertions(+), 53 deletions(-)

diff --git a/src/mapi/glapi/gen/gl_API.dtd b/src/mapi/glapi/gen/gl_API.dtd
index 066d5da..ab321fa 100644
--- a/src/mapi/glapi/gen/gl_API.dtd
+++ b/src/mapi/glapi/gen/gl_API.dtd
@@ -40,8 +40,7 @@
                    es2                 CDATA   "none"
                    deprecated          CDATA   "none"
                    exec                NMTOKEN #IMPLIED
-                   desktop             (true | false) "true"
-                   mesa_name           CDATA   #IMPLIED>
+                   desktop             (true | false) "true">
 <!ATTLIST size     name                NMTOKEN #REQUIRED
                    count               NMTOKEN #IMPLIED
                    mode                (get | set) "set">
diff --git a/src/mapi/glapi/gen/gl_XML.py b/src/mapi/glapi/gen/gl_XML.py
index 47f8dd5..227e9fc 100644
--- a/src/mapi/glapi/gen/gl_XML.py
+++ b/src/mapi/glapi/gen/gl_XML.py
@@ -594,47 +594,6 @@ class gl_parameter(object):
             return self.type_expr.format_string()
 
 
-# Regular expression used to parse "mesa_name" attributes.  A
-# mesa_name attribute describes how to adjust a GL function name
-# suffix to obtain the name of the function in Mesa that implements
-# the functionality.  The attribute string consists of a part preceded
-# by a "-", indicating the suffix to remove, and a part preceded by a
-# "+" indicating the suffix to add.  Either part is optional.
-#
-# For example:
-#
-#   <function name="EnableIndexedEXT" mesa_name="-EXT">...</function>
-#   <function name="IsProgramNV" mesa_name="-NV+ARB">...</function>
-#
-# means that EnableIndexedEXT is implemented by a Mesa function called
-# _mesa_EnableIndexed, and IsProgramNV is implemented by a Mesa function
-# called _mesa_IsProgramARB.
-#
-# Note: the prefix "_mesa_" is handled separately, by the "exec"
-# attribute.
-name_modification_regexp = re.compile(
-    r'^(-(?P<minus>[a-zA-Z0-9_]+))?(\+(?P<plus>[a-zA-Z0-9_]+))?$')
-
-
-# Interpret a "mesa_name" attribute (see above) to determine the
-# appropriate suffix for the Mesa function implementing a piece of GL
-# functionality, and return the properly suffixed name.
-def interpret_name_modification(name, mod):
-    m = name_modification_regexp.match(mod)
-    if m is None:
-        raise Exception('Unintelligible mesa_name property: {0!r}'.format(mod))
-    new_name = name
-    if m.group('minus'):
-        if not new_name.endswith(m.group('minus')):
-            raise Exception(
-                'Cannot subtract suffix {0!r} from function {1}'.format(
-                    m.group('minus'), name))
-        new_name = new_name[:-len(m.group('minus'))]
-    if m.group('plus'):
-        new_name += m.group('plus')
-    return new_name
-
-
 class gl_function( gl_item ):
     def __init__(self, element, context):
         self.context = context
@@ -649,7 +608,6 @@ class gl_function( gl_item ):
         self.exec_flavor = 'mesa'
         self.desktop = True
         self.deprecated = None
-        self.mesa_name = None
 
         # self.entry_point_api_map[name][api] is a decimal value
         # indicating the earliest version of the given API in which
@@ -725,8 +683,8 @@ class gl_function( gl_item ):
         else:
             true_name = name
 
-            # Only try to set the offset and mesa_name when a
-            # non-alias entry-point is being processed.
+            # Only try to set the offset when a non-alias entry-point
+            # is being processed.
 
             offset = element.nsProp( "offset", None )
             if offset:
@@ -738,12 +696,6 @@ class gl_function( gl_item ):
                     if offset == "assign":
                         self.assign_offset = 1
 
-            mesa_name = element.nsProp('mesa_name', None)
-            if mesa_name is None:
-                self.mesa_name = name
-            else:
-                self.mesa_name = interpret_name_modification(name, mesa_name)
-
 
         if not self.name:
             self.name = true_name
diff --git a/src/mapi/glapi/gen/gl_genexec.py b/src/mapi/glapi/gen/gl_genexec.py
index adfa595..ee36bee 100644
--- a/src/mapi/glapi/gen/gl_genexec.py
+++ b/src/mapi/glapi/gen/gl_genexec.py
@@ -189,7 +189,7 @@ class PrintCode(gl_XML.gl_print_base):
                 # dynamically.
                 continue
             settings_by_condition[condition].append(
-                'SET_{0}(exec, {1}{2});'.format(f.name, prefix, f.mesa_name))
+                'SET_{0}(exec, {1}{0});'.format(f.name, prefix, f.name))
         # Print out an if statement for each unique condition, with
         # the SET_* calls nested inside it.
         for condition in sorted(settings_by_condition.keys()):




More information about the mesa-commit mailing list