Skip to content

Commit 68441fe

Browse files
vulkaninfo: Pretty print vendorID and deviceID in codegen
1 parent 778f409 commit 68441fe

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

scripts/vulkaninfo_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,7 @@ def PrintStructure(struct):
11451145
out += f' p.PrintKeyBool("{v.name}", static_cast<bool>(obj.{v.name}));\n'
11461146
elif v.typeID == 'uint8_t':
11471147
out += f' p.PrintKeyValue("{v.name}", static_cast<uint32_t>(obj.{v.name}));\n'
1148-
elif v.typeID == 'VkDeviceSize':
1148+
elif v.typeID == 'VkDeviceSize' or (v.typeID == 'uint32_t' and v.name in ['vendorID', 'deviceID']):
11491149
out += f' p.PrintKeyValue("{v.name}", to_hex_str(p, obj.{v.name}));\n'
11501150
elif v.typeID in PREDEFINED_TYPES:
11511151
out += f' p.PrintKeyValue("{v.name}", obj.{v.name});\n'

vulkaninfo/generated/vulkaninfo.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3685,8 +3685,8 @@ void DumpVkPhysicalDeviceInlineUniformBlockProperties(Printer &p, std::string na
36853685
void DumpVkPhysicalDeviceLayeredApiPropertiesKHR(Printer &p, std::string name, const VkPhysicalDeviceLayeredApiPropertiesKHR &obj) {
36863686
ObjectWrapper object{p, name};
36873687
p.SetMinKeyWidth(15);
3688-
p.PrintKeyValue("vendorID", obj.vendorID);
3689-
p.PrintKeyValue("deviceID", obj.deviceID);
3688+
p.PrintKeyValue("vendorID", to_hex_str(p, obj.vendorID));
3689+
p.PrintKeyValue("deviceID", to_hex_str(p, obj.deviceID));
36903690
DumpVkPhysicalDeviceLayeredApiKHR(p, "layeredAPI", obj.layeredAPI);
36913691
p.PrintKeyString("deviceName", obj.deviceName);
36923692
}

0 commit comments

Comments
 (0)