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 aa1cad9
Show file tree
Hide file tree
Showing 4 changed files with 194 additions and 219 deletions.
12 changes: 7 additions & 5 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 @@ -890,8 +891,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 += ')'
out += ') {\n'
out += f' {s.name}* props = ({s.name}*)structure;\n'
Expand Down
Loading

0 comments on commit aa1cad9

Please sign in to comment.