Skip to content

Commit

Permalink
Fix command sequence for enumerating commands with just one success c…
Browse files Browse the repository at this point in the history
…ode.
  • Loading branch information
asuessenbach committed Jun 12, 2024
1 parent dc65014 commit 474a696
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion VulkanHppGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down

0 comments on commit 474a696

Please sign in to comment.