summaryrefslogtreecommitdiffstats
path: root/src/vulkan/util
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2017-02-28 18:53:04 +0000
committerEmil Velikov <[email protected]>2017-02-28 18:53:04 +0000
commitca7d2025a7547275101efbca0b45adb67f8fa59d (patch)
tree8fb0fbc0c67efe47a9c9e6a3ab9b1469e62e3e6f /src/vulkan/util
parent14281c9035d6b30cda08fd6ab573ee3bfafa2c2d (diff)
vulkan: provide vk.xml as argument to the python generator
Do not hardcode the file in the python script, but pass it via the build system(s). The latter is the only one that should know about the file location/tree structure. Cc: Dylan Baker <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'src/vulkan/util')
-rw-r--r--src/vulkan/util/gen_enum_to_str.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/vulkan/util/gen_enum_to_str.py b/src/vulkan/util/gen_enum_to_str.py
index 8c11569b6ae..fb31addf94f 100644
--- a/src/vulkan/util/gen_enum_to_str.py
+++ b/src/vulkan/util/gen_enum_to_str.py
@@ -29,8 +29,6 @@ import xml.etree.cElementTree as et
from mako.template import Template
-VK_XML = os.path.join(os.path.dirname(__file__), '..', 'registry', 'vk.xml')
-
COPYRIGHT = textwrap.dedent(u"""\
* Copyright © 2017 Intel Corporation
*
@@ -160,13 +158,14 @@ def xml_parser(filename):
def main():
parser = argparse.ArgumentParser()
+ parser.add_argument('--xml', help='Vulkan API XML file.', required=True)
parser.add_argument('--outdir',
help='Directory to put the generated files in',
required=True)
args = parser.parse_args()
- enums = xml_parser(VK_XML)
+ enums = xml_parser(args.xml)
for template, file_ in [(C_TEMPLATE, os.path.join(args.outdir, 'vk_enum_to_str.c')),
(H_TEMPLATE, os.path.join(args.outdir, 'vk_enum_to_str.h'))]:
with open(file_, 'wb') as f: