Fix command sequence for enumerating commands with just one success code. (#1900)

This commit is contained in:
Andreas Süßenbach 2024-06-13 10:08:18 +02:00 committed by GitHub
parent 235b1a2f85
commit 66af8942cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3282,13 +3282,31 @@ std::string VulkanHppGenerator::generateCallSequence( std::string const &
switch ( commandData.successCodes.size() )
{
case 1:
assert( commandData.successCodes[0] == "VK_SUCCESS" );
if ( commandData.errorCodes.empty() )
{
assert( commandData.successCodes[0] == "VK_SUCCESS" );
std::string const callSequenceTemplate = R"(${dispatcher}${vkCommand}( ${firstCallArguments} );
${resizes}
${dispatcher}${vkCommand}( ${secondCallArguments} );
)";
return replaceWithMap( callSequenceTemplate,
{ { "dispatcher", dispatcher },
{ "firstCallArguments", firstCallArguments },
{ "secondCallArguments", secondCallArguments },
{ "resizes", resizes },
{ "vkCommand", name } } );
}
else
{
std::string const callSequenceTemplate = R"(VULKAN_HPP_NAMESPACE::Result result = ${dispatcher}${vkCommand}( ${firstCallArguments} );
if ( result == VULKAN_HPP_NAMESPACE::Result::eSuccess )
{
${resizes}
result = ${dispatcher}${vkCommand}( ${secondCallArguments} );
}
)";
return replaceWithMap( callSequenceTemplate,
{ { "dispatcher", dispatcher },
{ "firstCallArguments", firstCallArguments },