From 4e6e8d3fda12aa70fd1d3c08cbeee092d5ebb19a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=BC=C3=9Fenbach?= Date: Thu, 5 Sep 2024 17:44:31 +0200 Subject: [PATCH] Add support for multiply aliased structs in - tags. (#1958) --- VulkanHppGenerator.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index d3de0b0..b20c08c 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -580,8 +580,8 @@ ${macros} #endif)"; - std::string str = replaceWithMap( - macrosTemplate, + std::string str = + replaceWithMap( macrosTemplate, { { "licenseHeader", m_vulkanLicenseHeader }, { "macros", replaceWithMap( readSnippet( "macros.hpp" ), @@ -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 ) // { @@ -14539,6 +14539,17 @@ VulkanHppGenerator::RequireFeature VulkanHppGenerator::readRequireFeature( tinyx auto aliasIt = std::find_if( m_structsAliases.begin(), m_structsAliases.end(), [&structure]( std::pair 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 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() ); }