From 846ac99ceeb4e4ec671668b1914c45bf60a150ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=BC=C3=9Fenbach?= Date: Tue, 14 Nov 2023 16:50:41 +0100 Subject: [PATCH] Remove warning on "ratified" and "supported" being different for an extension. (#1728) --- VulkanHppGenerator.cpp | 15 ++++++--------- VulkanHppGenerator.hpp | 2 ++ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index afc600a..b097436 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -13271,7 +13271,6 @@ void VulkanHppGenerator::readExtension( tinyxml2::XMLElement const * element ) checkElements( line, children, { { "require", false } } ); ExtensionData extensionData{ .xmlLine = line }; - std::vector ratified, supported; for ( auto const & attribute : attributes ) { if ( attribute.first == "depends" ) @@ -13363,11 +13362,11 @@ void VulkanHppGenerator::readExtension( tinyxml2::XMLElement const * element ) } else if ( attribute.first == "ratified" ) { - ratified = tokenize( attribute.second, "," ); + extensionData.ratified = tokenize( attribute.second, "," ); } else if ( attribute.first == "supported" ) { - supported = tokenize( attribute.second, "," ); + extensionData.supported = tokenize( attribute.second, "," ); } 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 || - ratified.empty() || ( supported == ratified ), - line, - "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; } ); + bool extensionSupported = + extensionData.supported.empty() || + std::any_of( extensionData.supported.begin(), extensionData.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 + ">" ); for ( auto child : children ) { 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__ size_t tagStart = extensionData.name.find( '_' ); diff --git a/VulkanHppGenerator.hpp b/VulkanHppGenerator.hpp index 7d3732c..f3ac261 100644 --- a/VulkanHppGenerator.hpp +++ b/VulkanHppGenerator.hpp @@ -238,7 +238,9 @@ private: std::string platform = {}; std::string promotedTo = {}; std::map>> depends = {}; + std::vector ratified = {}; std::vector requireData = {}; + std::vector supported = {}; std::string type = {}; int xmlLine = 0; };