From 484aac746d11631bd8bc449bad08923a2ff6410e Mon Sep 17 00:00:00 2001 From: Charles Giessen Date: Sun, 14 Nov 2021 13:32:30 -0700 Subject: 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. --- scripts/vulkaninfo_generator.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'scripts') 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 -- cgit v1.2.3