Add support for functions returning void, that get you a some data behind a void *.

This commit is contained in:
asuessenbach 2022-08-01 10:00:11 +02:00
parent 9bb1bb385a
commit d3c95e9527
2 changed files with 26 additions and 16 deletions

View File

@ -36,7 +36,7 @@ std::string decodeDriverVersion( uint32_t driverVersion, uint32_t vendorID )
{
switch ( vendorID )
{
case 4318:
case 0x10DE:
return std::to_string( ( driverVersion >> 22 ) & 0x3FF ) + "." + std::to_string( ( driverVersion >> 14 ) & 0xFF ) + "." +
std::to_string( ( driverVersion >> 6 ) & 0xFF ) + "." + std::to_string( driverVersion & 0x3F );
case 0x8086: return std::to_string( ( driverVersion >> 14 ) & 0x3FFFF ) + "." + std::to_string( ( driverVersion & 0x3FFF ) );

View File

@ -4710,18 +4710,25 @@ std::string VulkanHppGenerator::generateCommandVoid1Return(
}
else if ( commandData.params[returnParam].type.type == "void" )
{
if ( vectorParams.size() == 1 )
switch ( vectorParams.size() )
{
if ( returnParam == vectorParams.begin()->first )
{
if ( name == stripPluralS( name ) )
case 0:
return generateCommandSetStandardEnhanced(
definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, false, false, false, false ) );
case 1:
if ( returnParam == vectorParams.begin()->first )
{
return generateCommandSetStandardEnhanced(
definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, true, false, false, false ) );
if ( name == stripPluralS( name ) )
{
return generateCommandSetStandardEnhanced(
definition,
generateCommandStandard( name, commandData, initialSkipCount, definition ),
generateCommandEnhanced( name, commandData, initialSkipCount, definition, vectorParams, { returnParam }, true, false, false, false ) );
}
}
}
break;
}
}
else
@ -7057,15 +7064,18 @@ std::string VulkanHppGenerator::generateRAIIHandleCommandVoid( std::map<std::str
}
else if ( commandIt->second.params[returnParams[0]].type.type == "void" )
{
if ( vectorParams.size() == 1 )
switch ( vectorParams.size() )
{
if ( returnParams[0] == vectorParams.begin()->first )
{
if ( commandIt->first == stripPluralS( commandIt->first ) )
case 0: str = generateRAIIHandleCommandEnhanced( commandIt, initialSkipCount, returnParams, vectorParams, definition, false, false ); break;
case 1:
if ( returnParams[0] == vectorParams.begin()->first )
{
str = generateRAIIHandleCommandVoid1ReturnVoidVectorSingular( commandIt, initialSkipCount, vectorParams, returnParams[0], definition );
if ( commandIt->first == stripPluralS( commandIt->first ) )
{
str = generateRAIIHandleCommandVoid1ReturnVoidVectorSingular( commandIt, initialSkipCount, vectorParams, returnParams[0], definition );
}
}
}
break;
}
}
else