[Mesa-dev] [PATCH 10/17] glapi: Annotate XML with function name suffix anomalies.

Kenneth Graunke kenneth at whitecape.org
Fri Nov 2 18:52:27 PDT 2012


On 11/02/2012 05:13 PM, Ian Romanick wrote:
> On 11/02/2012 03:01 PM, Paul Berry wrote:
>> On 2 November 2012 14:11, Ian Romanick <idr at freedesktop.org
>> <mailto:idr at freedesktop.org>> wrote:
>>
>>     On 11/01/2012 03:19 PM, Paul Berry wrote:
>>
>>         When the XML lists one or more GL api functions as aliases for
>>         another
>>         GL function, the mesa function that implements the
>> functionality is
>>         usually named after the canonical version of the function (the
>> one
>>         that is the target of the aliases).  For example, FogCoordd is
>>         listed
>>         as an alias of FogCoorddEXT, and the Mesa function
>> implementing the
>>         functionality is called loopback_FogCoorddEXT.
>>
>>         However, there are exceptions.  For example, Enablei is listed
>> as an
>>         alias of EnableIndexedEXT, but the Mesa function implementing the
>>         functionality is called _mesa_EnableIndexed.
>>
>>         To account for these anomalies, this patch annotates the XML with
>>         "mesa_name" attributes, which describe how to adjust the
>>         function name
>>         to find the corresponding Mesa function.
>>
>>         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.
>>
>>
>>     Oh yuck!  Why not just fix the names of the Mesa functions?  That
>>     seems much better than carrying the work-around in the code
>>     generator forever.
>>
>>
>> The reason I shied away from this approach is that there are a lot of
>> functions to fix (146 of them by my count), and I was worried it would
>> take a very long time to rename all references to them.
>
> That many?  Ugh.  Is it possible to switch the aliasing order?  For the
> IsProgram case, IsProgramNV would alias IsProgramARB (instead of the
> other way around).  Is that better or worse?
>
>> But I didn't actually try it.  I'll try spending a few hours on it and
>> see how far I get.

FWIW, I would like to see Mesa use the core names.  IsProgramNV is 
particularly odd because we don't support the extension it came 
from...the name IsProgramARB makes a lot more sense.

Doing it now could make sense...having the name-replacer stuff in the 
XML and code generation does seem ugly.  But yeah, 146 functions is 
quite a lot, so I'll defer to your judgment.

--Ken


More information about the mesa-dev mailing list