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 5fa6889
Show file tree
Hide file tree
Showing 4 changed files with 248 additions and 204 deletions.
20 changes: 14 additions & 6 deletions scripts/vulkaninfo_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,10 @@ def PrintChainStruct(listName, structures, all_structures, chain_details, extTyp
for key, value in extEnables.items():
if has_printed_condition:
out += '\n || '
has_printed_condition = True
else:
has_printed_condition = True
if has_version:
out += '('
if value == EXTENSION_TYPE_DEVICE:
out += f'gpu.CheckPhysicalDeviceExtensionIncluded({key})'
elif value == EXTENSION_TYPE_INSTANCE:
Expand All @@ -804,8 +807,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 @@ -881,7 +885,10 @@ def PrintChainStruct(listName, structures, all_structures, chain_details, extTyp
for key, value in extEnables.items():
if has_printed_condition:
out += ' || '
has_printed_condition = True
else:
has_printed_condition = True
if has_version:
out += '('
if value == EXTENSION_TYPE_DEVICE:
out += f'gpu.CheckPhysicalDeviceExtensionIncluded({key})'
elif value == EXTENSION_TYPE_INSTANCE:
Expand All @@ -890,8 +897,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 5fa6889

Please sign in to comment.