aboutsummaryrefslogtreecommitdiff
path: root/scripts/vulkaninfo_generator.py
diff options
context:
space:
mode:
authorCharles Giessen <charles@lunarg.com>2021-11-14 13:32:30 -0700
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>2022-02-02 16:22:12 -0700
commit484aac746d11631bd8bc449bad08923a2ff6410e (patch)
treea7e8de183567f713632a9b1a7a2d80af46c4d646 /scripts/vulkaninfo_generator.py
parent81dbf823d8c17a53c048c255bc031ed31675dd65 (diff)
downloadusermoji-484aac746d11631bd8bc449bad08923a2ff6410e.tar.xz
vulkaninfo: Support QueueProperties pNext chain
Make the autogen and vulkaninfo source code support printing of the pNext chain in VkQueueProperties2KHR. Several structs were added to this chain recently and are helpful information to be printed. This required special casing the output so that it only prints the elements that are 'valid' and modifying the chain printer to unset the next header flag.
Diffstat (limited to 'scripts/vulkaninfo_generator.py')
-rw-r--r--scripts/vulkaninfo_generator.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/scripts/vulkaninfo_generator.py b/scripts/vulkaninfo_generator.py
index b0b40006..bb28c06e 100644
--- a/scripts/vulkaninfo_generator.py
+++ b/scripts/vulkaninfo_generator.py
@@ -108,9 +108,10 @@ predefined_types = ['char', 'VkBool32', 'uint32_t', 'uint8_t', 'int32_t',
EXTENSION_CATEGORIES = OrderedDict((
('phys_device_props2', {'extends': 'VkPhysicalDeviceProperties2', 'type': 'both', 'holder_type': 'VkPhysicalDeviceProperties2'}),
('phys_device_mem_props2', {'extends': 'VkPhysicalDeviceMemoryProperties2', 'type': 'device', 'holder_type':'VkPhysicalDeviceMemoryProperties2'}),
- ('phys_device_features2', {'extends': 'VkPhysicalDeviceFeatures2,VkDeviceCreateInfo', 'type': 'device', 'holder_type':'VkPhysicalDeviceFeatures2'}),
- ('surface_capabilities2', {'extends': 'VkSurfaceCapabilities2KHR', 'type': 'both', 'holder_type':'VkSurfaceCapabilities2KHR'}),
- ('format_properties2', {'extends': 'VkFormatProperties2', 'type': 'device', 'holder_type':'VkFormatProperties2'})
+ ('phys_device_features2', {'extends': 'VkPhysicalDeviceFeatures2,VkDeviceCreateInfo', 'type': 'device', 'holder_type': 'VkPhysicalDeviceFeatures2'}),
+ ('surface_capabilities2', {'extends': 'VkSurfaceCapabilities2KHR', 'type': 'both', 'holder_type': 'VkSurfaceCapabilities2KHR'}),
+ ('format_properties2', {'extends': 'VkFormatProperties2', 'type': 'device', 'holder_type':'VkFormatProperties2'}),
+ ('queue_properties2', {'extends': 'VkQueueFamilyProperties2', 'type': 'device', 'holder_type': 'VkQueueFamilyProperties2'})
))
class VulkanInfoGeneratorOptions(GeneratorOptions):
def __init__(self,
@@ -531,6 +532,11 @@ def PrintStructure(struct, types_to_gen, structure_names, aliases):
elif (v.arrayLength == str(8) and v.typeID == "uint8_t"): # VK_LUID_SIZE
out += f" if (obj.deviceLUIDValid)" # special case
out += f" p.PrintKeyString(\"{v.name}\", to_string_8(obj.{v.name}), {str(max_key_len)});\n"
+ elif struct.name == "VkQueueFamilyGlobalPriorityPropertiesEXT" and v.name == "priorities":
+ out += f" ArrayWrapper arr(p,\"{v.name}\", obj.priorityCount);\n"
+ out += f" for (uint32_t i = 0; i < obj.priorityCount; i++) {{\n"
+ out += f" Dump{v.typeID}(p, \"{v.name}\", obj.{v.name}[i]);\n"
+ out += f" }}\n"
elif v.arrayLength.isdigit():
out += f" {{ ArrayWrapper arr(p,\"{v.name}\", "+v.arrayLength+");\n"
for i in range(0, int(v.arrayLength)):
@@ -717,6 +723,7 @@ def PrintChainIterator(listName, structures, all_structures, checkExtLoc, extTyp
out += AddGuardFooter(s)
out += f" place = structure->pNext;\n"
out += f" }}\n"
+ out += f" p.UnsetSubHeader();\n"
out += f"}}\n"
return out