Add support for command argument attribute "len" with value "1". (#1789)

This commit is contained in:
Andreas Süßenbach 2024-02-05 13:13:38 +01:00 committed by GitHub
parent fdf975364b
commit 6bdba3ef31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2036,7 +2036,7 @@ std::map<size_t, VulkanHppGenerator::VectorParamData> VulkanHppGenerator::determ
// look for the parameters whose len equals the name of an other parameter // look for the parameters whose len equals the name of an other parameter
for ( size_t i = 0; i < params.size(); i++ ) 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]; VectorParamData & vpd = vectorParams[i];
@ -2914,7 +2914,7 @@ std::string VulkanHppGenerator::generateCallArgumentEnhancedNonConstPointer( Par
{ {
std::string argument; std::string argument;
std::string name = startLowerCase( stripPrefix( param.name, "p" ) ); std::string name = startLowerCase( stripPrefix( param.name, "p" ) );
if ( param.lenExpression.empty() ) if ( param.lenExpression.empty() || ( param.lenExpression == "1" ) )
{ {
assert( param.arraySizes.empty() ); assert( param.arraySizes.empty() );
if ( param.type.type.starts_with( "Vk" ) ) if ( param.type.type.starts_with( "Vk" ) )
@ -12813,7 +12813,7 @@ std::pair<bool, VulkanHppGenerator::ParamData> VulkanHppGenerator::readCommandPa
} }
else else
{ {
checkForError( ( attribute.second == "null-terminated" ) || isLenByStructMember( attribute.second, params ), checkForError( ( attribute.second == "null-terminated" ) || ( attribute.second == "1" ) || isLenByStructMember( attribute.second, params ),
line, line,
"attribute <len> holds an unknown value <" + attribute.second + ">" ); "attribute <len> holds an unknown value <" + attribute.second + ">" );
} }