diff options
author | Dylan Baker <[email protected]> | 2017-02-17 11:41:03 -0800 |
---|---|---|
committer | Dylan Baker <[email protected]> | 2017-03-22 16:22:00 -0700 |
commit | 1610b3dede1d0d3246bd803f80ec5f2843668cda (patch) | |
tree | 652a5a84c5f7882b33f354d61c6b83e619dd626d /src/intel/vulkan | |
parent | 8017da8dd20e1b58573f5357730900d6ab0e1427 (diff) |
anv: don't pass xmlfile via stdin anv_entrypoints_gen.py
It's slow, and has the potential for encoding issues.
v2: - pass xml file location via argument
- update Android.mk
Signed-off-by: Dylan Baker <[email protected]>
Diffstat (limited to 'src/intel/vulkan')
-rw-r--r-- | src/intel/vulkan/anv_entrypoints_gen.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/intel/vulkan/anv_entrypoints_gen.py b/src/intel/vulkan/anv_entrypoints_gen.py index 47df4ce2c48..12ee7350fc9 100644 --- a/src/intel/vulkan/anv_entrypoints_gen.py +++ b/src/intel/vulkan/anv_entrypoints_gen.py @@ -22,7 +22,7 @@ # IN THE SOFTWARE. # -import sys +import argparse import textwrap import xml.etree.ElementTree as et @@ -58,13 +58,6 @@ PRIME_STEP = 19 opt_header = False opt_code = False -if sys.argv[1] == "header": - opt_header = True - sys.argv.pop() -elif sys.argv[1] == "code": - opt_code = True - sys.argv.pop() - def hash(name): h = 0 @@ -140,7 +133,13 @@ def get_entrypoints_defines(doc): def main(): - doc = et.parse(sys.stdin) + parser = argparse.ArgumentParser() + parser.add_argument('target', choices=['header', 'code'], + help='Which file to generate.') + parser.add_argument('--xml', help='Vulkan API XML file.') + args = parser.parse_args() + + doc = et.parse(args.xml) entrypoints = get_entrypoints(doc, get_entrypoints_defines(doc)) # Manually add CreateDmaBufImageINTEL for which we don't have an extension @@ -156,7 +155,7 @@ def main(): # For outputting entrypoints.h we generate a anv_EntryPoint() prototype # per entry point. - if opt_header: + if args.target == 'header': print "/* This file generated from vk_gen.py, don't edit directly. */\n" print "struct anv_dispatch_table {" |