[Mesa-dev] [PATCH v2 6/14] anv: convert header generation in anv_entrypoints_gen.py to mako

Emil Velikov emil.l.velikov at gmail.com
Fri Feb 24 13:57:24 UTC 2017


On 24 February 2017 at 10:28, Eric Engestrom <eric.engestrom at imgtec.com> wrote:
> On Thursday, 2017-02-23 10:46:19 -0800, Dylan Baker wrote:
>> This produces an identical file except for whitespace.
>>
>> Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
>> ---
>>  src/intel/vulkan/anv_entrypoints_gen.py | 75 ++++++++++++++------------
>>  1 file changed, 41 insertions(+), 34 deletions(-)
>>
>> diff --git a/src/intel/vulkan/anv_entrypoints_gen.py b/src/intel/vulkan/anv_entrypoints_gen.py
>> index 772f3e6..7493fb6 100644
>> --- a/src/intel/vulkan/anv_entrypoints_gen.py
>> +++ b/src/intel/vulkan/anv_entrypoints_gen.py
>> @@ -26,6 +26,8 @@ import argparse
>>  import textwrap
>>  import xml.etree.ElementTree as et
>>
>> +from mako.template import Template
>> +
>>  MAX_API_VERSION = 1.0
>>
>>  SUPPORTED_EXTENSIONS = [
>> @@ -45,6 +47,44 @@ SUPPORTED_EXTENSIONS = [
>>  # function and a power-of-two size table. The prime numbers are determined
>>  # experimentally.
>>
>> +TEMPLATE_H = Template(textwrap.dedent("""\
>> +    /* This file generated from vk_gen.py, don't edit directly. */
>
> s/vk_gen.py/anv_entrypoints_gen.py/ :)
>
This seems to be rather common across projects. Just an idea -
sys.argv[0] should work right ?

IMHO, feel free to address that whenever you prefer.
Emil


More information about the mesa-dev mailing list