Merge pull request #864 from asuessenbach/disabled

Remove error checks on unknown enums for disabled extensions.
This commit is contained in:
Andreas Süßenbach 2021-01-22 13:19:49 +01:00 committed by GitHub
commit 1df2022af8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 46 deletions

View File

@ -8117,7 +8117,7 @@ void VulkanHppGenerator::readExtension( tinyxml2::XMLElement const * element )
// kick out all the disabled stuff we've read before !!
for ( auto const & child : children )
{
readExtensionDisabledRequire( name, child );
readExtensionDisabledRequire( child );
}
}
else
@ -8162,48 +8162,7 @@ void VulkanHppGenerator::readExtensionDisabledCommand( tinyxml2::XMLElement cons
}
}
void VulkanHppGenerator::readExtensionDisabledEnum( std::string const & extensionName,
tinyxml2::XMLElement const * element )
{
int line = element->GetLineNum();
std::map<std::string, std::string> attributes = getAttributes( element );
checkAttributes(
line,
attributes,
{ { "name", {} } },
{ { "alias", {} }, { "bitpos", {} }, { "extends", {} }, { "extnumber", {} }, { "offset", {} }, { "value", {} } } );
checkElements( line, getChildElements( element ), {} );
std::string extends, name;
for ( auto const & attribute : attributes )
{
if ( attribute.first == "extends" )
{
extends = attribute.second;
}
else if ( attribute.first == "name" )
{
name = attribute.second;
}
}
if ( !extends.empty() )
{
auto enumIt = m_enums.find( extends );
check( enumIt != m_enums.end(),
line,
"disabled extension <" + extensionName + "> references unknown enum <" + extends + ">" );
check( std::find_if( enumIt->second.values.begin(),
enumIt->second.values.end(),
[&name]( EnumValueData const & evd ) { return evd.vulkanValue == name; } ) ==
enumIt->second.values.end(),
line,
"disabled extension <" + extensionName + "> references known enum value <" + name + ">" );
}
}
void VulkanHppGenerator::readExtensionDisabledRequire( std::string const & extensionName,
tinyxml2::XMLElement const * element )
void VulkanHppGenerator::readExtensionDisabledRequire( tinyxml2::XMLElement const * element )
{
int line = element->GetLineNum();
checkAttributes( line, getAttributes( element ), {}, {} );
@ -8223,7 +8182,7 @@ void VulkanHppGenerator::readExtensionDisabledRequire( std::string const &
}
else if ( value == "enum" )
{
readExtensionDisabledEnum( extensionName, child );
// just skip enums of disabled extensions
}
else
{

View File

@ -711,8 +711,7 @@ private:
void readEnums( tinyxml2::XMLElement const * element );
void readExtension( tinyxml2::XMLElement const * element );
void readExtensionDisabledCommand( tinyxml2::XMLElement const * element );
void readExtensionDisabledEnum( std::string const & extensionName, tinyxml2::XMLElement const * element );
void readExtensionDisabledRequire( std::string const & extensionName, tinyxml2::XMLElement const * element );
void readExtensionDisabledRequire( tinyxml2::XMLElement const * element );
void readExtensionDisabledType( tinyxml2::XMLElement const * element );
void readExtensionRequire( tinyxml2::XMLElement const * element,
std::string const & extension,