diff options
| author | ziga-lunarg <ziga@lunarg.com> | 2023-12-02 19:59:08 +0100 |
|---|---|---|
| committer | ziga-lunarg <87310389+ziga-lunarg@users.noreply.github.com> | 2023-12-02 21:12:56 +0100 |
| commit | 67cda9672b97daa9a3eb6d74639e5d87dd6ef463 (patch) | |
| tree | 1d7d4bf31d53e15a00a0cdb09a1f3fd529eba709 /scripts | |
| parent | 8718f7f80506b4377d1a37608b532c7c3c54c685 (diff) | |
| download | usermoji-67cda9672b97daa9a3eb6d74639e5d87dd6ef463.tar.xz | |
vulkaninfo: Fix including promoted structures
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/vulkaninfo_generator.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/scripts/vulkaninfo_generator.py b/scripts/vulkaninfo_generator.py index 0ee119f7..7b623cb0 100644 --- a/scripts/vulkaninfo_generator.py +++ b/scripts/vulkaninfo_generator.py @@ -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: @@ -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 += ' ' @@ -881,7 +885,10 @@ void setup_{listName}_chain({chain_details['holder_type']}& start, std::unique_p 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: @@ -890,8 +897,9 @@ void setup_{listName}_chain({chain_details['holder_type']}& start, std::unique_p 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' |
