mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2024-10-14 16:32:17 +00:00
Add support for comma-separated list of names for attribute "extension" of element <require> in element <extension>.
This commit is contained in:
parent
86cc8f2ed1
commit
49a2fc679a
@ -1681,9 +1681,15 @@ void VulkanHppGenerator::checkExtensionCorrectness() const
|
||||
// check for existence of any requirement
|
||||
for ( auto const & require : extension.second.requireData )
|
||||
{
|
||||
check( require.title.empty() || ( m_features.find( require.title ) != m_features.end() ) || ( m_extensions.find( require.title ) != m_extensions.end() ),
|
||||
require.xmlLine,
|
||||
"extension <" + extension.first + "> lists an unknown require <" + require.title + ">" );
|
||||
if ( !require.titles.empty() )
|
||||
{
|
||||
for ( auto const & title : require.titles )
|
||||
{
|
||||
check( ( m_features.find( title ) != m_features.end() ) || ( m_extensions.find( title ) != m_extensions.end() ),
|
||||
require.xmlLine,
|
||||
"extension <" + extension.first + "> lists an unknown require <" + title + ">" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -11062,7 +11068,9 @@ void VulkanHppGenerator::readExtensionsExtensionRequire( tinyxml2::XMLElement co
|
||||
requireTitle = attribute.second;
|
||||
check( std::find_if( extensionIt->second.requireData.begin(),
|
||||
extensionIt->second.requireData.end(),
|
||||
[&requireTitle]( RequireData const & rd ) { return rd.title == requireTitle; } ) == extensionIt->second.requireData.end(),
|
||||
[&requireTitle]( RequireData const & rd ) {
|
||||
return std::find( rd.titles.begin(), rd.titles.end(), requireTitle ) != rd.titles.end();
|
||||
} ) == extensionIt->second.requireData.end(),
|
||||
line,
|
||||
"required extension <" + requireTitle + "> already listed" );
|
||||
}
|
||||
@ -12910,6 +12918,8 @@ std::string VulkanHppGenerator::TypeInfo::compose( std::string const & nameSpace
|
||||
( postfix.empty() ? "" : " " ) + postfix;
|
||||
}
|
||||
|
||||
VulkanHppGenerator::RequireData::RequireData( int line, std::string const & titles_ ) : titles( tokenize( titles_, "," ) ), xmlLine( line ) {}
|
||||
|
||||
//
|
||||
// VulkanHppGenerator local functions
|
||||
//
|
||||
|
@ -177,9 +177,9 @@ private:
|
||||
|
||||
struct RequireData
|
||||
{
|
||||
RequireData( int line, std::string const & title_ ) : title( title_ ), xmlLine( line ) {}
|
||||
RequireData( int line, std::string const & titles_ );
|
||||
|
||||
std::string title;
|
||||
std::vector<std::string> titles;
|
||||
std::vector<std::string> commands;
|
||||
std::vector<std::string> types;
|
||||
int xmlLine;
|
||||
|
Loading…
Reference in New Issue
Block a user