Skip to content

Commit

Permalink
Add support for multiply aliased structs in <require>-<feature> tags. (
Browse files Browse the repository at this point in the history
  • Loading branch information
asuessenbach authored Sep 5, 2024
1 parent 6abd3f4 commit 4e6e8d3
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions VulkanHppGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,8 @@ void VulkanHppGenerator::generateMacrosFile() const

#endif)";

std::string str = replaceWithMap(
macrosTemplate,
std::string str =
replaceWithMap( macrosTemplate,
{ { "licenseHeader", m_vulkanLicenseHeader },
{ "macros",
replaceWithMap( readSnippet( "macros.hpp" ),
Expand Down Expand Up @@ -1437,7 +1437,7 @@ void VulkanHppGenerator::checkFeatureCorrectness() const
{
// check that each require depends actually is an extension
// remove this check temporarily !
//for ( auto const & feature : m_features )
// for ( auto const & feature : m_features )
//{
// for ( auto const & require : feature.requireData )
// {
Expand Down Expand Up @@ -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() );
}
Expand Down

0 comments on commit 4e6e8d3

Please sign in to comment.