Improve handling of disabled extensions.
This commit is contained in:
parent
511437e473
commit
fadacdf87b
@ -12107,6 +12107,23 @@ void VulkanHppGenerator::readExtensionsExtension( tinyxml2::XMLElement const * e
|
|||||||
{
|
{
|
||||||
int line = element->GetLineNum();
|
int line = element->GetLineNum();
|
||||||
std::map<std::string, std::string> attributes = getAttributes( element );
|
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,
|
checkAttributes( line,
|
||||||
attributes,
|
attributes,
|
||||||
{ { "name", {} }, { "number", {} }, { "supported", { "disabled", "enabled", "vulkan" } } },
|
{ { "name", {} }, { "number", {} }, { "supported", { "disabled", "enabled", "vulkan" } } },
|
||||||
@ -12123,7 +12140,6 @@ void VulkanHppGenerator::readExtensionsExtension( tinyxml2::XMLElement const * e
|
|||||||
{ "sortorder", { "1" } },
|
{ "sortorder", { "1" } },
|
||||||
{ "specialuse", { "cadsupport", "d3demulation", "debugging", "devtools", "glemulation" } },
|
{ "specialuse", { "cadsupport", "d3demulation", "debugging", "devtools", "glemulation" } },
|
||||||
{ "type", { "device", "instance" } } } );
|
{ "type", { "device", "instance" } } } );
|
||||||
std::vector<tinyxml2::XMLElement const *> children = getChildElements( element );
|
|
||||||
checkElements( line, children, { { "require", false } } );
|
checkElements( line, children, { { "require", false } } );
|
||||||
|
|
||||||
std::string deprecatedBy, name, number, obsoletedBy, platform, promotedTo, supported;
|
std::string deprecatedBy, name, number, obsoletedBy, platform, promotedTo, supported;
|
||||||
@ -12186,20 +12202,10 @@ void VulkanHppGenerator::readExtensionsExtension( tinyxml2::XMLElement const * e
|
|||||||
else if ( attribute.first == "supported" )
|
else if ( attribute.first == "supported" )
|
||||||
{
|
{
|
||||||
supported = attribute.second;
|
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(
|
auto pitb = m_extensions.insert(
|
||||||
std::make_pair( name, ExtensionData( line, deprecatedBy, number, obsoletedBy, platform, promotedTo ) ) );
|
std::make_pair( name, ExtensionData( line, deprecatedBy, number, obsoletedBy, platform, promotedTo ) ) );
|
||||||
check( pitb.second, line, "already encountered extension <" + name + ">" );
|
check( pitb.second, line, "already encountered extension <" + name + ">" );
|
||||||
@ -17045,8 +17051,8 @@ extern "C" __declspec( dllimport ) FARPROC __stdcall GetProcAddress( HINSTANCE h
|
|||||||
tinyxml2::XMLError error = doc.LoadFile( filename.c_str() );
|
tinyxml2::XMLError error = doc.LoadFile( filename.c_str() );
|
||||||
if ( error != tinyxml2::XML_SUCCESS )
|
if ( error != tinyxml2::XML_SUCCESS )
|
||||||
{
|
{
|
||||||
std::cout << "VulkanHppGenerator: failed to load file " << filename << " with error <" << toString( error )
|
std::cout << "VulkanHppGenerator: failed to load file " << filename << " with error <" << toString( error ) << ">"
|
||||||
<< ">" << std::endl;
|
<< std::endl;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user