Unify command set handling.

This commit is contained in:
asuessenbach 2022-11-29 09:18:43 +01:00
parent 2600b6d436
commit 561354a79b
4 changed files with 1383 additions and 1590 deletions

View File

@ -3131,8 +3131,8 @@ std::string VulkanHppGenerator::generateCommandResultMultiSuccessNoErrors0Return
std::vector<size_t> constPointerParams = determineConstPointerParams( commandData.params ); std::vector<size_t> constPointerParams = determineConstPointerParams( commandData.params );
if ( constPointerParams.empty() ) if ( constPointerParams.empty() )
{ {
return generateCommandSetStandardOrEnhanced( generateCommandStandard( name, commandData, initialSkipCount, definition ), return generateCommandSet( generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, {}, {} ) ); generateCommandEnhanced( name, commandData, initialSkipCount, definition, {}, {} ) );
} }
} }
return ""; return "";
@ -3155,11 +3155,12 @@ std::string VulkanHppGenerator::generateCommandResultMultiSuccessNoErrors2Return
{ {
if ( returnParams[1] == vectorParams.begin()->first ) if ( returnParams[1] == vectorParams.begin()->first )
{ {
return generateCommandSetStandardEnhancedWithAllocator( return generateCommandSet(
definition, definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams ), { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams, CommandFlavourFlagBits::withAllocator ) ); generateCommandEnhanced(
name, commandData, initialSkipCount, definition, vectorParams, returnParams, CommandFlavourFlagBits::withAllocator ) } );
} }
} }
} }
@ -3197,11 +3198,11 @@ std::string VulkanHppGenerator::generateCommandResultMultiSuccessWithErrors1Retu
{ {
if ( commandData.params[vectorParams.begin()->second.lenParam].type.isValue() ) if ( commandData.params[vectorParams.begin()->second.lenParam].type.isValue() )
{ {
return generateCommandSetStandardEnhancedSingular( return generateCommandSet(
definition, definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ), { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::singular ) ); generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::singular ) } );
} }
} }
} }
@ -3219,28 +3220,28 @@ std::string VulkanHppGenerator::generateCommandResultMultiSuccessWithErrors1Retu
{ {
if ( isStructureChainAnchor( commandData.params[vectorParams.begin()->first].type.type ) ) if ( isStructureChainAnchor( commandData.params[vectorParams.begin()->first].type.type ) )
{ {
return generateCommandSetStandardEnhancedWithAllocatorSingularUnique( return generateCommandSet(
definition, definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ), { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ),
generateCommandEnhanced( generateCommandEnhanced(
name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::withAllocator ), name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::withAllocator ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::singular ), generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::singular ) },
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::unique ), { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::unique ),
generateCommandEnhanced( name, generateCommandEnhanced( name,
commandData, commandData,
initialSkipCount, initialSkipCount,
definition, definition,
vectorParams, vectorParams,
{ returnParam }, { returnParam },
CommandFlavourFlagBits::unique | CommandFlavourFlagBits::withAllocator ), CommandFlavourFlagBits::unique | CommandFlavourFlagBits::withAllocator ),
generateCommandEnhanced( name, generateCommandEnhanced( name,
commandData, commandData,
initialSkipCount, initialSkipCount,
definition, definition,
vectorParams, vectorParams,
{ returnParam }, { returnParam },
CommandFlavourFlagBits::unique | CommandFlavourFlagBits::singular ) ); CommandFlavourFlagBits::unique | CommandFlavourFlagBits::singular ) } );
} }
} }
} }
@ -3252,11 +3253,11 @@ std::string VulkanHppGenerator::generateCommandResultMultiSuccessWithErrors1Retu
std::map<size_t, VectorParamData> vectorParams = determineVectorParams( commandData.params ); std::map<size_t, VectorParamData> vectorParams = determineVectorParams( commandData.params );
if ( vectorParams.empty() ) if ( vectorParams.empty() )
{ {
return generateCommandSetStandardEnhancedChained( return generateCommandSet(
definition, definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ), { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::chained ) ); generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::chained ) } );
} }
} }
else else
@ -3264,9 +3265,9 @@ std::string VulkanHppGenerator::generateCommandResultMultiSuccessWithErrors1Retu
std::map<size_t, VectorParamData> vectorParams = determineVectorParams( commandData.params ); std::map<size_t, VectorParamData> vectorParams = determineVectorParams( commandData.params );
if ( vectorParams.empty() ) if ( vectorParams.empty() )
{ {
return generateCommandSetStandardEnhanced( definition, return generateCommandSet( definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ) ); { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ) } );
} }
} }
return ""; return "";
@ -3288,19 +3289,19 @@ std::string VulkanHppGenerator::generateCommandResultMultiSuccessWithErrors2Retu
{ {
if ( returnParams[1] == vectorParams.begin()->first ) if ( returnParams[1] == vectorParams.begin()->first )
{ {
return generateCommandSetStandardEnhancedWithAllocatorChained( return generateCommandSet(
definition, definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams ), { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams, CommandFlavourFlagBits::withAllocator ), generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams, CommandFlavourFlagBits::withAllocator ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams, CommandFlavourFlagBits::chained ), generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams, CommandFlavourFlagBits::chained ),
generateCommandEnhanced( name, generateCommandEnhanced( name,
commandData, commandData,
initialSkipCount, initialSkipCount,
definition, definition,
vectorParams, vectorParams,
returnParams, returnParams,
CommandFlavourFlagBits::chained | CommandFlavourFlagBits::withAllocator ) ); CommandFlavourFlagBits::chained | CommandFlavourFlagBits::withAllocator ) } );
} }
} }
} }
@ -3314,11 +3315,12 @@ std::string VulkanHppGenerator::generateCommandResultMultiSuccessWithErrors2Retu
{ {
if ( returnParams[1] == vectorParams.begin()->first ) if ( returnParams[1] == vectorParams.begin()->first )
{ {
return generateCommandSetStandardEnhancedWithAllocator( return generateCommandSet(
definition, definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams ), { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams, CommandFlavourFlagBits::withAllocator ) ); generateCommandEnhanced(
name, commandData, initialSkipCount, definition, vectorParams, returnParams, CommandFlavourFlagBits::withAllocator ) } );
} }
} }
} }
@ -3333,9 +3335,9 @@ std::string VulkanHppGenerator::generateCommandResultMultiSuccessWithErrors2Retu
std::map<size_t, VectorParamData> vectorParams = determineVectorParams( commandData.params ); std::map<size_t, VectorParamData> vectorParams = determineVectorParams( commandData.params );
if ( vectorParams.empty() ) if ( vectorParams.empty() )
{ {
return generateCommandSetStandardEnhanced( definition, return generateCommandSet( definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams ) ); { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams ) } );
} }
} }
} }
@ -3365,12 +3367,12 @@ std::string VulkanHppGenerator::generateCommandResultMultiSuccessWithErrors3Retu
{ {
if ( returnParams[2] == std::next( vectorParams.begin() )->first ) if ( returnParams[2] == std::next( vectorParams.begin() )->first )
{ {
return generateCommandSetStandardEnhancedWithAllocator( return generateCommandSet(
definition, definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams ), { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams ),
generateCommandEnhanced( generateCommandEnhanced(
name, commandData, initialSkipCount, definition, vectorParams, returnParams, CommandFlavourFlagBits::withAllocator ) ); name, commandData, initialSkipCount, definition, vectorParams, returnParams, CommandFlavourFlagBits::withAllocator ) } );
} }
} }
} }
@ -3400,12 +3402,12 @@ std::string VulkanHppGenerator::generateCommandResultSingleSuccessNoErrors( std:
switch ( constPointerParams.size() ) switch ( constPointerParams.size() )
{ {
case 0: case 0:
return generateCommandSetStandardOrEnhanced( generateCommandStandard( name, commandData, initialSkipCount, definition ), return generateCommandSet( generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, {}, {} ) ); generateCommandEnhanced( name, commandData, initialSkipCount, definition, {}, {} ) );
case 1: case 1:
return generateCommandSetStandardEnhanced( definition, return generateCommandSet( definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, {}, {} ) ); { generateCommandEnhanced( name, commandData, initialSkipCount, definition, {}, {} ) } );
} }
} }
break; break;
@ -3414,9 +3416,9 @@ std::string VulkanHppGenerator::generateCommandResultSingleSuccessNoErrors( std:
{ {
if ( isHandleType( commandData.params[vectorParams.begin()->first].type.type ) ) if ( isHandleType( commandData.params[vectorParams.begin()->first].type.type ) )
{ {
return generateCommandSetStandardEnhanced( definition, return generateCommandSet( definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, {} ) ); { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, {} ) } );
} }
} }
break; break;
@ -3428,9 +3430,9 @@ std::string VulkanHppGenerator::generateCommandResultSingleSuccessNoErrors( std:
if ( ( commandData.params[returnParams[0]].type.type != "void" ) && !isHandleType( commandData.params[returnParams[0]].type.type ) && if ( ( commandData.params[returnParams[0]].type.type != "void" ) && !isHandleType( commandData.params[returnParams[0]].type.type ) &&
!isStructureChainAnchor( commandData.params[returnParams[0]].type.type ) ) !isStructureChainAnchor( commandData.params[returnParams[0]].type.type ) )
{ {
return generateCommandSetStandardEnhanced( definition, return generateCommandSet( definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams ) ); { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams ) } );
} }
} }
break; break;
@ -3480,11 +3482,11 @@ std::string VulkanHppGenerator::generateCommandResultSingleSuccessWithErrors1Ret
std::map<size_t, VectorParamData> vectorParams = determineVectorParams( commandData.params ); std::map<size_t, VectorParamData> vectorParams = determineVectorParams( commandData.params );
if ( vectorParams.empty() ) if ( vectorParams.empty() )
{ {
return generateCommandSetStandardEnhancedChained( return generateCommandSet(
definition, definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ), { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::chained ) ); generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::chained ) } );
} }
return ""; return "";
} }
@ -3496,11 +3498,11 @@ std::string VulkanHppGenerator::generateCommandResultSingleSuccessWithErrors1Ret
switch ( vectorParams.size() ) switch ( vectorParams.size() )
{ {
case 0: case 0:
return generateCommandSetStandardEnhancedUnique( return generateCommandSet(
definition, definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ), { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ) },
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::unique ) ); { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::unique ) } );
break; break;
case 1: case 1:
return generateCommandResultSingleSuccessWithErrors1ReturnHandle1Vector( return generateCommandResultSingleSuccessWithErrors1ReturnHandle1Vector(
@ -3525,20 +3527,20 @@ std::string
{ {
if ( isLenByStructMember( commandData.params[vectorParamIndex.first].len, commandData.params[vectorParamIndex.second.lenParam] ) ) if ( isLenByStructMember( commandData.params[vectorParamIndex.first].len, commandData.params[vectorParamIndex.second.lenParam] ) )
{ {
return generateCommandSetStandardEnhancedWithAllocatorUnique( return generateCommandSet(
definition, definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, { vectorParamIndex }, { returnParam } ), { generateCommandEnhanced( name, commandData, initialSkipCount, definition, { vectorParamIndex }, { returnParam } ),
generateCommandEnhanced( generateCommandEnhanced(
name, commandData, initialSkipCount, definition, { vectorParamIndex }, { returnParam }, CommandFlavourFlagBits::withAllocator ), name, commandData, initialSkipCount, definition, { vectorParamIndex }, { returnParam }, CommandFlavourFlagBits::withAllocator ) },
generateCommandEnhanced( name, commandData, initialSkipCount, definition, { vectorParamIndex }, { returnParam }, CommandFlavourFlagBits::unique ), { generateCommandEnhanced( name, commandData, initialSkipCount, definition, { vectorParamIndex }, { returnParam }, CommandFlavourFlagBits::unique ),
generateCommandEnhanced( name, generateCommandEnhanced( name,
commandData, commandData,
initialSkipCount, initialSkipCount,
definition, definition,
{ vectorParamIndex }, { vectorParamIndex },
{ returnParam }, { returnParam },
CommandFlavourFlagBits::unique | CommandFlavourFlagBits::withAllocator ) ); CommandFlavourFlagBits::unique | CommandFlavourFlagBits::withAllocator ) } );
} }
} }
return ""; return "";
@ -3560,27 +3562,27 @@ std::string VulkanHppGenerator::generateCommandResultSingleSuccessWithErrors1Ret
if ( ( commandData.params[vectorParams.begin()->first].type.type != "void" ) && if ( ( commandData.params[vectorParams.begin()->first].type.type != "void" ) &&
!isHandleType( commandData.params[vectorParams.begin()->first].type.type ) ) !isHandleType( commandData.params[vectorParams.begin()->first].type.type ) )
{ {
return generateCommandSetStandardEnhancedWithAllocatorSingularUnique( return generateCommandSet(
definition, definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ), { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::withAllocator ), generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::withAllocator ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::singular ), generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::singular ) },
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::unique ), { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::unique ),
generateCommandEnhanced( name, generateCommandEnhanced( name,
commandData, commandData,
initialSkipCount, initialSkipCount,
definition, definition,
vectorParams, vectorParams,
{ returnParam }, { returnParam },
CommandFlavourFlagBits::unique | CommandFlavourFlagBits::withAllocator ), CommandFlavourFlagBits::unique | CommandFlavourFlagBits::withAllocator ),
generateCommandEnhanced( name, generateCommandEnhanced( name,
commandData, commandData,
initialSkipCount, initialSkipCount,
definition, definition,
vectorParams, vectorParams,
{ returnParam }, { returnParam },
CommandFlavourFlagBits::singular | CommandFlavourFlagBits::unique ) ); CommandFlavourFlagBits::singular | CommandFlavourFlagBits::unique ) } );
} }
} }
} }
@ -3595,9 +3597,9 @@ std::string VulkanHppGenerator::generateCommandResultSingleSuccessWithErrors1Ret
switch ( vectorParams.size() ) switch ( vectorParams.size() )
{ {
case 0: case 0:
return generateCommandSetStandardEnhanced( definition, return generateCommandSet( definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ) ); { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ) } );
case 2: case 2:
return generateCommandResultSingleSuccessWithErrors1ReturnValue2Vectors( name, commandData, initialSkipCount, definition, returnParam, vectorParams ); return generateCommandResultSingleSuccessWithErrors1ReturnValue2Vectors( name, commandData, initialSkipCount, definition, returnParam, vectorParams );
break; break;
@ -3622,18 +3624,18 @@ std::string VulkanHppGenerator::generateCommandResultSingleSuccessWithErrors1Ret
!isHandleType( commandData.params[vectorParams.begin()->first].type.type ) && !isHandleType( commandData.params[vectorParams.begin()->first].type.type ) &&
!isStructureChainAnchor( commandData.params[vectorParams.begin()->first].type.type ) ) !isStructureChainAnchor( commandData.params[vectorParams.begin()->first].type.type ) )
{ {
return generateCommandSetStandardEnhancedWithAllocatorSingular( return generateCommandSet(
definition, definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ), { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::withAllocator ), generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::withAllocator ),
generateCommandEnhanced( name, generateCommandEnhanced( name,
commandData, commandData,
initialSkipCount, initialSkipCount,
definition, definition,
vectorParams, vectorParams,
{ returnParam }, { returnParam },
CommandFlavourFlagBits::singular | CommandFlavourFlagBits::unique ) ); CommandFlavourFlagBits::singular | CommandFlavourFlagBits::unique ) } );
} }
} }
} }
@ -3648,20 +3650,20 @@ std::string VulkanHppGenerator::generateCommandResultSingleSuccessWithErrors1Ret
switch ( vectorParams.size() ) switch ( vectorParams.size() )
{ {
case 0: case 0:
return generateCommandSetStandardEnhanced( definition, return generateCommandSet( definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ) ); { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ) } );
break; break;
case 1: case 1:
if ( returnParam == vectorParams.begin()->first ) if ( returnParam == vectorParams.begin()->first )
{ {
if ( commandData.params[vectorParams.begin()->second.lenParam].type.isValue() ) if ( commandData.params[vectorParams.begin()->second.lenParam].type.isValue() )
{ {
return generateCommandSetStandardEnhancedSingular( return generateCommandSet(
definition, definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ), { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::singular ) ); generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::singular ) } );
} }
} }
break; break;
@ -3676,11 +3678,12 @@ std::string VulkanHppGenerator::generateCommandResultSingleSuccessWithErrors1Ret
{ {
if ( commandData.params[std::next( vectorParams.begin() )->second.lenParam].type.isValue() ) if ( commandData.params[std::next( vectorParams.begin() )->second.lenParam].type.isValue() )
{ {
return generateCommandSetStandardEnhancedSingular( return generateCommandSet(
definition, definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ), { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::singular ) ); generateCommandEnhanced(
name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::singular ) } );
} }
} }
} }
@ -3716,13 +3719,14 @@ std::string VulkanHppGenerator::generateCommandResultSingleSuccessWithErrors2Ret
!isHandleType( commandData.params[vectorParams.begin()->first].type.type ) && !isHandleType( commandData.params[vectorParams.begin()->first].type.type ) &&
!isStructureChainAnchor( commandData.params[vectorParams.begin()->first].type.type ) ) !isStructureChainAnchor( commandData.params[vectorParams.begin()->first].type.type ) )
{ {
return generateCommandSetStandardEnhancedWithAllocatorSingular( return generateCommandSet(
definition, definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams ), { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams ),
generateCommandEnhanced( generateCommandEnhanced(
name, commandData, initialSkipCount, definition, vectorParams, returnParams, CommandFlavourFlagBits::withAllocator ), name, commandData, initialSkipCount, definition, vectorParams, returnParams, CommandFlavourFlagBits::withAllocator ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams, CommandFlavourFlagBits::singular ) ); generateCommandEnhanced(
name, commandData, initialSkipCount, definition, vectorParams, returnParams, CommandFlavourFlagBits::singular ) } );
} }
} }
} }
@ -3742,235 +3746,62 @@ std::string VulkanHppGenerator::generateCommandResultWithErrors0Return( std::str
std::map<size_t, VectorParamData> vectorParams = determineVectorParams( commandData.params ); std::map<size_t, VectorParamData> vectorParams = determineVectorParams( commandData.params );
if ( vectorParams.empty() && determineConstPointerParams( commandData.params ).empty() ) if ( vectorParams.empty() && determineConstPointerParams( commandData.params ).empty() )
{ {
return generateCommandSetStandardOrEnhanced( generateCommandStandard( name, commandData, initialSkipCount, definition ), return generateCommandSet( generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, {} ) ); generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, {} ) );
} }
else if ( allVectorSizesSupported( commandData.params, vectorParams ) ) else if ( allVectorSizesSupported( commandData.params, vectorParams ) )
{ {
return generateCommandSetStandardEnhanced( definition, return generateCommandSet( definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, {} ) ); { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, {} ) } );
} }
return ""; return "";
} }
std::string VulkanHppGenerator::generateCommandSetStandard( std::string const & standard ) const std::string VulkanHppGenerator::generateCommandSet( bool definition,
std::string const & standard,
std::vector<std::string> const & enhanced,
std::vector<std::string> const & unique ) const
{ {
const std::string commandTemplate = R"( assert( unique.empty() || ( enhanced.size() == unique.size() ) );
${commandStandard}
)";
return replaceWithMap( commandTemplate, std::map<std::string, std::string>( { { "commandStandard", standard } } ) ); std::string commandSet = "\n" + standard;
if ( !enhanced.empty() )
{
std::string separator = definition ? "\n" : "";
commandSet += separator + "\n#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE\n";
bool firstEnhanced = true;
for ( auto const & e : enhanced )
{
if ( !firstEnhanced )
{
commandSet += separator + "\n";
}
firstEnhanced = false;
commandSet += e;
}
if ( !unique.empty() )
{
commandSet += separator + "\n# ifndef VULKAN_HPP_NO_SMART_HANDLE\n";
bool firstUnique = true;
for ( auto const & u : unique )
{
if ( !firstUnique )
{
commandSet += separator + "\n";
}
firstUnique = false;
commandSet += u;
}
commandSet += "\n# endif /* VULKAN_HPP_NO_SMART_HANDLE */";
}
commandSet += "\n#endif /* VULKAN_HPP_DISABLE_ENHANCED_MODE */";
}
commandSet += "\n";
return commandSet;
} }
std::string VulkanHppGenerator::generateCommandSetStandardEnhanced( bool definition, std::string const & standard, std::string const & enhanced ) const std::string VulkanHppGenerator::generateCommandSet( std::string const & standard, std::string const & enhanced ) const
{
const std::string commandTemplate = R"(
${commandStandard}${newlineOnDefinition}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
${commandEnhanced}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
)";
return replaceWithMap( commandTemplate,
std::map<std::string, std::string>(
{ { "commandEnhanced", enhanced }, { "commandStandard", standard }, { "newlineOnDefinition", definition ? "\n" : "" } } ) );
}
std::string VulkanHppGenerator::generateCommandSetStandardEnhancedChained( bool definition,
std::string const & standard,
std::string const & enhanced,
std::string const & enhancedChained ) const
{
std::string const commandTemplate = R"(
${commandStandard}${newlineOnDefinition}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
${commandEnhanced}${newlineOnDefinition}
${commandEnhancedChained}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
)";
return replaceWithMap( commandTemplate,
std::map<std::string, std::string>( { { "commandEnhanced", enhanced },
{ "commandEnhancedChained", enhancedChained },
{ "commandStandard", standard },
{ "newlineOnDefinition", definition ? "\n" : "" } } ) );
}
std::string VulkanHppGenerator::generateCommandSetStandardEnhancedSingular( bool definition,
std::string const & standard,
std::string const & enhanced,
std::string const & enhancedSingular ) const
{
std::string const commandTemplate = R"(
${commandStandard}${newlineOnDefinition}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
${commandEnhanced}${newlineOnDefinition}
${commandEnhancedSingular}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
)";
return replaceWithMap( commandTemplate,
std::map<std::string, std::string>( { { "commandEnhanced", enhanced },
{ "commandEnhancedSingular", enhancedSingular },
{ "commandStandard", standard },
{ "newlineOnDefinition", definition ? "\n" : "" } } ) );
}
std::string VulkanHppGenerator::generateCommandSetStandardEnhancedUnique( bool definition,
std::string const & standard,
std::string const & enhanced,
std::string const & enhancedUnique ) const
{
std::string const commandTemplate = R"(
${commandStandard}${newlineOnDefinition}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
${commandEnhanced}${newlineOnDefinition}
# ifndef VULKAN_HPP_NO_SMART_HANDLE
${commandEnhancedUnique}
# endif /*VULKAN_HPP_NO_SMART_HANDLE*/
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
)";
return replaceWithMap( commandTemplate,
std::map<std::string, std::string>( { { "commandEnhanced", enhanced },
{ "commandEnhancedUnique", enhancedUnique },
{ "commandStandard", standard },
{ "newlineOnDefinition", definition ? "\n" : "" } } ) );
}
std::string VulkanHppGenerator::generateCommandSetStandardEnhancedWithAllocator( bool definition,
std::string const & standard,
std::string const & enhanced,
std::string const & enhancedWithAllocator ) const
{
const std::string commandTemplate = R"(
${commandStandard}${newlineOnDefinition}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
${commandEnhanced}${newlineOnDefinition}
${commandEnhancedWithAllocator}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
)";
return replaceWithMap( commandTemplate,
std::map<std::string, std::string>( { { "commandEnhanced", enhanced },
{ "commandEnhancedWithAllocator", enhancedWithAllocator },
{ "commandStandard", standard },
{ "newlineOnDefinition", definition ? "\n" : "" } } ) );
}
std::string VulkanHppGenerator::generateCommandSetStandardEnhancedWithAllocatorChained( bool definition,
std::string const & standard,
std::string const & enhanced,
std::string const & enhancedWithAllocator,
std::string const & enhancedChained,
std::string const & enhancedChainedWithAllocator ) const
{
std::string const commandTemplate = R"(
${commandStandard}${newlineOnDefinition}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
${commandEnhanced}${newlineOnDefinition}
${commandEnhancedWithAllocator}${newlineOnDefinition}
${commandEnhancedChained}${newlineOnDefinition}
${commandEnhancedChainedWithAllocator}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
)";
return replaceWithMap( commandTemplate,
std::map<std::string, std::string>( { { "commandEnhanced", enhanced },
{ "commandEnhancedChained", enhancedChained },
{ "commandEnhancedChainedWithAllocator", enhancedChainedWithAllocator },
{ "commandEnhancedWithAllocator", enhancedWithAllocator },
{ "commandStandard", standard },
{ "newlineOnDefinition", definition ? "\n" : "" } } ) );
}
std::string VulkanHppGenerator::generateCommandSetStandardEnhancedWithAllocatorSingular( bool definition,
std::string const & standard,
std::string const & enhanced,
std::string const & enhancedWithAllocator,
std::string const & enhancedSingular ) const
{
std::string const commandTemplate = R"(
${commandStandard}${newlineOnDefinition}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
${commandEnhanced}${newlineOnDefinition}
${commandEnhancedWithAllocator}${newlineOnDefinition}
${commandEnhancedSingular}
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
)";
return replaceWithMap( commandTemplate,
std::map<std::string, std::string>( { { "commandEnhanced", enhanced },
{ "commandEnhancedSingular", enhancedSingular },
{ "commandEnhancedWithAllocator", enhancedWithAllocator },
{ "commandStandard", standard },
{ "newlineOnDefinition", definition ? "\n" : "" } } ) );
}
std::string VulkanHppGenerator::generateCommandSetStandardEnhancedWithAllocatorSingularUnique( bool definition,
std::string const & standard,
std::string const & enhanced,
std::string const & enhancedWithAllocator,
std::string const & enhancedSingular,
std::string const & enhancedUnique,
std::string const & enhancedUniqueWithAllocator,
std::string const & enhancedUniqueSingular ) const
{
std::string const commandTemplate = R"(
${commandStandard}${newlineOnDefinition}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
${commandEnhanced}${newlineOnDefinition}
${commandEnhancedWithAllocator}${newlineOnDefinition}
${commandEnhancedSingular}${newlineOnDefinition}
# ifndef VULKAN_HPP_NO_SMART_HANDLE
${commandEnhancedUnique}${newlineOnDefinition}
${commandEnhancedUniqueWithAllocator}${newlineOnDefinition}
${commandEnhancedUniqueSingular}
# endif /*VULKAN_HPP_NO_SMART_HANDLE*/
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
)";
return replaceWithMap( commandTemplate,
std::map<std::string, std::string>( { { "commandEnhanced", enhanced },
{ "commandEnhancedSingular", enhancedSingular },
{ "commandEnhancedUnique", enhancedUnique },
{ "commandEnhancedUniqueSingular", enhancedUniqueSingular },
{ "commandEnhancedUniqueWithAllocator", enhancedUniqueWithAllocator },
{ "commandEnhancedWithAllocator", enhancedWithAllocator },
{ "commandStandard", standard },
{ "newlineOnDefinition", definition ? "\n" : "" } } ) );
}
std::string VulkanHppGenerator::generateCommandSetStandardEnhancedWithAllocatorUnique( bool definition,
std::string const & standard,
std::string const & enhanced,
std::string const & enhancedWithAllocator,
std::string const & enhancedUnique,
std::string const & enhancedUniqueWithAllocator ) const
{
std::string const commandTemplate = R"(
${commandStandard}${newlineOnDefinition}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
${commandEnhanced}${newlineOnDefinition}
${commandEnhancedWithAllocator}${newlineOnDefinition}
# ifndef VULKAN_HPP_NO_SMART_HANDLE
${commandEnhancedUnique}${newlineOnDefinition}
${commandEnhancedUniqueWithAllocator}
# endif /*VULKAN_HPP_NO_SMART_HANDLE*/
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
)";
return replaceWithMap( commandTemplate,
std::map<std::string, std::string>( { { "commandEnhanced", enhanced },
{ "commandEnhancedUnique", enhancedUnique },
{ "commandEnhancedUniqueWithAllocator", enhancedUniqueWithAllocator },
{ "commandEnhancedWithAllocator", enhancedWithAllocator },
{ "commandStandard", standard },
{ "newlineOnDefinition", definition ? "\n" : "" } } ) );
}
std::string VulkanHppGenerator::generateCommandSetStandardOrEnhanced( std::string const & standard, std::string const & enhanced ) const
{ {
const std::string commandTemplate = R"( const std::string commandTemplate = R"(
#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE #ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE
@ -4047,13 +3878,13 @@ std::string
std::map<size_t, VectorParamData> vectorParams = determineVectorParams( commandData.params ); std::map<size_t, VectorParamData> vectorParams = determineVectorParams( commandData.params );
if ( vectorParams.empty() && determineConstPointerParams( commandData.params ).empty() ) if ( vectorParams.empty() && determineConstPointerParams( commandData.params ).empty() )
{ {
return generateCommandSetStandard( generateCommandStandard( name, commandData, initialSkipCount, definition ) ); return generateCommandSet( definition, generateCommandStandard( name, commandData, initialSkipCount, definition ) );
} }
else if ( vectorParams.size() <= 1 ) else if ( vectorParams.size() <= 1 )
{ {
return generateCommandSetStandardEnhanced( definition, return generateCommandSet( definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams ) ); { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams ) } );
} }
} }
return ""; return "";
@ -4065,14 +3896,14 @@ std::string
std::map<size_t, VectorParamData> vectorParams = determineVectorParams( commandData.params ); std::map<size_t, VectorParamData> vectorParams = determineVectorParams( commandData.params );
if ( vectorParams.empty() && determineConstPointerParams( commandData.params ).empty() ) if ( vectorParams.empty() && determineConstPointerParams( commandData.params ).empty() )
{ {
return generateCommandSetStandard( generateCommandStandard( name, commandData, initialSkipCount, definition ) ); return generateCommandSet( definition, generateCommandStandard( name, commandData, initialSkipCount, definition ) );
} }
else if ( allVectorSizesSupported( commandData.params, vectorParams ) ) else if ( allVectorSizesSupported( commandData.params, vectorParams ) )
{ {
// All the vectorParams have a counter by value, of type "uint32_t", "VkDeviceSize", or "VkSampleCountFlagBits" (!) // All the vectorParams have a counter by value, of type "uint32_t", "VkDeviceSize", or "VkSampleCountFlagBits" (!)
return generateCommandSetStandardEnhanced( definition, return generateCommandSet( definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, {} ) ); { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, {} ) } );
} }
return ""; return "";
} }
@ -4088,9 +3919,9 @@ std::string VulkanHppGenerator::generateCommandVoid1Return(
{ {
if ( vectorParams.empty() ) if ( vectorParams.empty() )
{ {
return generateCommandSetStandardEnhanced( definition, return generateCommandSet( definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, {}, { returnParam } ) ); { generateCommandEnhanced( name, commandData, initialSkipCount, definition, {}, { returnParam } ) } );
} }
} }
} }
@ -4098,20 +3929,20 @@ std::string VulkanHppGenerator::generateCommandVoid1Return(
{ {
if ( vectorParams.empty() ) if ( vectorParams.empty() )
{ {
return generateCommandSetStandardEnhanced( definition, return generateCommandSet( definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, {}, { returnParam } ) ); { generateCommandEnhanced( name, commandData, initialSkipCount, definition, {}, { returnParam } ) } );
} }
} }
else if ( isStructureChainAnchor( commandData.params[returnParam].type.type ) ) else if ( isStructureChainAnchor( commandData.params[returnParam].type.type ) )
{ {
if ( vectorParams.empty() ) if ( vectorParams.empty() )
{ {
return generateCommandSetStandardEnhancedChained( return generateCommandSet(
definition, definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, {}, { returnParam } ), { generateCommandEnhanced( name, commandData, initialSkipCount, definition, {}, { returnParam } ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, {}, { returnParam }, CommandFlavourFlagBits::chained ) ); generateCommandEnhanced( name, commandData, initialSkipCount, definition, {}, { returnParam }, CommandFlavourFlagBits::chained ) } );
} }
} }
else if ( commandData.params[returnParam].type.type == "void" ) else if ( commandData.params[returnParam].type.type == "void" )
@ -4119,18 +3950,18 @@ std::string VulkanHppGenerator::generateCommandVoid1Return(
switch ( vectorParams.size() ) switch ( vectorParams.size() )
{ {
case 0: case 0:
return generateCommandSetStandardEnhanced( definition, return generateCommandSet( definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ) ); { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ) } );
case 1: case 1:
if ( returnParam == vectorParams.begin()->first ) if ( returnParam == vectorParams.begin()->first )
{ {
if ( name == stripPluralS( name, m_tags ) ) if ( name == stripPluralS( name, m_tags ) )
{ {
return generateCommandSetStandardEnhanced( return generateCommandSet(
definition, definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::singular ) ); { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::singular ) } );
} }
} }
break; break;
@ -4141,19 +3972,20 @@ std::string VulkanHppGenerator::generateCommandVoid1Return(
switch ( vectorParams.size() ) switch ( vectorParams.size() )
{ {
case 0: case 0:
return generateCommandSetStandardEnhanced( definition, return generateCommandSet( definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, {}, { returnParam } ) ); { generateCommandEnhanced( name, commandData, initialSkipCount, definition, {}, { returnParam } ) } );
break; break;
case 1: case 1:
if ( returnParam == vectorParams.begin()->first ) if ( returnParam == vectorParams.begin()->first )
{ {
// you get a vector of stuff, with the size being one of the parameters // you get a vector of stuff, with the size being one of the parameters
return generateCommandSetStandardEnhancedWithAllocator( return generateCommandSet(
definition, definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ), { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::withAllocator ) ); generateCommandEnhanced(
name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, CommandFlavourFlagBits::withAllocator ) } );
} }
else else
{ {
@ -4163,10 +3995,9 @@ std::string VulkanHppGenerator::generateCommandVoid1Return(
{ {
if ( isLenByStructMember( commandData.params[vectorParams.begin()->first].len, commandData.params[vectorParams.begin()->second.lenParam] ) ) if ( isLenByStructMember( commandData.params[vectorParams.begin()->first].len, commandData.params[vectorParams.begin()->second.lenParam] ) )
{ {
return generateCommandSetStandardEnhanced( return generateCommandSet( definition,
definition, generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandStandard( name, commandData, initialSkipCount, definition ), { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ) } );
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam } ) );
} }
} }
} }
@ -4190,27 +4021,28 @@ std::string VulkanHppGenerator::generateCommandVoid2Return(
{ {
if ( isStructureChainAnchor( commandData.params[returnParams[1]].type.type ) ) if ( isStructureChainAnchor( commandData.params[returnParams[1]].type.type ) )
{ {
return generateCommandSetStandardEnhancedWithAllocatorChained( return generateCommandSet(
definition, definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams ), { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams, CommandFlavourFlagBits::withAllocator ), generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams, CommandFlavourFlagBits::withAllocator ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams, CommandFlavourFlagBits::chained ), generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams, CommandFlavourFlagBits::chained ),
generateCommandEnhanced( name, generateCommandEnhanced( name,
commandData, commandData,
initialSkipCount, initialSkipCount,
definition, definition,
vectorParams, vectorParams,
returnParams, returnParams,
CommandFlavourFlagBits::chained | CommandFlavourFlagBits::withAllocator ) ); CommandFlavourFlagBits::chained | CommandFlavourFlagBits::withAllocator ) } );
} }
else if ( !isHandleType( commandData.params[returnParams[1]].type.type ) ) else if ( !isHandleType( commandData.params[returnParams[1]].type.type ) )
{ {
return generateCommandSetStandardEnhancedWithAllocator( return generateCommandSet(
definition, definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ), generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams ), { generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, returnParams, CommandFlavourFlagBits::withAllocator ) ); generateCommandEnhanced(
name, commandData, initialSkipCount, definition, vectorParams, returnParams, CommandFlavourFlagBits::withAllocator ) } );
} }
} }
} }

