[Mesa-dev] [PATCH v2 6/14] anv: convert header generation in anv_entrypoints_gen.py to mako
Dylan Baker
dylan at pnwbakers.com
Fri Feb 24 16:41:18 UTC 2017
Quoting Emil Velikov (2017-02-24 05:57:24)
> 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 ?
actually, python has a __file__ constant that I usually use for this. I'll add a
patch.
>
> IMHO, feel free to address that whenever you prefer.
> Emil
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170224/4c41664f/attachment.sig>
More information about the mesa-dev
mailing list