diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index 08d7672..dd8bb04 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -3066,6 +3066,39 @@ std::string VulkanHppGenerator::generateCallSequence( std::string const & bool raiiFactory ) const { std::string dispatcher = raii ? "getDispatcher()->" : "d."; + + // first a special handling on vkGetDeviceFaultInfoEXT!! + if ( name == "vkGetDeviceFaultInfoEXT" ) + { + const std::string callSequenceTemplate = + R"( VULKAN_HPP_NAMESPACE::Result result; + do + { + result = static_cast( ${dispatcher}vkGetDeviceFaultInfoEXT( m_device, reinterpret_cast( &faultCounts ), nullptr ) ); + if ( result == VULKAN_HPP_NAMESPACE::Result::eSuccess ) + { + std::free( faultInfo.pAddressInfos ); + if ( faultCounts.addressInfoCount ) + { + faultInfo.pAddressInfos = reinterpret_cast( std::malloc( faultCounts.addressInfoCount * sizeof( VULKAN_HPP_NAMESPACE::DeviceFaultAddressInfoEXT ) ) ); + } + std::free( faultInfo.pVendorInfos ); + if ( faultCounts.vendorInfoCount ) + { + faultInfo.pVendorInfos = reinterpret_cast( std::malloc( faultCounts.vendorInfoCount * sizeof( VULKAN_HPP_NAMESPACE::DeviceFaultVendorInfoEXT ) ) ); + } + std::free( faultInfo.pVendorBinaryData ); + if ( faultCounts.vendorBinarySize ) + { + faultInfo.pVendorBinaryData = std::malloc( faultCounts.vendorBinarySize ); + } + result = static_cast( ${dispatcher}vkGetDeviceFaultInfoEXT( m_device, reinterpret_cast( &faultCounts ), reinterpret_cast( &faultInfo ) ) ); + } + } while ( result == VULKAN_HPP_NAMESPACE::Result::eIncomplete );)"; + + return replaceWithMap( callSequenceTemplate, { { "dispatcher", dispatcher } } ); + } + // if at least one returnParam is a size value of a vector param (and no singular params), we need two calls if ( singularParams.empty() && std::any_of( returnParams.begin(), diff --git a/vulkan/vulkan_funcs.hpp b/vulkan/vulkan_funcs.hpp index 3c8d9ae..fcfe05b 100644 --- a/vulkan/vulkan_funcs.hpp +++ b/vulkan/vulkan_funcs.hpp @@ -22589,8 +22589,34 @@ namespace VULKAN_HPP_NAMESPACE std::pair data_; VULKAN_HPP_NAMESPACE::DeviceFaultCountsEXT & faultCounts = data_.first; VULKAN_HPP_NAMESPACE::DeviceFaultInfoEXT & faultInfo = data_.second; - VULKAN_HPP_NAMESPACE::Result result = static_cast( d.vkGetDeviceFaultInfoEXT( - m_device, reinterpret_cast( &faultCounts ), reinterpret_cast( &faultInfo ) ) ); + VULKAN_HPP_NAMESPACE::Result result; + do + { + result = + static_cast( d.vkGetDeviceFaultInfoEXT( m_device, reinterpret_cast( &faultCounts ), nullptr ) ); + if ( result == VULKAN_HPP_NAMESPACE::Result::eSuccess ) + { + std::free( faultInfo.pAddressInfos ); + if ( faultCounts.addressInfoCount ) + { + faultInfo.pAddressInfos = reinterpret_cast( + std::malloc( faultCounts.addressInfoCount * sizeof( VULKAN_HPP_NAMESPACE::DeviceFaultAddressInfoEXT ) ) ); + } + std::free( faultInfo.pVendorInfos ); + if ( faultCounts.vendorInfoCount ) + { + faultInfo.pVendorInfos = reinterpret_cast( + std::malloc( faultCounts.vendorInfoCount * sizeof( VULKAN_HPP_NAMESPACE::DeviceFaultVendorInfoEXT ) ) ); + } + std::free( faultInfo.pVendorBinaryData ); + if ( faultCounts.vendorBinarySize ) + { + faultInfo.pVendorBinaryData = std::malloc( faultCounts.vendorBinarySize ); + } + result = static_cast( d.vkGetDeviceFaultInfoEXT( + m_device, reinterpret_cast( &faultCounts ), reinterpret_cast( &faultInfo ) ) ); + } + } while ( result == VULKAN_HPP_NAMESPACE::Result::eIncomplete ); resultCheck( result, VULKAN_HPP_NAMESPACE_STRING "::Device::getFaultInfoEXT", { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eIncomplete } ); diff --git a/vulkan/vulkan_raii.hpp b/vulkan/vulkan_raii.hpp index e97bfb3..1323d30 100644 --- a/vulkan/vulkan_raii.hpp +++ b/vulkan/vulkan_raii.hpp @@ -21056,10 +21056,34 @@ namespace VULKAN_HPP_NAMESPACE std::pair data_; VULKAN_HPP_NAMESPACE::DeviceFaultCountsEXT & faultCounts = data_.first; VULKAN_HPP_NAMESPACE::DeviceFaultInfoEXT & faultInfo = data_.second; - VULKAN_HPP_NAMESPACE::Result result = - static_cast( getDispatcher()->vkGetDeviceFaultInfoEXT( static_cast( m_device ), - reinterpret_cast( &faultCounts ), - reinterpret_cast( &faultInfo ) ) ); + VULKAN_HPP_NAMESPACE::Result result; + do + { + result = static_cast( + getDispatcher()->vkGetDeviceFaultInfoEXT( m_device, reinterpret_cast( &faultCounts ), nullptr ) ); + if ( result == VULKAN_HPP_NAMESPACE::Result::eSuccess ) + { + std::free( faultInfo.pAddressInfos ); + if ( faultCounts.addressInfoCount ) + { + faultInfo.pAddressInfos = reinterpret_cast( + std::malloc( faultCounts.addressInfoCount * sizeof( VULKAN_HPP_NAMESPACE::DeviceFaultAddressInfoEXT ) ) ); + } + std::free( faultInfo.pVendorInfos ); + if ( faultCounts.vendorInfoCount ) + { + faultInfo.pVendorInfos = reinterpret_cast( + std::malloc( faultCounts.vendorInfoCount * sizeof( VULKAN_HPP_NAMESPACE::DeviceFaultVendorInfoEXT ) ) ); + } + std::free( faultInfo.pVendorBinaryData ); + if ( faultCounts.vendorBinarySize ) + { + faultInfo.pVendorBinaryData = std::malloc( faultCounts.vendorBinarySize ); + } + result = static_cast( getDispatcher()->vkGetDeviceFaultInfoEXT( + m_device, reinterpret_cast( &faultCounts ), reinterpret_cast( &faultInfo ) ) ); + } + } while ( result == VULKAN_HPP_NAMESPACE::Result::eIncomplete ); resultCheck( result, VULKAN_HPP_NAMESPACE_STRING "::Device::getFaultInfoEXT", { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eIncomplete } );