diff options
author | Chad Versace <[email protected]> | 2017-08-22 16:23:26 -0700 |
---|---|---|
committer | Chad Versace <[email protected]> | 2017-09-18 14:26:54 -0700 |
commit | 6a5ff18039d0c35e79ac24ceae2479d5c7c85bd3 (patch) | |
tree | c47b398ddab8cd10807ee3f3f2e18428a66b82d2 /src/intel/vulkan/anv_extensions.py | |
parent | 2d1fac119fa0d1fccae086605b43b426312b257a (diff) |
anv: Teach generator scripts how to parse mutliple XML files
The taught scripts are anv_extensions.py and anv_entrypoints_gen.py. To
give a script multiple XML files, call it like so:
anv_extensions.py --xml a.xml --xml b.xml --xml c.xml ...
The scripts parse the XML files in the given order.
This will allow us to feed the scripts XML files for extensions that are
missing from the official vk.xml, such as VK_ANDROID_native_buffer.
Reviewed-by: Tapani Pälli <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_extensions.py')
-rw-r--r-- | src/intel/vulkan/anv_extensions.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/intel/vulkan/anv_extensions.py b/src/intel/vulkan/anv_extensions.py index c94149c130a..4dfde064ca7 100644 --- a/src/intel/vulkan/anv_extensions.py +++ b/src/intel/vulkan/anv_extensions.py @@ -140,9 +140,6 @@ def _init_exts_from_xml(xml): ext.type = ext_elem.attrib['type'] - for ext in EXTENSIONS: - assert ext.type == 'instance' or ext.type == 'device' - _TEMPLATE = Template(COPYRIGHT + """ #include "anv_private.h" @@ -234,10 +231,18 @@ VkResult anv_EnumerateDeviceExtensionProperties( if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--out', help='Output C file.', required=True) - parser.add_argument('--xml', help='Vulkan API XML file.', required=True) + parser.add_argument('--xml', + help='Vulkan API XML file.', + required=True, + action='append', + dest='xml_files') args = parser.parse_args() - _init_exts_from_xml(args.xml) + for filename in args.xml_files: + _init_exts_from_xml(filename) + + for ext in EXTENSIONS: + assert ext.type == 'instance' or ext.type == 'device' template_env = { 'MAX_API_VERSION': MAX_API_VERSION, |