mirror of
https://github.com/KhronosGroup/Vulkan-Hpp
synced 2024-11-22 04:10:05 +00:00
Remove warning on "ratified" and "supported" being different for an extension. (#1728)
This commit is contained in:
parent
e86419f738
commit
846ac99cee
@ -13271,7 +13271,6 @@ void VulkanHppGenerator::readExtension( tinyxml2::XMLElement const * element )
|
|||||||
checkElements( line, children, { { "require", false } } );
|
checkElements( line, children, { { "require", false } } );
|
||||||
|
|
||||||
ExtensionData extensionData{ .xmlLine = line };
|
ExtensionData extensionData{ .xmlLine = line };
|
||||||
std::vector<std::string> ratified, supported;
|
|
||||||
for ( auto const & attribute : attributes )
|
for ( auto const & attribute : attributes )
|
||||||
{
|
{
|
||||||
if ( attribute.first == "depends" )
|
if ( attribute.first == "depends" )
|
||||||
@ -13363,11 +13362,11 @@ void VulkanHppGenerator::readExtension( tinyxml2::XMLElement const * element )
|
|||||||
}
|
}
|
||||||
else if ( attribute.first == "ratified" )
|
else if ( attribute.first == "ratified" )
|
||||||
{
|
{
|
||||||
ratified = tokenize( attribute.second, "," );
|
extensionData.ratified = tokenize( attribute.second, "," );
|
||||||
}
|
}
|
||||||
else if ( attribute.first == "supported" )
|
else if ( attribute.first == "supported" )
|
||||||
{
|
{
|
||||||
supported = tokenize( attribute.second, "," );
|
extensionData.supported = tokenize( attribute.second, "," );
|
||||||
}
|
}
|
||||||
else if ( attribute.first == "type" )
|
else if ( attribute.first == "type" )
|
||||||
{
|
{
|
||||||
@ -13375,18 +13374,16 @@ void VulkanHppGenerator::readExtension( tinyxml2::XMLElement const * element )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
checkForWarning( std::any_of( supported.begin(), supported.end(), []( std::string const & s ) { return s == "disabled"; } ) || extensionData.isDeprecated ||
|
bool extensionSupported =
|
||||||
ratified.empty() || ( supported == ratified ),
|
extensionData.supported.empty() ||
|
||||||
line,
|
std::any_of( extensionData.supported.begin(), extensionData.supported.end(), [this]( std::string const & s ) { return s == m_api; } );
|
||||||
"attribute \"ratified\" differs from attribute \"supported\"" );
|
|
||||||
bool extensionSupported = supported.empty() || std::any_of( supported.begin(), supported.end(), [this]( std::string const & s ) { return s == m_api; } );
|
|
||||||
checkForError( !extensionSupported || !extensionData.type.empty(), line, "missing attribute \"type\" for supported extension <" + extensionData.name + ">" );
|
checkForError( !extensionSupported || !extensionData.type.empty(), line, "missing attribute \"type\" for supported extension <" + extensionData.name + ">" );
|
||||||
for ( auto child : children )
|
for ( auto child : children )
|
||||||
{
|
{
|
||||||
readExtensionRequire( child, extensionData, extensionSupported );
|
readExtensionRequire( child, extensionData, extensionSupported );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( std::none_of( supported.begin(), supported.end(), []( std::string const & s ) { return s == "disabled"; } ) )
|
if ( std::none_of( extensionData.supported.begin(), extensionData.supported.end(), []( std::string const & s ) { return s == "disabled"; } ) )
|
||||||
{
|
{
|
||||||
// extract the tag from the name, which is supposed to look like VK_<tag>_<other>
|
// extract the tag from the name, which is supposed to look like VK_<tag>_<other>
|
||||||
size_t tagStart = extensionData.name.find( '_' );
|
size_t tagStart = extensionData.name.find( '_' );
|
||||||
|
@ -238,7 +238,9 @@ private:
|
|||||||
std::string platform = {};
|
std::string platform = {};
|
||||||
std::string promotedTo = {};
|
std::string promotedTo = {};
|
||||||
std::map<std::string, std::vector<std::vector<std::string>>> depends = {};
|
std::map<std::string, std::vector<std::vector<std::string>>> depends = {};
|
||||||
|
std::vector<std::string> ratified = {};
|
||||||
std::vector<RequireData> requireData = {};
|
std::vector<RequireData> requireData = {};
|
||||||
|
std::vector<std::string> supported = {};
|
||||||
std::string type = {};
|
std::string type = {};
|
||||||
int xmlLine = 0;
|
int xmlLine = 0;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user