diff options
| author | Jeremy Gebben <jeremyg@lunarg.com> | 2026-01-06 11:29:19 -0700 |
|---|---|---|
| committer | Charles Giessen <46324611+charles-lunarg@users.noreply.github.com> | 2026-01-13 13:30:32 -0600 |
| commit | f5ba3301bdd000d925b4bf277a18ac0fa69c1fd2 (patch) | |
| tree | 5a16d2ba976e12e7c00e32c0ab62b78abcfad968 /scripts | |
| parent | 155fa739805a96ae1a5f0cc9f0847e8e8f34725b (diff) | |
| download | usermoji-f5ba3301bdd000d925b4bf277a18ac0fa69c1fd2.tar.xz | |
info: Add support for VK_KHR_display
This prints the results of vkGetPhysicalDeviceDisplayPropertiesKHR(),
vkGetPhysicalDeviceDisplayPlanePropertiesKHR() and other
related property lookups.
It does not provide support to create a VK_KHR_display surface and
query it.
It also does not try to use VK_EXT_direct_mode_display to take control
of the display from the window system.
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/generators/vulkaninfo_generator.py | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/scripts/generators/vulkaninfo_generator.py b/scripts/generators/vulkaninfo_generator.py index cdd4bac7..86a32c48 100644 --- a/scripts/generators/vulkaninfo_generator.py +++ b/scripts/generators/vulkaninfo_generator.py @@ -1,7 +1,7 @@ #!/usr/bin/python3 # -# Copyright (c) 2019-2022 Valve Corporation -# Copyright (c) 2019-2022 LunarG, Inc. +# Copyright (c) 2019-2026 Valve Corporation +# Copyright (c) 2019-2026 LunarG, Inc. # Copyright (c) 2019-2022 Google Inc. # Copyright (c) 2023-2024 RasterGrid Kft. # @@ -25,9 +25,9 @@ from collections import OrderedDict LICENSE_HEADER = ''' /* - * Copyright (c) 2019-2022 The Khronos Group Inc. - * Copyright (c) 2019-2022 Valve Corporation - * Copyright (c) 2019-2022 LunarG, Inc. + * Copyright (c) 2019-2026 The Khronos Group Inc. + * Copyright (c) 2019-2026 Valve Corporation + * Copyright (c) 2019-2026 LunarG, Inc. * Copyright (c) 2023-2024 RasterGrid Kft. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -77,14 +77,17 @@ STRUCTURES_TO_GEN = ['VkExtent3D', 'VkExtent2D', 'VkPhysicalDeviceLimits', 'VkPh 'VkSurfaceCapabilitiesKHR', 'VkSurfaceFormatKHR', 'VkLayerProperties', 'VkPhysicalDeviceToolProperties', 'VkFormatProperties', 'VkSurfacePresentScalingCapabilitiesKHR', 'VkSurfacePresentModeCompatibilityKHR', 'VkPhysicalDeviceHostImageCopyProperties', 'VkVideoProfileInfoKHR', 'VkVideoCapabilitiesKHR', 'VkVideoFormatPropertiesKHR', 'VkCooperativeMatrixPropertiesKHR', - 'VkPhysicalDeviceFragmentShadingRateKHR', 'VkMultisamplePropertiesEXT'] + 'VkPhysicalDeviceFragmentShadingRateKHR', 'VkMultisamplePropertiesEXT', + 'VkDisplayPropertiesKHR', 'VkDisplayPlanePropertiesKHR', 'VkDisplayPlaneCapabilitiesKHR', 'VkDisplayModePropertiesKHR', + 'VkDisplayModeParametersKHR'] + ENUMS_TO_GEN = ['VkResult', 'VkFormat', 'VkPresentModeKHR', 'VkPhysicalDeviceType', 'VkImageTiling', 'VkTimeDomainKHR'] FLAGS_TO_GEN = ['VkSurfaceTransformFlagsKHR', 'VkCompositeAlphaFlagsKHR', 'VkSurfaceCounterFlagsEXT', 'VkQueueFlags', 'VkDeviceGroupPresentModeFlagsKHR', 'VkFormatFeatureFlags', 'VkFormatFeatureFlags2', 'VkMemoryPropertyFlags', 'VkMemoryHeapFlags'] FLAG_STRINGS_TO_GEN = ['VkQueueFlags'] -STRUCT_SHORT_VERSIONS_TO_GEN = ['VkExtent3D'] +STRUCT_SHORT_VERSIONS_TO_GEN = ['VkExtent3D', 'VkExtent2D'] STRUCT_COMPARISONS_TO_GEN = ['VkSurfaceFormatKHR', 'VkSurfaceFormat2KHR', 'VkSurfaceCapabilitiesKHR', 'VkSurfaceCapabilities2KHR', 'VkSurfaceCapabilities2EXT'] @@ -100,7 +103,7 @@ PORTABILITY_STRUCTS = ['VkPhysicalDevicePortabilitySubsetFeaturesKHR', 'VkPhysic PREDEFINED_TYPES = ['char', 'VkBool32', 'uint32_t', 'uint8_t', 'int32_t', 'float', 'uint64_t', 'size_t', 'VkDeviceSize', 'int64_t'] -NAMES_TO_IGNORE = ['sType', 'pNext'] +NAMES_TO_IGNORE = ['sType', 'pNext', 'displayMode', 'display', 'currentDisplay'] EXTENSION_TYPE_INSTANCE = 'instance' EXTENSION_TYPE_DEVICE = 'device' @@ -229,9 +232,11 @@ class VulkanInfoGenerator(BaseGenerator): if bitmask.flagName in FLAG_STRINGS_TO_GEN: out.extend(self.PrintBitMaskToString(bitmask, bitmask.flagName)) - + # make sure dump functions for nested structures are declared before use + for s in (x for x in types_to_gen if x in self.vk.structs and x not in STRUCT_BLACKLIST): + out.extend(self.PrintStructure(self.vk.structs[s], True)) for s in (x for x in types_to_gen if x in self.vk.structs and x not in STRUCT_BLACKLIST): - out.extend(self.PrintStructure(self.vk.structs[s])) + out.extend(self.PrintStructure(self.vk.structs[s], False)) for key, value in EXTENSION_CATEGORIES.items(): out.extend(self.PrintChainStruct(key, extension_types[key], value)) @@ -782,7 +787,7 @@ std::vector<std::unique_ptr<AppVideoProfile>> enumerate_supported_video_profiles return out - def PrintStructure(self,struct): + def PrintStructure(self,struct, declare_only): if len(struct.members) == 0: return [] out = [] @@ -791,8 +796,12 @@ std::vector<std::unique_ptr<AppVideoProfile>> enumerate_supported_video_profiles for v in struct.members: if (v.type in PREDEFINED_TYPES or v.type in STRUCT_BLACKLIST) and (v.length is None or v.type in ['char'] or v.fixedSizeArray[0] in ['VK_UUID_SIZE', 'VK_LUID_SIZE']): max_key_len = max(max_key_len, len(v.name)) - - out.append(f'void Dump{struct.name}(Printer &p, std::string name, const {struct.name} &obj) {{\n') + out.append(f'void Dump{struct.name}(Printer &p, std::string name, const {struct.name} &obj)') + if declare_only: + out.append(';\n') + out.append(self.AddGuardFooter(struct)) + return out + out.append(' {\n') if struct.name == 'VkPhysicalDeviceLimits': out.append(' if (p.Type() == OutputType::json)\n') out.append(' p.ObjectStart("limits");\n') |
