diff options
| author | Máté Ferenc Nagy-Egri <mate@rastergrid.com> | 2024-09-26 13:53:05 +0200 |
|---|---|---|
| committer | Charles Giessen <46324611+charles-lunarg@users.noreply.github.com> | 2024-09-26 08:40:50 -0600 |
| commit | 29fb03034ad154327f7c8f871fecb40050179a45 (patch) | |
| tree | a7789e549f2b6524c32f56c7ead993fcb160e748 /scripts | |
| parent | 4c63e845962ff3b197855f3ae4907a47d0863f5a (diff) | |
| download | usermoji-29fb03034ad154327f7c8f871fecb40050179a45.tar.xz | |
Fix twocall_chain_vectors mechanism
Instead of unconditionally querying properties twice,
only call the query again if the given output struct has array members.
Also fix the case where if there are no output structs with array properties (VulkanSC),
then don't end up with unresolved external symbols.
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/vulkaninfo_generator.py | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/scripts/vulkaninfo_generator.py b/scripts/vulkaninfo_generator.py index 46125f98..e4cdd1e9 100644 --- a/scripts/vulkaninfo_generator.py +++ b/scripts/vulkaninfo_generator.py @@ -901,19 +901,10 @@ void setup_{listName}_chain({chain_details['holder_type']}& start, std::unique_p out += ' }\n' out += '}\n' - should_print_twocall_func = False - for s in structs_to_print: - if not s.hasLengthmember: - continue - if s.name in STRUCT_BLACKLIST: - continue - should_print_twocall_func = True - - if not should_print_twocall_func: - return out - out += '\n' - out += f'void prepare_{listName}_twocall_chain_vectors(std::unique_ptr<{listName}_chain>& chain) {{\n' + out += f'bool prepare_{listName}_twocall_chain_vectors(std::unique_ptr<{listName}_chain>& chain) {{\n' + out += ' (void)chain;\n' + is_twocall = False for s in structs_to_print: if not s.hasLengthmember: continue @@ -925,6 +916,8 @@ void setup_{listName}_chain({chain_details['holder_type']}& start, std::unique_p out += f' chain->{s.name}_{member.name}.resize(chain->{s.name[2:]}.{member.arrayLength});\n' out += f' chain->{s.name[2:]}.{member.name} = chain->{s.name}_{member.name}.data();\n' out += AddGuardFooter(s) + is_twocall = True + out += f' return {"true" if is_twocall else "false"};\n' out += '}\n' return out |
