Vulkan: correctly expose Vulkan entry points
This change fixes the advertisement of core Vulkan entry points as below:
1. GIPA returns a valid checked_proc for 1.1 core device APIs.
2. GDPA returns NULL for 1.1 core device APIs on a 1.0 physical device.
Bug: 134185757
Bug: 142266108
Test: dEQP-VK.memory.binding on 1.1 loader and 1.0 device ICD
Test: dEQP-VK.api.info.instance on 1.1 loader and 1.0 instance ICD
Change-Id: I0a3e06dc04bade4f36a7e68ee2f53979c656ee4e
diff --git a/vulkan/scripts/generator_common.py b/vulkan/scripts/generator_common.py
index 670ba66..cf370fa 100644
--- a/vulkan/scripts/generator_common.py
+++ b/vulkan/scripts/generator_common.py
@@ -91,6 +91,9 @@
# Dict for mapping a function to its return type.
return_type_dict = {}
+# List of the sorted Vulkan version codes. e.g. '1_0', '1_1'.
+version_code_list = []
+
# Dict for mapping a function to the core Vulkan API version.
version_dict = {}
@@ -171,6 +174,15 @@
return ext[3:]
+def version_code(version):
+ """Returns the version code from a version string.
+
+ Args:
+ version: Vulkan version string.
+ """
+ return version[11:]
+
+
def is_function_supported(cmd):
"""Returns true if a function is core or from a supportable extension.
@@ -313,6 +325,7 @@
extension_dict
param_dict
return_type_dict
+ version_code_list
version_dict
"""
registry = os.path.join(os.path.dirname(__file__), '..', '..', '..', '..',
@@ -385,3 +398,9 @@
cmd_name = command.get('name')
if cmd_name in command_list:
version_dict[cmd_name] = apiversion
+
+ version_code_set = set()
+ for version in version_dict.values():
+ version_code_set.add(version_code(version))
+ for code in sorted(version_code_set):
+ version_code_list.append(code)