mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2024-10-14 16:32:17 +00:00
Allow union attribute "selection" to have multiple comma-separted values.
This commit is contained in:
parent
aa2322efe3
commit
1173c9ab77
@ -1222,7 +1222,8 @@ void VulkanHppGenerator::checkStructMemberCorrectness( std::string const &
|
|||||||
{
|
{
|
||||||
// check that each union member has a selection, that is a value of the seleting enum
|
// check that each union member has a selection, that is a value of the seleting enum
|
||||||
assert( !unionMember.selection.empty() );
|
assert( !unionMember.selection.empty() );
|
||||||
std::string const & selection = unionMember.selection;
|
for ( auto const & selection : unionMember.selection )
|
||||||
|
{
|
||||||
checkForError( std::find_if( selectorEnumIt->second.values.begin(),
|
checkForError( std::find_if( selectorEnumIt->second.values.begin(),
|
||||||
selectorEnumIt->second.values.end(),
|
selectorEnumIt->second.values.end(),
|
||||||
[&selection]( EnumValueData const & evd ) { return evd.name == selection; } ) != selectorEnumIt->second.values.end(),
|
[&selection]( EnumValueData const & evd ) { return evd.name == selection; } ) != selectorEnumIt->second.values.end(),
|
||||||
@ -1231,6 +1232,7 @@ void VulkanHppGenerator::checkStructMemberCorrectness( std::string const &
|
|||||||
selectorIt->type.type + ">" );
|
selectorIt->type.type + ">" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// check that each member type is known
|
// check that each member type is known
|
||||||
checkForError( m_types.find( member.type.type ) != m_types.end(), member.xmlLine, "struct member uses unknown type <" + member.type.type + ">" );
|
checkForError( m_types.find( member.type.type ) != m_types.end(), member.xmlLine, "struct member uses unknown type <" + member.type.type + ">" );
|
||||||
@ -12897,7 +12899,7 @@ void VulkanHppGenerator::readTypesTypeStructMember( tinyxml2::XMLElement const *
|
|||||||
else if ( attribute.first == "selection" )
|
else if ( attribute.first == "selection" )
|
||||||
{
|
{
|
||||||
checkForError( isUnion, line, "attribute <selection> is used with a non-union structure." );
|
checkForError( isUnion, line, "attribute <selection> is used with a non-union structure." );
|
||||||
memberData.selection = attribute.second;
|
memberData.selection = tokenize( attribute.second, "," );
|
||||||
}
|
}
|
||||||
else if ( attribute.first == "selector" )
|
else if ( attribute.first == "selector" )
|
||||||
{
|
{
|
||||||
|
@ -295,7 +295,7 @@ private:
|
|||||||
std::vector<std::string> len;
|
std::vector<std::string> len;
|
||||||
bool noAutoValidity = false;
|
bool noAutoValidity = false;
|
||||||
std::vector<bool> optional;
|
std::vector<bool> optional;
|
||||||
std::string selection;
|
std::vector<std::string> selection;
|
||||||
std::string selector;
|
std::string selector;
|
||||||
std::string value;
|
std::string value;
|
||||||
std::string usedConstant;
|
std::string usedConstant;
|
||||||
|
Loading…
Reference in New Issue
Block a user