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>
lambda h, c: (h * PRIME_FACTOR + ord(c)) & U32_MASK, name, 0)
lambda h, c: (h * PRIME_FACTOR + ord(c)) & U32_MASK, name, 0)
-def get_entrypoints(doc, entrypoints_to_defines):
+def get_entrypoints(doc, entrypoints_to_defines, start_index):
"""Extract the entry points from the registry."""
entrypoints = []
"""Extract the entry points from the registry."""
entrypoints = []
for command in extension.findall('./require/command'):
enabled_commands.add(command.attrib['name'])
for command in extension.findall('./require/command'):
enabled_commands.add(command.attrib['name'])
for command in doc.findall('./commands/command'):
type = command.find('./proto/type').text
fullname = command.find('./proto/name').text
for command in doc.findall('./commands/command'):
type = command.find('./proto/type').text
fullname = command.find('./proto/name').text
parser = argparse.ArgumentParser()
parser.add_argument('--outdir', help='Where to write the files.',
required=True)
parser = argparse.ArgumentParser()
parser.add_argument('--outdir', help='Where to write the files.',
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()
args = parser.parse_args()
- doc = et.parse(args.xml)
- entrypoints = get_entrypoints(doc, get_entrypoints_defines(doc))
+ entrypoints = []
+
+ for filename in args.xml_files:
+ doc = et.parse(filename)
+ entrypoints += get_entrypoints(doc, get_entrypoints_defines(doc),
+ start_index=len(entrypoints))
# Manually add CreateDmaBufImageINTEL for which we don't have an extension
# defined.
# Manually add CreateDmaBufImageINTEL for which we don't have an extension
# defined.
ext.type = ext_elem.attrib['type']
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"
_TEMPLATE = Template(COPYRIGHT + """
#include "anv_private.h"
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--out', help='Output C file.', required=True)
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()
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,
template_env = {
'MAX_API_VERSION': MAX_API_VERSION,