View File

@ -609,50 +609,11 @@ private:
std::string const & name, CommandData const & commandData, size_t initialSkipCount, bool definition, std::vector<size_t> const & returnParamIndices ) const; std::string const & name, CommandData const & commandData, size_t initialSkipCount, bool definition, std::vector<size_t> const & returnParamIndices ) const;
std::string std::string
generateCommandResultWithErrors0Return( std::string const & name, CommandData const & commandData, size_t initialSkipCount, bool definition ) const; generateCommandResultWithErrors0Return( std::string const & name, CommandData const & commandData, size_t initialSkipCount, bool definition ) const;
std::string generateCommandSetStandard( std::string const & standard ) const; std::string generateCommandSet( bool definition,
std::string generateCommandSetStandardEnhanced( bool definition, std::string const & standard, std::string const & enhanced ) const; std::string const & standard,
std::string generateCommandSetStandardEnhancedChained( bool definition, std::vector<std::string> const & enhanced = {},
std::string const & standard, std::vector<std::string> const & unique = {} ) const;
std::string const & enhanced, std::string generateCommandSet( std::string const & standard, std::string const & enhanced ) const;
std::string const & enhancedChained ) const;
std::string generateCommandSetStandardEnhancedSingular( bool definition,
std::string const & standard,
std::string const & enhanced,
std::string const & enhancedSingular ) const;
std::string generateCommandSetStandardEnhancedUnique( bool definition,
std::string const & standard,
std::string const & enhanced,
std::string const & enhancedUnique ) const;
std::string generateCommandSetStandardEnhancedWithAllocator( bool definition,
std::string const & standard,
std::string const & enhanced,
std::string const & enhancedWithAllocator ) const;
std::string generateCommandSetStandardEnhancedWithAllocatorChained( bool definition,
std::string const & standard,
std::string const & enhanced,
std::string const & enhancedWithAllocator,
std::string const & enhancedChained,
std::string const & enhancedChainedWithAllocator ) const;
std::string generateCommandSetStandardEnhancedWithAllocatorSingular( bool definition,
std::string const & standard,
std::string const & enhanced,
std::string const & enhancedWithAllocator,
std::string const & enhancedSingular ) const;
std::string generateCommandSetStandardEnhancedWithAllocatorSingularUnique( bool definition,
std::string const & standard,
std::string const & enhanced,
std::string const & enhancedWithAllocator,
std::string const & enhancedSingular,
std::string const & enhancedUnique,
std::string const & enhancedUniqueWithAllocator,
std::string const & enhancedUniqueSingular ) const;
std::string generateCommandSetStandardEnhancedWithAllocatorUnique( bool definition,
std::string const & standard,
std::string const & enhanced,
std::string const & enhancedWithAllocator,
std::string const & enhancedUnique,
std::string const & enhancedUniqueWithAllocator ) const;
std::string generateCommandSetStandardOrEnhanced( std::string const & standard, std::string const & enhanced ) const;
std::string generateCommandStandard( std::string const & name, CommandData const & commandData, size_t initialSkipCount, bool definition ) const; std::string generateCommandStandard( std::string const & name, CommandData const & commandData, size_t initialSkipCount, bool definition ) const;
std::string generateCommandValue( std::string const & name, CommandData const & commandData, size_t initialSkipCount, bool definition ) const; std::string generateCommandValue( std::string const & name, CommandData const & commandData, size_t initialSkipCount, bool definition ) const;
std::string generateCommandVoid0Return( std::string const & name, CommandData const & commandData, size_t initialSkipCount, bool definition ) const; std::string generateCommandVoid0Return( std::string const & name, CommandData const & commandData, size_t initialSkipCount, bool definition ) const;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff