diff options
| author | Charles Giessen <charles@lunarg.com> | 2021-09-17 13:43:50 -0600 |
|---|---|---|
| committer | Charles Giessen <46324611+charles-lunarg@users.noreply.github.com> | 2021-09-22 11:45:32 -0600 |
| commit | c4fdac59cea610d1227a8856f6e6e822daa3ec9e (patch) | |
| tree | 19a15958ec521c5bdaae2626c84fe7ad6e65215a /scripts | |
| parent | fd988fa88a34328f1b7d45c9c0d4f4e1319a441e (diff) | |
| download | usermoji-c4fdac59cea610d1227a8856f6e6e822daa3ec9e.tar.xz | |
vulkaninf: Support 64 bit flags
64 bit flags use the bitvalues field instead of the requires field in the XML
to specify the flagbits name. Thus the autogen needed to account for that.
In addition, if a flag was promoted to core, the autogen didn't use the core
version, this commit also fixes that.
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/vulkaninfo_generator.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/scripts/vulkaninfo_generator.py b/scripts/vulkaninfo_generator.py index fc4b145e..956dedce 100644 --- a/scripts/vulkaninfo_generator.py +++ b/scripts/vulkaninfo_generator.py @@ -288,7 +288,7 @@ class VulkanInfoGenerator(OutputGenerator): out += PrintBitMaskToString(bitmask, flag.name, self) for s in (x for x in self.all_structures if x.name in types_to_gen and x.name not in struct_blacklist): - out += PrintStructure(s, types_to_gen, names_of_structures_to_gen) + out += PrintStructure(s, types_to_gen, names_of_structures_to_gen, self.aliases) out += "pNextChainInfos get_chain_infos() {\n" out += " pNextChainInfos infos;\n" @@ -508,7 +508,7 @@ def PrintBitMaskToString(bitmask, name, gen): return out -def PrintStructure(struct, types_to_gen, structure_names): +def PrintStructure(struct, types_to_gen, structure_names, aliases): if len(struct.members) == 0: return "" out = '' @@ -587,12 +587,16 @@ def PrintStructure(struct, types_to_gen, structure_names): v.name + ", " + str(max_key_len) + ");\n" elif v.name not in ['sType', 'pNext']: # if it is an enum/flag/bitmask, add the calculated width - if v.typeID not in structure_names: - out += " Dump" + v.typeID + \ + type_name = v.typeID + for key, value in aliases.items(): + if type_name in value: + type_name = key + if type_name not in structure_names: + out += " Dump" + type_name + \ "(p, \"" + v.name + "\", obj." + \ v.name + ", " + str(max_key_len) + ");\n" else: - out += " Dump" + v.typeID + \ + out += " Dump" + type_name + \ "(p, \"" + v.name + "\", obj." + v.name + ");\n" if struct.name in ["VkPhysicalDeviceLimits", "VkPhysicalDeviceSparseProperties"]: out += " p.ObjectEnd();\n" @@ -837,6 +841,9 @@ class VulkanFlags: self.name = rootNode.get('name') self.type = rootNode.get('type') self.enum = rootNode.get('requires') + # 64 bit flags use bitvalues, not requires + if self.enum == None: + self.enum = rootNode.get('bitvalues') class VulkanVariable: |
