From 6bdba3ef3117a5dd5f406729d32bb4006c8ce6e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=BC=C3=9Fenbach?= Date: Mon, 5 Feb 2024 13:13:38 +0100 Subject: [PATCH] Add support for command argument attribute "len" with value "1". (#1789) --- VulkanHppGenerator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index 696d480..08d7672 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -2036,7 +2036,7 @@ std::map VulkanHppGenerator::determ // look for the parameters whose len equals the name of an other parameter for ( size_t i = 0; i < params.size(); i++ ) { - if ( !params[i].lenExpression.empty() && ( params[i].lenExpression != "null-terminated" ) ) + if ( !params[i].lenExpression.empty() && ( params[i].lenExpression != "null-terminated" ) && ( params[i].lenExpression != "1" ) ) { VectorParamData & vpd = vectorParams[i]; @@ -2914,7 +2914,7 @@ std::string VulkanHppGenerator::generateCallArgumentEnhancedNonConstPointer( Par { std::string argument; std::string name = startLowerCase( stripPrefix( param.name, "p" ) ); - if ( param.lenExpression.empty() ) + if ( param.lenExpression.empty() || ( param.lenExpression == "1" ) ) { assert( param.arraySizes.empty() ); if ( param.type.type.starts_with( "Vk" ) ) @@ -12813,7 +12813,7 @@ std::pair VulkanHppGenerator::readCommandPa } else { - checkForError( ( attribute.second == "null-terminated" ) || isLenByStructMember( attribute.second, params ), + checkForError( ( attribute.second == "null-terminated" ) || ( attribute.second == "1" ) || isLenByStructMember( attribute.second, params ), line, "attribute holds an unknown value <" + attribute.second + ">" ); }