summaryrefslogtreecommitdiffstats
path: root/src/vulkan/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/vulkan/util')
-rw-r--r--src/vulkan/util/gen_enum_to_str.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/vulkan/util/gen_enum_to_str.py b/src/vulkan/util/gen_enum_to_str.py
index 4b6fdf3b3de..8c11569b6ae 100644
--- a/src/vulkan/util/gen_enum_to_str.py
+++ b/src/vulkan/util/gen_enum_to_str.py
@@ -22,6 +22,7 @@
"""Create enum to string functions for vulking using vk.xml."""
from __future__ import print_function
+import argparse
import os
import textwrap
import xml.etree.cElementTree as et
@@ -158,9 +159,16 @@ def xml_parser(filename):
def main():
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--outdir',
+ help='Directory to put the generated files in',
+ required=True)
+
+ args = parser.parse_args()
+
enums = xml_parser(VK_XML)
- for template, file_ in [(C_TEMPLATE, 'util/vk_enum_to_str.c'),
- (H_TEMPLATE, 'util/vk_enum_to_str.h')]:
+ 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:
f.write(template.render(
file=os.path.basename(__file__),