Add support for multiply aliased structs in <require>-<feature> tags. (#1958)
Some checks failed
Set Version Tag / set-version-tag (push) Has been cancelled

This commit is contained in:
Andreas Süßenbach 2024-09-05 17:44:31 +02:00 committed by GitHub
parent 6abd3f42a8
commit 4e6e8d3fda
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -580,8 +580,8 @@ ${macros}
#endif)";
std::string str = replaceWithMap(
macrosTemplate,
std::string str =
replaceWithMap( macrosTemplate,
{ { "licenseHeader", m_vulkanLicenseHeader },
{ "macros",
replaceWithMap( readSnippet( "macros.hpp" ),
@ -14539,6 +14539,17 @@ VulkanHppGenerator::RequireFeature VulkanHppGenerator::readRequireFeature( tinyx
auto aliasIt = std::find_if(
m_structsAliases.begin(), m_structsAliases.end(), [&structure]( std::pair<std::string, AliasData> const & ad ) { return ad.first == structure; } );
checkForError( aliasIt != m_structsAliases.end(), line, "encountered unknown required feature struct <" + structure + ">" );
auto nextAliasIt = aliasIt;
do
{
nextAliasIt = std::find_if( m_structsAliases.begin(),
m_structsAliases.end(),
[&structure = aliasIt->second.name]( std::pair<std::string, AliasData> const & ad ) { return ad.first == structure; } );
if ( nextAliasIt != m_structsAliases.end() )
{
aliasIt = nextAliasIt;
}
} while ( nextAliasIt != m_structsAliases.end() );
structIt = m_structs.find( aliasIt->second.name );
assert( structIt != m_structs.end() );
}