From 33f2837650d4f57e1dbf6fb27c53548fca4b039d Mon Sep 17 00:00:00 2001 From: asuessenbach Date: Thu, 3 Nov 2022 17:26:18 +0100 Subject: [PATCH] Add support for handle creation functions taking createInfo structs that are not an anchor of a structure chain. --- VulkanHppGenerator.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index 26a1f49..43d178e 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -542,9 +542,8 @@ void VulkanHppGenerator::addCommand( std::string const & name, CommandData & com checkForError( m_commands.insert( std::make_pair( name, commandData ) ).second, commandData.xmlLine, "already encountered command <" + name + ">" ); // put the command into the handle's list of commands - checkForError( handleIt->second.commands.insert( name ).second, - commandData.xmlLine, - "command list of handle <" + handleIt->first + "> already holds a commnand <" + name + ">" ); + assert( handleIt->second.commands.find( name ) == handleIt->second.commands.end() ); + handleIt->second.commands.insert( name ); } void VulkanHppGenerator::addMissingFlagBits( std::vector & requireData, std::string const & referencedIn ) @@ -1885,7 +1884,6 @@ std::string VulkanHppGenerator::generateArgumentListEnhanced( std::vector( &" + name + " )"; @@ -3541,7 +3538,8 @@ std::string VulkanHppGenerator::generateCommandResultSingleSuccessWithErrors1Ret { if ( commandData.params[vectorParams.begin()->second.lenParam].type.isValue() ) { - if ( isStructureChainAnchor( commandData.params[vectorParams.begin()->first].type.type ) ) + if ( ( commandData.params[vectorParams.begin()->first].type.type != "void" ) && + !isHandleType( commandData.params[vectorParams.begin()->first].type.type ) ) { return generateCommandSetStandardEnhancedWithAllocatorSingularUnique( definition, @@ -7033,7 +7031,8 @@ std::string VulkanHppGenerator::generateRAIIHandleCommandResultSingleSuccessWith { if ( commandIt->second.params[vectorParams.begin()->second.lenParam].type.type == "uint32_t" ) { - if ( isStructureChainAnchor( commandIt->second.params[vectorParams.begin()->first].type.type ) ) + if ( ( commandIt->second.params[vectorParams.begin()->first].type.type != "void" ) && + !isHandleType( commandIt->second.params[vectorParams.begin()->first].type.type ) ) { str = generateRAIIHandleCommandFactory( commandIt, initialSkipCount, { returnParam }, vectorParams, definition, false ); str += generateRAIIHandleCommandFactory( commandIt, initialSkipCount, { returnParam }, vectorParams, definition, true ); @@ -7225,7 +7224,8 @@ std::pair { if ( constructorIt->second.params[vectorParams.begin()->second.lenParam].type.type == "uint32_t" ) { - if ( isStructureChainAnchor( constructorIt->second.params[vectorParams.begin()->first].type.type ) ) + if ( ( constructorIt->second.params[vectorParams.begin()->first].type.type != "void" ) && + !isHandleType( constructorIt->second.params[vectorParams.begin()->first].type.type ) ) { std::string singularConstructor; auto lenParamIt = constructorIt->second.params.begin() + vectorParams.begin()->second.lenParam;