From 600e6d67a24653e2b66bf920e8b91db9af007ada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=BC=C3=9Fenbach?= Date: Wed, 12 Jun 2024 13:52:23 +0200 Subject: [PATCH] Relax check for commands listed as required for a feature to just check if it's required for a different feature (#1896) --- VulkanHppGenerator.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index 600198e..e4f2154 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -8706,16 +8706,19 @@ std::string VulkanHppGenerator::generateRAIIHandleCommandDeclarations( std::pair else if ( handle.second.secondLevelCommands.contains( command.first ) ) { auto listedIt = listedCommands.find( command.first ); - if ( listedIt != listedCommands.end() ) + if ( listedIt == listedCommands.end() ) { - checkForError( false, + listedCommands.insert( { command.first, { feature.name, command.second } } ); + assert( !handle.first.empty() ); + secondLevelCommands.push_back( command.first ); + } + else + { + checkForError( listedIt->second.first == feature.name, command.second, "command <" + command.first + "> already listed as required for feature <" + listedIt->second.first + "> on line " + std::to_string( listedIt->second.second ) ); } - listedCommands.insert( { command.first, { feature.name, command.second } } ); - assert( !handle.first.empty() ); - secondLevelCommands.push_back( command.first ); } } }