diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index 953e280..1ed41c0 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -6615,8 +6615,7 @@ std::string VulkanHppGenerator::generateRAIIHandleCommandResultMultiSuccessWithE if ( commandIt->second.params[vectorParams.begin()->second].type.type == "size_t" ) { str = generateRAIIHandleCommandEnhanced( commandIt, initialSkipCount, { returnParam }, vectorParams, definition, false, false ); - str += - generateRAIIHandleCommandResultMultiSuccessWithErrors1ReturnVoidSingular( commandIt, initialSkipCount, vectorParams, { returnParam }, definition ); + str += generateRAIIHandleCommandEnhanced( commandIt, initialSkipCount, { returnParam }, vectorParams, definition, false, true ); } } } @@ -6650,69 +6649,6 @@ std::string VulkanHppGenerator::generateRAIIHandleCommandResultMultiSuccessWithE return str; } -std::string - VulkanHppGenerator::generateRAIIHandleCommandResultMultiSuccessWithErrors1ReturnVoidSingular( std::map::const_iterator commandIt, - size_t initialSkipCount, - std::map const & vectorParams, - std::vector const & returnParams, - bool definition ) const -{ - assert( returnParams.size() == 1 ); - std::set skippedParams = determineSkippedParams( commandIt->second.params, initialSkipCount, vectorParams, returnParams, true ); - std::set singularParams = determineSingularParams( returnParams[0], vectorParams ); - std::set templatedParams = determineVoidPointerParams( commandIt->second.params ); - assert( templatedParams.size() == 1 ); - std::string argumentList = generateArgumentListEnhanced( - commandIt->second.params, returnParams, vectorParams, skippedParams, singularParams, templatedParams, definition, false, false, false ); - std::string argumentTemplates = generateArgumentTemplates( commandIt->second.params, returnParams, vectorParams, templatedParams, false, true ); - std::string commandName = generateCommandName( commandIt->first, commandIt->second.params, initialSkipCount, m_tags, true, false ); - std::string dataType = stripPrefix( commandIt->second.params[*templatedParams.begin()].name, "p" ) + "Type"; - - if ( definition ) - { - std::string const singularDefinitionTemplate = - R"( - ${argumentTemplates} - VULKAN_HPP_NODISCARD std::pair ${className}::${commandName}( ${argumentList} ) const - { - ${dataType} ${dataName}; - Result result = static_cast( getDispatcher()->${vkCommand}( ${callArguments} ) ); - if ( ${failureCheck} ) - { - throwResultException( result, VULKAN_HPP_NAMESPACE_STRING"::${className}::${commandName}" ); - } - return std::make_pair( result, ${dataName} ); - } -)"; - - std::string callArguments = generateCallArgumentsEnhanced( commandIt->second, initialSkipCount, false, singularParams, {}, true ); - std::string dataName = startLowerCase( stripPrefix( commandIt->second.params[returnParams[0]].name, "p" ) ); - - return replaceWithMap( singularDefinitionTemplate, - { { "argumentList", argumentList }, - { "argumentTemplates", argumentTemplates }, - { "callArguments", callArguments }, - { "className", stripPrefix( commandIt->second.params[initialSkipCount - 1].type.type, "Vk" ) }, - { "commandName", commandName }, - { "dataName", dataName }, - { "dataType", dataType }, - { "failureCheck", generateFailureCheck( commandIt->second.successCodes ) }, - { "vkCommand", commandIt->first } } ); - } - else - { - std::string const singularDeclarationTemplate = - R"( - ${argumentTemplates} - VULKAN_HPP_NODISCARD std::pair ${commandName}( ${argumentList} ) const; -)"; - - return replaceWithMap( - singularDeclarationTemplate, - { { "argumentList", argumentList }, { "argumentTemplates", argumentTemplates }, { "commandName", commandName }, { "dataType", dataType } } ); - } -} - std::string VulkanHppGenerator::generateRAIIHandleCommandResultMultiSuccessWithErrors2Return( std::map::const_iterator commandIt, size_t initialSkipCount, bool definition, diff --git a/VulkanHppGenerator.hpp b/VulkanHppGenerator.hpp index b86bf91..09199b0 100644 --- a/VulkanHppGenerator.hpp +++ b/VulkanHppGenerator.hpp @@ -718,11 +718,6 @@ private: size_t initialSkipCount, bool definition, size_t returnParam ) const; - std::string generateRAIIHandleCommandResultMultiSuccessWithErrors1ReturnVoidSingular( std::map::const_iterator commandIt, - size_t initialSkipCount, - std::map const & vectorParamIndices, - std::vector const & returnParamIndices, - bool definition ) const; std::string generateRAIIHandleCommandResultMultiSuccessWithErrors2Return( std::map::const_iterator commandIt, size_t initialSkipCount, bool definition, diff --git a/vulkan/vulkan_raii.hpp b/vulkan/vulkan_raii.hpp index 1c6d034..47d2f0f 100644 --- a/vulkan/vulkan_raii.hpp +++ b/vulkan/vulkan_raii.hpp @@ -10678,25 +10678,23 @@ namespace VULKAN_HPP_NAMESPACE } template - VULKAN_HPP_NODISCARD std::pair QueryPool::getResult( uint32_t firstQuery, - uint32_t queryCount, - VULKAN_HPP_NAMESPACE::DeviceSize stride, - VULKAN_HPP_NAMESPACE::QueryResultFlags flags ) const + VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::pair QueryPool::getResult( + uint32_t firstQuery, uint32_t queryCount, VULKAN_HPP_NAMESPACE::DeviceSize stride, VULKAN_HPP_NAMESPACE::QueryResultFlags flags ) const { DataType data; - Result result = static_cast( getDispatcher()->vkGetQueryPoolResults( static_cast( m_device ), - static_cast( m_queryPool ), - firstQuery, - queryCount, - sizeof( DataType ), - reinterpret_cast( &data ), - static_cast( stride ), - static_cast( flags ) ) ); - if ( ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) && ( result != VULKAN_HPP_NAMESPACE::Result::eNotReady ) ) - { - throwResultException( result, VULKAN_HPP_NAMESPACE_STRING "::QueryPool::getResult" ); - } - return std::make_pair( result, data ); + VkResult result = getDispatcher()->vkGetQueryPoolResults( static_cast( m_device ), + static_cast( m_queryPool ), + firstQuery, + queryCount, + sizeof( DataType ), + reinterpret_cast( &data ), + static_cast( stride ), + static_cast( flags ) ); + resultCheck( static_cast( result ), + VULKAN_HPP_NAMESPACE_STRING "::QueryPool::getResult", + { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eNotReady } ); + + return std::make_pair( static_cast( result ), data ); } VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::Buffer