Refactor simple functions with more than one success code.

This commit is contained in:
asuessenbach 2020-09-30 09:32:02 +02:00
parent 5fd780c189
commit bb0de4db93
2 changed files with 10 additions and 3 deletions

View File

@ -1258,8 +1258,7 @@ void VulkanHppGenerator::appendCommand( std::string & str,
appendCommandSimpleVoid( str, name, commandData, definition, vectorParamIndices );
appendedFunction = true;
}
else if ( ( commandData.returnType == "VkResult" ) && ( commandData.successCodes.size() == 1 ) &&
( vectorParamIndices.size() < 2 ) )
else if ( ( commandData.returnType == "VkResult" ) && ( vectorParamIndices.size() < 2 ) )
{
// returns VkResult, but there's just one success code
appendCommandSimple( str, name, commandData, definition, vectorParamIndices );
@ -4526,7 +4525,7 @@ std::string VulkanHppGenerator::constructCommandSimple( std::string const &
${nodiscard}VULKAN_HPP_INLINE ${returnType} ${className}::${commandName}( ${argumentList} ) const
{
Result result = static_cast<Result>( d.${vkCommand}( ${callArguments} ) );
return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING "::${className}::${commandName}" );
return createResultValue( result, VULKAN_HPP_NAMESPACE_STRING "::${className}::${commandName}"${successCodeList} );
})";
str =
@ -4538,6 +4537,7 @@ std::string VulkanHppGenerator::constructCommandSimple( std::string const &
{ "commandName", commandName },
{ "nodiscard", nodiscard },
{ "returnType", returnType },
{ "successCodeList", constructSuccessCodeList( commandData.successCodes ) },
{ "vkCommand", name } } ) );
}
else

View File

@ -92474,6 +92474,7 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>( d.vkCopyAccelerationStructureKHR(
m_device, reinterpret_cast<const VkCopyAccelerationStructureInfoKHR *>( pInfo ) ) );
}
# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result
@ -92497,6 +92498,7 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>( d.vkCopyAccelerationStructureToMemoryKHR(
m_device, reinterpret_cast<const VkCopyAccelerationStructureToMemoryInfoKHR *>( pInfo ) ) );
}
# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::copyAccelerationStructureToMemoryKHR(
@ -92520,6 +92522,7 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>( d.vkCopyMemoryToAccelerationStructureKHR(
m_device, reinterpret_cast<const VkCopyMemoryToAccelerationStructureInfoKHR *>( pInfo ) ) );
}
# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::copyMemoryToAccelerationStructureKHR(
@ -100040,6 +100043,7 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>( d.vkWaitForFences(
m_device, fenceCount, reinterpret_cast<const VkFence *>( pFences ), static_cast<VkBool32>( waitAll ), timeout ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result
@ -100067,6 +100071,7 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>(
d.vkWaitSemaphores( m_device, reinterpret_cast<const VkSemaphoreWaitInfo *>( pWaitInfo ), timeout ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::waitSemaphores( const SemaphoreWaitInfo & waitInfo,
@ -100089,6 +100094,7 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>(
d.vkWaitSemaphoresKHR( m_device, reinterpret_cast<const VkSemaphoreWaitInfo *>( pWaitInfo ), timeout ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::waitSemaphoresKHR( const SemaphoreWaitInfo & waitInfo,
@ -104720,6 +104726,7 @@ namespace VULKAN_HPP_NAMESPACE
return static_cast<Result>(
d.vkQueuePresentKHR( m_queue, reinterpret_cast<const VkPresentInfoKHR *>( pPresentInfo ) ) );
}
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template <typename Dispatch>
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Queue::presentKHR( const PresentInfoKHR & presentInfo,