From 3e1e9b465363bebb186bcbe4454ec3cf8d22e77c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=BC=C3=9Fenbach?= Date: Tue, 26 Sep 2023 12:02:43 +0200 Subject: [PATCH] Add support of commands returning void and getting two simple data type values. (#1663) --- VulkanHppGenerator.cpp | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index 0636d93..02dfded 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -4723,12 +4723,32 @@ std::string VulkanHppGenerator::generateCommandVoid2Return( std::string const & std::vector const & returnParams, bool raii ) const { - if ( commandData.params[returnParams[0]].type.type == "uint32_t" ) + std::map vectorParams = determineVectorParams( commandData.params ); + switch ( vectorParams.size() ) { - std::map vectorParams = determineVectorParams( commandData.params ); - if ( vectorParams.size() == 1 ) - { - if ( returnParams[0] == vectorParams.begin()->second.lenParam ) + case 0: + if ( ( commandData.params[returnParams[0]].type.type != "void" ) && !isHandleType( commandData.params[returnParams[0]].type.type ) && + !isStructureChainAnchor( commandData.params[returnParams[0]].type.type ) ) + { + if ( ( commandData.params[returnParams[1]].type.type != "void" ) && !isHandleType( commandData.params[returnParams[1]].type.type ) && + !isStructureChainAnchor( commandData.params[returnParams[1]].type.type ) ) + { + return generateCommandSetInclusive( name, + commandData, + initialSkipCount, + definition, + returnParams, + vectorParams, + false, + { CommandFlavourFlagBits::enhanced }, + raii, + false, + { CommandFlavourFlagBits::enhanced } ); + } + } + break; + case 1: + if ( ( returnParams[0] == vectorParams.begin()->second.lenParam ) && ( commandData.params[returnParams[0]].type.type == "uint32_t" ) ) { if ( returnParams[1] == vectorParams.begin()->first ) { @@ -4765,7 +4785,8 @@ std::string VulkanHppGenerator::generateCommandVoid2Return( std::string const & } } } - } + break; + default: break; } return ""; }