aboutsummaryrefslogtreecommitdiff
path: root/scripts/vulkaninfo_generator.py
diff options
context:
space:
mode:
authorMike Schuchardt <mikes@lunarg.com>2023-07-21 10:09:57 -0700
committerMike Schuchardt <mikes@lunarg.com>2023-07-21 13:28:03 -0700
commite69a7c71c52c2e9316f4bd7f95af7a084a1a2870 (patch)
tree6e7101bcc258d912670a4384668e4e4f889b1c8f /scripts/vulkaninfo_generator.py
parentc5ac1413f0108d111160711b00eec61c81c5e293 (diff)
downloadusermoji-e69a7c71c52c2e9316f4bd7f95af7a084a1a2870.tar.xz
build: Update to header 1.3.258
- Update known-good - Modify vulkaninfo_generator.py to wrap dynamically-sized ArrayWrapper with scope brackets - Modify vulkaninfo_generator.py to add padding after VkPhysicalDeviceHostImageCopyFeaturesEXT to work around pre-release drivers with larger versions of this struct. - Generate source
Diffstat (limited to 'scripts/vulkaninfo_generator.py')
-rw-r--r--scripts/vulkaninfo_generator.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/scripts/vulkaninfo_generator.py b/scripts/vulkaninfo_generator.py
index 37ca830b..6668d046 100644
--- a/scripts/vulkaninfo_generator.py
+++ b/scripts/vulkaninfo_generator.py
@@ -567,15 +567,17 @@ def PrintStructure(struct, types_to_gen, structure_names, aliases):
out += f' for (uint32_t i = 0; i < {v.arrayLength}; i++) {{ p.PrintElement(obj.{v.name}[i]); }}\n'
out += f" }}\n"
else: # dynamic array length based on other member
- out += f' ArrayWrapper arr(p,"{v.name}", obj.' + v.arrayLength + ');\n'
- out += f" for (uint32_t i = 0; i < obj.{v.arrayLength}; i++) {{\n"
+ out += f" {{\n"
+ out += f' ArrayWrapper arr(p,"{v.name}", obj.' + v.arrayLength + ');\n'
+ out += f" for (uint32_t i = 0; i < obj.{v.arrayLength}; i++) {{\n"
if v.typeID in types_to_gen:
- out += f" if (obj.{v.name} != nullptr) {{\n"
- out += f" p.SetElementIndex(i);\n"
- out += f' Dump{v.typeID}(p, "{v.name}", obj.{v.name}[i]);\n'
- out += f" }}\n"
+ out += f" if (obj.{v.name} != nullptr) {{\n"
+ out += f" p.SetElementIndex(i);\n"
+ out += f' Dump{v.typeID}(p, "{v.name}", obj.{v.name}[i]);\n'
+ out += f" }}\n"
else:
- out += f" p.PrintElement(obj.{v.name}[i]);\n"
+ out += f" p.PrintElement(obj.{v.name}[i]);\n"
+ out += f" }}\n"
out += f" }}\n"
elif v.typeID == "VkBool32":
out += f' p.PrintKeyBool("{v.name}", static_cast<bool>(obj.{v.name}));\n'
@@ -642,13 +644,13 @@ def PrintChainStruct(listName, structures, all_structures, chain_details):
out += AddGuardHeader(s)
if s.sTypeName is not None:
out += f" {s.name} {s.name[2:]}{{}};\n"
- # Specific versions of drivers have an incorrect definition of the size of this struct.
+ # Specific versions of drivers have an incorrect definition of the size of these structs.
# We need to artificially pad the structure it just so the driver doesn't write out of bounds and
# into other structures that are adjacent. This bug comes from the in-development version of
# the extension having a larger size than the final version, so older drivers try to write to
# members which don't exist.
- if s.sTypeName == "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES":
- out += " char padding[64];\n"
+ if s.name in ['VkPhysicalDeviceShaderIntegerDotProductFeatures', 'VkPhysicalDeviceHostImageCopyFeaturesEXT']:
+ out += f" char {s.name}_padding[64];\n"
out += AddGuardFooter(s)
out += f" void initialize_chain() noexcept {{\n"
for s in structs_to_print: