Skip to content

Commit 15f2de8

Browse files
scripts: Make generate_source.py look harder for vk.xml
Allow the registry path argument to also be the base directory containing the Vulkan-Headers repo (eg. ./external) to save redundant typing.
1 parent 5689add commit 15f2de8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/generate_source.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ def main(argv):
7676
for path in files_to_gen.keys():
7777
os.makedirs(os.path.join(temp_dir, path))
7878

79+
registry = os.path.abspath(os.path.join(args.registry, 'vk.xml'))
80+
if not os.path.isfile(registry):
81+
registry = os.path.abspath(os.path.join(args.registry, 'Vulkan-Headers/registry/vk.xml'))
82+
if not os.path.isfile(registry):
83+
print(f'cannot find vk.xml in {args.registry}')
84+
return -1
85+
7986
# run each code generator
8087
for path, filenames in files_to_gen.items():
8188
for filename in filenames:
@@ -86,7 +93,7 @@ def main(argv):
8693

8794
cmd = [common_codegen.repo_relative(os.path.join('scripts','kvt_genvk.py')),
8895
'-api', args.api,
89-
'-registry', os.path.abspath(os.path.join(args.registry, 'vk.xml')),
96+
'-registry', registry,
9097
'-quiet', '-directory', output_path, filename]
9198
print(' '.join(cmd))
9299
try:

0 commit comments

Comments
 (0)