aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/generate_source.py14
-rw-r--r--scripts/known_good.json2
-rw-r--r--scripts/kvt_genvk.py34
-rw-r--r--scripts/mock_icd_generator.py15
-rwxr-xr-xscripts/update_deps.py21
5 files changed, 66 insertions, 20 deletions
diff --git a/scripts/generate_source.py b/scripts/generate_source.py
index a2002aae..5fb7941e 100755
--- a/scripts/generate_source.py
+++ b/scripts/generate_source.py
@@ -1,8 +1,9 @@
#!/usr/bin/env python3
-# Copyright (c) 2019 The Khronos Group Inc.
-# Copyright (c) 2019 Valve Corporation
-# Copyright (c) 2019 LunarG, Inc.
-# Copyright (c) 2019 Google Inc.
+# Copyright (c) 2019-2023 The Khronos Group Inc.
+# Copyright (c) 2019-2023 Valve Corporation
+# Copyright (c) 2019-2023 LunarG, Inc.
+# Copyright (c) 2019-2023 Google Inc.
+# Copyright (c) 2023-2023 RasterGrid Kft.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -33,6 +34,10 @@ verify_exclude = ['.clang-format']
def main(argv):
parser = argparse.ArgumentParser(description='Generate source code for this repository')
+ parser.add_argument('--api',
+ default='vulkan',
+ choices=['vulkan', 'vulkansc'],
+ help='Specify API name to generate')
parser.add_argument('registry', metavar='REGISTRY_PATH', help='path to the Vulkan-Headers registry directory')
group = parser.add_mutually_exclusive_group()
group.add_argument('-i', '--incremental', action='store_true', help='only update repo files that change')
@@ -65,6 +70,7 @@ def main(argv):
output_path = common_codegen.repo_relative(path)
cmd = [common_codegen.repo_relative(os.path.join('scripts','kvt_genvk.py')),
+ '-api', args.api,
'-registry', os.path.abspath(os.path.join(args.registry, 'vk.xml')),
'-quiet', '-directory', output_path, filename]
print(' '.join(cmd))
diff --git a/scripts/known_good.json b/scripts/known_good.json
index da780055..16abe2f5 100644
--- a/scripts/known_good.json
+++ b/scripts/known_good.json
@@ -2,6 +2,7 @@
"repos" : [
{
"name" : "Vulkan-Headers",
+ "api": "vulkan",
"url" : "https://github.com/KhronosGroup/Vulkan-Headers.git",
"sub_dir" : "Vulkan-Headers",
"build_dir" : "Vulkan-Headers/build",
@@ -26,6 +27,7 @@
},
{
"name" : "Vulkan-Loader",
+ "api": "vulkan",
"url" : "https://github.com/KhronosGroup/Vulkan-Loader.git",
"sub_dir" : "Vulkan-Loader",
"build_dir" : "Vulkan-Loader/build",
diff --git a/scripts/kvt_genvk.py b/scripts/kvt_genvk.py
index fe141165..332ca76b 100644
--- a/scripts/kvt_genvk.py
+++ b/scripts/kvt_genvk.py
@@ -1,6 +1,7 @@
#!/usr/bin/python3
#
-# Copyright (c) 2013-2019 The Khronos Group Inc.
+# Copyright (c) 2013-2023 The Khronos Group Inc.
+# Copyright (c) 2023-2023 RasterGrid Kft.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -59,8 +60,14 @@ def makeGenOpts(args):
global genOpts
genOpts = {}
+ # API to generate sources for
+ apiname = args.api
+
# Default class of extensions to include, or None
- defaultExtensions = args.defaultExtensions
+ if args.defaultExtensions is not None:
+ defaultExtensions = args.defaultExtensions
+ else:
+ defaultExtensions = apiname
# Additional extensions to include (list of extensions)
extensions = args.extension
@@ -137,11 +144,11 @@ def makeGenOpts(args):
filename='vk_typemap_helper.h',
directory=directory,
genpath=None,
- apiname='vulkan',
+ apiname=apiname,
profile=None,
versions=featuresPat,
emitversions=featuresPat,
- defaultExtensions='vulkan',
+ defaultExtensions=defaultExtensions,
addExtensions=addExtensionsPat,
removeExtensions=removeExtensionsPat,
emitExtensions=emitExtensionsPat,
@@ -163,11 +170,11 @@ def makeGenOpts(args):
filename='mock_icd.h',
directory=directory,
genpath=None,
- apiname='vulkan',
+ apiname=apiname,
profile=None,
versions=featuresPat,
emitversions=featuresPat,
- defaultExtensions='vulkan',
+ defaultExtensions=defaultExtensions,
addExtensions=addExtensionsPat,
removeExtensions=removeExtensionsPat,
emitExtensions=emitExtensionsPat,
@@ -189,11 +196,11 @@ def makeGenOpts(args):
filename='mock_icd.cpp',
directory=directory,
genpath=None,
- apiname='vulkan',
+ apiname=apiname,
profile=None,
versions=featuresPat,
emitversions=featuresPat,
- defaultExtensions='vulkan',
+ defaultExtensions=defaultExtensions,
addExtensions=addExtensionsPat,
removeExtensions=removeExtensionsPat,
emitExtensions=emitExtensionsPat,
@@ -215,11 +222,11 @@ def makeGenOpts(args):
filename='vulkaninfo.hpp',
directory=directory,
genpath=None,
- apiname='vulkan',
+ apiname=apiname,
profile=None,
versions=featuresPat,
emitversions=featuresPat,
- defaultExtensions='vulkan',
+ defaultExtensions=defaultExtensions,
addExtensions=addExtensionsPat,
removeExtensions=removeExtensionsPat,
emitExtensions=emitExtensionsPat,
@@ -254,6 +261,7 @@ def genTarget(args):
if not args.quiet:
write('* Building', options.filename, file=sys.stderr)
+ write('* options.apiname =', options.apiname, file=sys.stderr)
write('* options.versions =', options.versions, file=sys.stderr)
write('* options.emitversions =', options.emitversions, file=sys.stderr)
write('* options.defaultExtensions =', options.defaultExtensions, file=sys.stderr)
@@ -279,8 +287,12 @@ def genTarget(args):
if __name__ == '__main__':
parser = argparse.ArgumentParser()
- parser.add_argument('-defaultExtensions', action='store',
+ parser.add_argument('-api', action='store',
default='vulkan',
+ choices=['vulkan', 'vulkansc'],
+ help='Specify API name to generate')
+ parser.add_argument('-defaultExtensions', action='store',
+ default=None,
help='Specify a single class of extensions to add to targets')
parser.add_argument('-directory', action='store', default='.',
help='Specify where the built file is place')
diff --git a/scripts/mock_icd_generator.py b/scripts/mock_icd_generator.py
index 0d81561d..c67d17b5 100644
--- a/scripts/mock_icd_generator.py
+++ b/scripts/mock_icd_generator.py
@@ -1,9 +1,10 @@
#!/usr/bin/python3 -i
#
-# Copyright (c) 2015-2022 The Khronos Group Inc.
-# Copyright (c) 2015-2022 Valve Corporation
-# Copyright (c) 2015-2022 LunarG, Inc.
-# Copyright (c) 2015-2022 Google Inc.
+# Copyright (c) 2015-2023 The Khronos Group Inc.
+# Copyright (c) 2015-2023 Valve Corporation
+# Copyright (c) 2015-2023 LunarG, Inc.
+# Copyright (c) 2015-2023 Google Inc.
+# Copyright (c) 2023-2023 RasterGrid Kft.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -1523,6 +1524,10 @@ class MockICDOutputGenerator(OutputGenerator):
else:
return False
+ # Check that the target API is in the supported list for the extension
+ def checkExtensionAPISupport(self, supported):
+ return self.genOpts.apiname in supported.split(',')
+
def beginFile(self, genOpts):
OutputGenerator.beginFile(self, genOpts)
# C-specific
@@ -1564,7 +1569,7 @@ class MockICDOutputGenerator(OutputGenerator):
# Ignore extensions that ICDs should not implement or are not safe to report
ignore_exts = ['VK_EXT_validation_cache', 'VK_KHR_portability_subset']
for ext in self.registry.tree.findall("extensions/extension"):
- if ext.attrib['supported'] != 'disabled': # Only include enabled extensions
+ if self.checkExtensionAPISupport(ext.attrib['supported']): # Only include API-relevant extensions
if (ext.attrib['name'] not in ignore_exts):
# Search for extension version enum
for enum in ext.findall('require/enum'):
diff --git a/scripts/update_deps.py b/scripts/update_deps.py
index 7664a55f..d53760a0 100755
--- a/scripts/update_deps.py
+++ b/scripts/update_deps.py
@@ -3,6 +3,7 @@
# Copyright 2017 The Glslang Authors. All rights reserved.
# Copyright (c) 2018-2023 Valve Corporation
# Copyright (c) 2018-2023 LunarG, Inc.
+# Copyright (c) 2023-2023 RasterGrid Kft.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -117,6 +118,10 @@ examples of all of these elements.
The name of the dependent repository. This field can be referenced
by the "deps.repo_name" structure to record a dependency.
+- api
+
+The name of the API the dependency is specific to (e.g. "vulkan").
+
- url
Specifies the URL of the repository.
@@ -335,6 +340,7 @@ class GoodRepo(object):
self.build_step = json['build_step'] if ('build_step' in json) else 'build'
self.build_platforms = json['build_platforms'] if ('build_platforms' in json) else []
self.optional = set(json.get('optional', []))
+ self.api = json['api'] if ('api' in json) else None
# Absolute paths for a repo's directories
dir_top = os.path.abspath(args.dir)
self.repo_dir = os.path.join(dir_top, self.sub_dir)
@@ -579,6 +585,10 @@ def CreateHelper(args, repos, filename):
install_names = GetInstallNames(args)
with open(filename, 'w') as helper_file:
for repo in repos:
+ # If the repo has an API tag and that does not match
+ # the target API then skip it
+ if repo.api is not None and repo.api != args.api:
+ continue
if install_names and repo.name in install_names and repo.on_build_platform:
helper_file.write('set({var} "{dir}" CACHE STRING "" FORCE)\n'
.format(
@@ -655,6 +665,12 @@ def main():
help="Set build files configuration",
default='debug')
parser.add_argument(
+ '--api',
+ dest='api',
+ default='vulkan',
+ choices=['vulkan', 'vulkansc'],
+ help="Target API")
+ parser.add_argument(
'--generator',
dest='generator',
help="Set the CMake generator",
@@ -685,6 +701,11 @@ def main():
print('Starting builds in {d}'.format(d=abs_top_dir))
for repo in repos:
+ # If the repo has an API tag and that does not match
+ # the target API then skip it
+ if repo.api is not None and repo.api != args.api:
+ continue
+
# If the repo has a platform whitelist, skip the repo
# unless we are building on a whitelisted platform.
if not repo.on_build_platform: