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 <tapani.palli@intel.com>
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user