Add special handling for call sequence in commands for vkGetDeviceFaultInfoEXT (#1790)

This commit is contained in:
Andreas Süßenbach 2024-02-05 15:44:40 +01:00 committed by GitHub
parent 6bdba3ef31
commit 9fa4459c50
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 89 additions and 6 deletions

View File

@ -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<VULKAN_HPP_NAMESPACE::Result>( ${dispatcher}vkGetDeviceFaultInfoEXT( m_device, reinterpret_cast<VkDeviceFaultCountsEXT *>( &faultCounts ), nullptr ) );
if ( result == VULKAN_HPP_NAMESPACE::Result::eSuccess )
{
std::free( faultInfo.pAddressInfos );
if ( faultCounts.addressInfoCount )
{
faultInfo.pAddressInfos = reinterpret_cast<VULKAN_HPP_NAMESPACE::DeviceFaultAddressInfoEXT *>( std::malloc( faultCounts.addressInfoCount * sizeof( VULKAN_HPP_NAMESPACE::DeviceFaultAddressInfoEXT ) ) );
}
std::free( faultInfo.pVendorInfos );
if ( faultCounts.vendorInfoCount )
{
faultInfo.pVendorInfos = reinterpret_cast<VULKAN_HPP_NAMESPACE::DeviceFaultVendorInfoEXT *>( 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<VULKAN_HPP_NAMESPACE::Result>( ${dispatcher}vkGetDeviceFaultInfoEXT( m_device, reinterpret_cast<VkDeviceFaultCountsEXT *>( &faultCounts ), reinterpret_cast<VkDeviceFaultInfoEXT *>( &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(),

View File

@ -22589,8 +22589,34 @@ namespace VULKAN_HPP_NAMESPACE
std::pair<VULKAN_HPP_NAMESPACE::DeviceFaultCountsEXT, VULKAN_HPP_NAMESPACE::DeviceFaultInfoEXT> data_;
VULKAN_HPP_NAMESPACE::DeviceFaultCountsEXT & faultCounts = data_.first;
VULKAN_HPP_NAMESPACE::DeviceFaultInfoEXT & faultInfo = data_.second;
VULKAN_HPP_NAMESPACE::Result result = static_cast<VULKAN_HPP_NAMESPACE::Result>( d.vkGetDeviceFaultInfoEXT(
VULKAN_HPP_NAMESPACE::Result result;
do
{
result =
static_cast<VULKAN_HPP_NAMESPACE::Result>( d.vkGetDeviceFaultInfoEXT( m_device, reinterpret_cast<VkDeviceFaultCountsEXT *>( &faultCounts ), nullptr ) );
if ( result == VULKAN_HPP_NAMESPACE::Result::eSuccess )
{
std::free( faultInfo.pAddressInfos );
if ( faultCounts.addressInfoCount )
{
faultInfo.pAddressInfos = reinterpret_cast<VULKAN_HPP_NAMESPACE::DeviceFaultAddressInfoEXT *>(
std::malloc( faultCounts.addressInfoCount * sizeof( VULKAN_HPP_NAMESPACE::DeviceFaultAddressInfoEXT ) ) );
}
std::free( faultInfo.pVendorInfos );
if ( faultCounts.vendorInfoCount )
{
faultInfo.pVendorInfos = reinterpret_cast<VULKAN_HPP_NAMESPACE::DeviceFaultVendorInfoEXT *>(
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<VULKAN_HPP_NAMESPACE::Result>( d.vkGetDeviceFaultInfoEXT(
m_device, reinterpret_cast<VkDeviceFaultCountsEXT *>( &faultCounts ), reinterpret_cast<VkDeviceFaultInfoEXT *>( &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 } );

View File

@ -21056,10 +21056,34 @@ namespace VULKAN_HPP_NAMESPACE
std::pair<VULKAN_HPP_NAMESPACE::DeviceFaultCountsEXT, VULKAN_HPP_NAMESPACE::DeviceFaultInfoEXT> data_;
VULKAN_HPP_NAMESPACE::DeviceFaultCountsEXT & faultCounts = data_.first;
VULKAN_HPP_NAMESPACE::DeviceFaultInfoEXT & faultInfo = data_.second;
VULKAN_HPP_NAMESPACE::Result result =
static_cast<VULKAN_HPP_NAMESPACE::Result>( getDispatcher()->vkGetDeviceFaultInfoEXT( static_cast<VkDevice>( m_device ),
reinterpret_cast<VkDeviceFaultCountsEXT *>( &faultCounts ),
reinterpret_cast<VkDeviceFaultInfoEXT *>( &faultInfo ) ) );
VULKAN_HPP_NAMESPACE::Result result;
do
{
result = static_cast<VULKAN_HPP_NAMESPACE::Result>(
getDispatcher()->vkGetDeviceFaultInfoEXT( m_device, reinterpret_cast<VkDeviceFaultCountsEXT *>( &faultCounts ), nullptr ) );
if ( result == VULKAN_HPP_NAMESPACE::Result::eSuccess )
{
std::free( faultInfo.pAddressInfos );
if ( faultCounts.addressInfoCount )
{
faultInfo.pAddressInfos = reinterpret_cast<VULKAN_HPP_NAMESPACE::DeviceFaultAddressInfoEXT *>(
std::malloc( faultCounts.addressInfoCount * sizeof( VULKAN_HPP_NAMESPACE::DeviceFaultAddressInfoEXT ) ) );
}
std::free( faultInfo.pVendorInfos );
if ( faultCounts.vendorInfoCount )
{
faultInfo.pVendorInfos = reinterpret_cast<VULKAN_HPP_NAMESPACE::DeviceFaultVendorInfoEXT *>(
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<VULKAN_HPP_NAMESPACE::Result>( getDispatcher()->vkGetDeviceFaultInfoEXT(
m_device, reinterpret_cast<VkDeviceFaultCountsEXT *>( &faultCounts ), reinterpret_cast<VkDeviceFaultInfoEXT *>( &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 } );