Use new Vulkan-Headers repository. Don't generate createReturnValue function call if the return type is void. (#335)

This commit is contained in:
Markus Tavenrath
2019-06-06 13:13:38 +02:00
committed by GitHub
parent d2a1056a56
commit 50e0a941e9
9 changed files with 15 additions and 58358 deletions

View File

@@ -2651,6 +2651,7 @@ void VulkanHppGenerator::writeFunctionBodyEnhanced(std::ostream & os, std::strin
if ((commandData.second.returnType == "VkResult") || !commandData.second.successCodes.empty())
{
writeFunctionBodyEnhancedReturnResultValue(os, indentation, returnName, commandName, commandData, returnParamIndex, twoStep, singular, unique);
}
else if ((returnParamIndex != INVALID_INDEX) && (stripPrefix(commandData.second.returnType, "Vk") != enhancedReturnType))
@@ -2795,6 +2796,11 @@ void VulkanHppGenerator::writeFunctionBodyEnhancedReturnResultValue(std::ostream
std::string type = (returnParamIndex != INVALID_INDEX) ? commandData.second.params[returnParamIndex].type.type : "";
std::string returnVectorName = (returnParamIndex != INVALID_INDEX) ? stripPostfix(stripPrefix(commandData.second.params[returnParamIndex].name, "p"), "s") : "";
if (commandData.second.returnType == "void") {
std::cerr << "warning: skipping writeFunctionBodyEnhancedReturnResultValue for function " << commandName << " because the returnType is void";
return;
}
assert(m_commandToHandle.find(commandData.first) != m_commandToHandle.end());
std::string const& handle = m_commandToHandle.find(commandData.first)->second;