Merge pull request #1093 from asuessenbach/disabled

Improve handling of disabled extensions.
This commit is contained in:
Andreas Süßenbach 2021-10-06 15:30:03 +02:00 committed by GitHub
commit 0799e35086
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12325,6 +12325,23 @@ void VulkanHppGenerator::readExtensionsExtension( tinyxml2::XMLElement const * e
{
int line = element->GetLineNum();
std::map<std::string, std::string> attributes = getAttributes( element );
std::vector<tinyxml2::XMLElement const *> children = getChildElements( element );
auto it = attributes.find( "supported" );
check( it != attributes.end(), line, "Missing attribute <supported> for extension!" );
if ( it->second == "disabled" )
{
checkElements( line, children, {}, { "require" } );
// kick out all the disabled stuff we've read before !!
for ( auto const & child : children )
{
assert( child->Value() == std::string( "require" ) );
readExtensionsExtensionDisabledRequire( child );
}
}
else
{
checkAttributes( line,
attributes,
{ { "name", {} }, { "number", {} }, { "supported", { "disabled", "enabled", "vulkan" } } },
@ -12341,7 +12358,6 @@ void VulkanHppGenerator::readExtensionsExtension( tinyxml2::XMLElement const * e
{ "sortorder", { "1" } },
{ "specialuse", { "cadsupport", "d3demulation", "debugging", "devtools", "glemulation" } },
{ "type", { "device", "instance" } } } );
std::vector<tinyxml2::XMLElement const *> children = getChildElements( element );
checkElements( line, children, { { "require", false } } );
std::string deprecatedBy, name, number, obsoletedBy, platform, promotedTo, supported;
@ -12404,20 +12420,10 @@ void VulkanHppGenerator::readExtensionsExtension( tinyxml2::XMLElement const * e
else if ( attribute.first == "supported" )
{
supported = attribute.second;
assert( supported != "disabled" );
}
}
if ( supported == "disabled" )
{
// kick out all the disabled stuff we've read before !!
for ( auto const & child : children )
{
assert( child->Value() == std::string( "require" ) );
readExtensionsExtensionDisabledRequire( child );
}
}
else
{
auto pitb = m_extensions.insert(
std::make_pair( name, ExtensionData( line, deprecatedBy, number, obsoletedBy, platform, promotedTo ) ) );
check( pitb.second, line, "already encountered extension <" + name + ">" );