mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2024-10-14 16:32:17 +00:00
Add filter for identical alias enum values
This commit is contained in:
parent
6f6a950a30
commit
dc1a7ce93e
@ -4122,10 +4122,11 @@ void VulkanHppGenerator::EnumData::addEnumAlias( int line,
|
||||
std::string const & vkName )
|
||||
{
|
||||
// check that the aliasName is either a known enum value or at least a known alias
|
||||
check( (std::find_if( values.begin(),
|
||||
values.end(),
|
||||
[&aliasName]( EnumValueData const & evd ) { return evd.vulkanValue == aliasName; } ) !=
|
||||
values.end()) || (aliases.find(aliasName) != aliases.end()),
|
||||
check( ( std::find_if( values.begin(),
|
||||
values.end(),
|
||||
[&aliasName]( EnumValueData const & evd ) { return evd.vulkanValue == aliasName; } ) !=
|
||||
values.end() ) ||
|
||||
( aliases.find( aliasName ) != aliases.end() ),
|
||||
line,
|
||||
"unknown enum alias <" + aliasName + ">" );
|
||||
|
||||
@ -4134,7 +4135,16 @@ void VulkanHppGenerator::EnumData::addEnumAlias( int line,
|
||||
line,
|
||||
"enum alias <" + name + "> already listed for a different enum value" );
|
||||
|
||||
aliases.insert( std::make_pair( name, std::make_pair( aliasName, vkName ) ) );
|
||||
// only list aliases that map to different vkNames
|
||||
aliasIt = std::find_if( aliases.begin(),
|
||||
aliases.end(),
|
||||
[&vkName]( std::pair<std::string, std::pair<std::string, std::string>> const & aliasEntry ) {
|
||||
return vkName == aliasEntry.second.second;
|
||||
} );
|
||||
if ( aliasIt == aliases.end() )
|
||||
{
|
||||
aliases.insert( std::make_pair( name, std::make_pair( aliasName, vkName ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
void VulkanHppGenerator::EnumData::addEnumValue( int line,
|
||||
|
Loading…
Reference in New Issue
Block a user