Debian Codegraph @

scripts/loader_genvk.py

raw
1 #!/usr/bin/python3
2 #
3 # Copyright (c) 2013-2025 The Khronos Group Inc.
4 # Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
5 # Copyright (c) 2023-2023 RasterGrid Kft.
6 #
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 # http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18
19 import argparse
20 import os
21 import common_codegen
22 from generate_source import RunGenerators
23
24 # This is a legacy way to run the code gen
25 # Should call generate_source.py instead
26 if __name__ == '__main__':
27 parser = argparse.ArgumentParser()
28
29 parser.add_argument('target', metavar='target', nargs='?', help='Specify target')
30 parser.add_argument('-api', action='store',
31 default='vulkan',
32 choices=['vulkan'],
33 help='Specify API name to generate')
34 parser.add_argument('-registry', action='store',
35 default='vk.xml',
36 help='Use specified registry file instead of vk.xml')
37 parser.add_argument('-o', action='store', dest='directory',
38 default='.',
39 help='Create target and related files in specified directory')
40 # This argument tells us where to load the script from the Vulkan-Headers registry
41 parser.add_argument('-scripts', action='store',
42 help='Find additional scripts in this directory')
43
44 args = parser.parse_args()
45
46 # Currently don't run clang format
47 # repo_dir = common_codegen.repo_relative('.')
48 # style_file = os.path.join(repo_dir, '.clang-format')
49
50 RunGenerators(api=args.api,registry=args.registry, directory=args.directory, styleFile=None, targetFilter=[args.target], flatOutput=True)
51