Skip to content

Commit

Permalink
vulkaninfo: Fix including promoted structures
Browse files Browse the repository at this point in the history
  • Loading branch information
ziga-lunarg committed Dec 2, 2023
1 parent 8718f7f commit 92c6268
Show file tree
Hide file tree
Showing 4 changed files with 201 additions and 226 deletions.
14 changes: 8 additions & 6 deletions scripts/vulkaninfo_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
STRUCT_COMPARISONS_TO_GEN = ['VkSurfaceFormatKHR', 'VkSurfaceFormat2KHR', 'VkSurfaceCapabilitiesKHR',
'VkSurfaceCapabilities2KHR', 'VkSurfaceCapabilities2EXT']
# don't generate these structures
STRUCT_BLACKLIST = ['VkVideoProfileListInfoKHR', 'VkVideoProfileInfoKHR', 'VkDrmFormatModifierPropertiesListEXT', 'VkDrmFormatModifierPropertiesEXT', 'VkDrmFormatModifierPropertiesList2EXT']
STRUCT_BLACKLIST = ['VkVideoProfileListInfoKHR', 'VkVideoProfileInfoKHR', 'VkDrmFormatModifierPropertiesListEXT', 'VkDrmFormatModifierPropertiesEXT', 'VkDrmFormatModifierPropertiesList2EXT', 'VkPhysicalDeviceProtectedMemoryFeatures', 'VkPhysicalDeviceShaderDrawParametersFeatures', 'VkPhysicalDeviceSubgroupProperties', 'VkPhysicalDeviceProtectedMemoryProperties']

# generate these structures such that they only print when not in json mode (as json wants them separate)
PORTABILITY_STRUCTS = ['VkPhysicalDevicePortabilitySubsetFeaturesKHR', 'VkPhysicalDevicePortabilitySubsetPropertiesKHR']
Expand Down Expand Up @@ -804,8 +804,9 @@ def PrintChainStruct(listName, structures, all_structures, chain_details, extTyp
assert False, 'Should never get here'
if has_version:
if has_printed_condition:
out += '\n || '
out += f'{version_desc}.minor >= {str(version)}'
out += f'\n && {version_desc}.minor < {str(version)}'
else:
out += f'{version_desc}.minor >= {str(version)}'
out += ')\n '
else:
out += ' '
Expand Down Expand Up @@ -888,11 +889,12 @@ def PrintChainStruct(listName, structures, all_structures, chain_details, extTyp
out += f'inst.CheckExtensionEnabled({key})'
else:
assert False, 'Should never get here'
out += ')'
if has_version:
if has_printed_condition:
out += ' ||\n '
out += f'{version_desc}.minor >= {str(version)}'
out += ')'
out += f' &&\n {version_desc}.minor < {str(version)}'
else:
out += f'{version_desc}.minor >= {str(version)}'
out += ') {\n'
out += f' {s.name}* props = ({s.name}*)structure;\n'
out += f' Dump{s.name}(p, '
Expand Down
Loading

0 comments on commit 92c6268

Please sign in to comment.