Relax check on "depends" for extension requires. (#1637)

This commit is contained in:
Andreas Süßenbach 2023-08-10 10:35:19 +02:00 committed by GitHub
parent 87936f9bc8
commit e2f5348e28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 15 deletions

View File

@ -1300,10 +1300,11 @@ void VulkanHppGenerator::checkExtensionCorrectness() const
{
if ( !require.depends.empty() )
{
for ( auto const & depends : require.depends )
std::vector<std::string> depends = tokenizeAny( require.depends, ",+()" );
for ( auto const & depend : depends )
{
checkForError(
isFeature( depends ) || isExtension( depends ), require.xmlLine, "extension <" + extension.name + "> lists an unknown depends <" + depends + ">" );
isFeature( depend ) || isExtension( depend ), require.xmlLine, "extension <" + extension.name + "> lists an unknown depends <" + depend + ">" );
}
}
}
@ -12672,18 +12673,12 @@ void VulkanHppGenerator::readExtensionRequire( tinyxml2::XMLElement const * elem
else if ( attribute.first == "depends" )
{
assert( requireData.depends.empty() );
requireData.depends = tokenizeAny( attribute.second, ",+" );
for ( auto const & d : requireData.depends )
{
checkForError( std::none_of( extensionData.requireData.begin(),
extensionData.requireData.end(),
[&d]( RequireData const & rd ) {
return std::any_of(
rd.depends.begin(), rd.depends.end(), [&d]( std::string const & requireDepends ) { return requireDepends == d; } );
} ),
line,
"required extension <" + d + "> already listed" );
}
requireData.depends = attribute.second;
checkForError( std::none_of( extensionData.requireData.begin(),
extensionData.requireData.end(),
[&requireData]( RequireData const & rd ) { return rd.depends == requireData.depends; } ),
line,
"required extension <" + requireData.depends + "> already listed" );
}
}

View File

@ -202,7 +202,7 @@ private:
struct RequireData
{
std::vector<std::string> depends = {};
std::string depends = {};
std::vector<std::string> commands = {};
std::vector<std::string> constants = {};
std::vector<std::string> types = {};