Corrected handling of mutual exclusive arrays in constructors of structures VkAccelerationStructureTrianglesOpacityMicromapEXT and VkMicromapBuildInfoEXT

This commit is contained in:
asuessenbach 2022-10-04 11:34:04 +02:00
parent f50a4ec09c
commit f5be57e498
2 changed files with 22 additions and 22 deletions

View File

@ -12765,7 +12765,9 @@ void VulkanHppGenerator::readTypesTypeStruct( tinyxml2::XMLElement const * eleme
// Note: even though the arrays are not marked as optional, they still might be mutually exclusive (like in // Note: even though the arrays are not marked as optional, they still might be mutually exclusive (like in
// VkWriteDescriptorSet)! That is, there's not enough information available in vk.xml to decide on that, so we // VkWriteDescriptorSet)! That is, there's not enough information available in vk.xml to decide on that, so we
// need this external knowledge! // need this external knowledge!
static std::set<std::string> mutualExclusiveStructs = { "VkAccelerationStructureBuildGeometryInfoKHR", "VkWriteDescriptorSet" }; static std::set<std::string> mutualExclusiveStructs = {
"VkAccelerationStructureBuildGeometryInfoKHR", "VkAccelerationStructureTrianglesOpacityMicromapEXT", "VkMicromapBuildInfoEXT", "VkWriteDescriptorSet"
};
static std::set<std::string> multipleLenStructs = { "VkImageConstraintsInfoFUCHSIA", static std::set<std::string> multipleLenStructs = { "VkImageConstraintsInfoFUCHSIA",
"VkIndirectCommandsLayoutTokenNV", "VkIndirectCommandsLayoutTokenNV",
"VkPresentInfoKHR", "VkPresentInfoKHR",

View File

@ -3556,19 +3556,19 @@ namespace VULKAN_HPP_NAMESPACE
, indexBuffer( indexBuffer_ ) , indexBuffer( indexBuffer_ )
, indexStride( indexStride_ ) , indexStride( indexStride_ )
, baseTriangle( baseTriangle_ ) , baseTriangle( baseTriangle_ )
, usageCountsCount( static_cast<uint32_t>( usageCounts_.size() ) ) , usageCountsCount( static_cast<uint32_t>( !usageCounts_.empty() ? usageCounts_.size() : pUsageCounts_.size() ) )
, pUsageCounts( usageCounts_.data() ) , pUsageCounts( usageCounts_.data() )
, ppUsageCounts( pUsageCounts_.data() ) , ppUsageCounts( pUsageCounts_.data() )
, micromap( micromap_ ) , micromap( micromap_ )
{ {
# ifdef VULKAN_HPP_NO_EXCEPTIONS # ifdef VULKAN_HPP_NO_EXCEPTIONS
VULKAN_HPP_ASSERT( usageCounts_.empty() || pUsageCounts_.empty() || ( usageCounts_.size() == pUsageCounts_.size() ) ); VULKAN_HPP_ASSERT( ( !usageCounts_.empty() + !pUsageCounts_.empty() ) <= 1 );
# else # else
if ( !usageCounts_.empty() && !pUsageCounts_.empty() && ( usageCounts_.size() != pUsageCounts_.size() ) ) if ( 1 < ( !usageCounts_.empty() + !pUsageCounts_.empty() ) )
{ {
throw LogicError( throw LogicError(
VULKAN_HPP_NAMESPACE_STRING VULKAN_HPP_NAMESPACE_STRING
"::AccelerationStructureTrianglesOpacityMicromapEXT::AccelerationStructureTrianglesOpacityMicromapEXT: !usageCounts_.empty() && !pUsageCounts_.empty() && ( usageCounts_.size() != pUsageCounts_.size() )" ); "::AccelerationStructureTrianglesOpacityMicromapEXT::AccelerationStructureTrianglesOpacityMicromapEXT: 1 < ( !usageCounts_.empty() + !pUsageCounts_.empty() )" );
} }
# endif /*VULKAN_HPP_NO_EXCEPTIONS*/ # endif /*VULKAN_HPP_NO_EXCEPTIONS*/
} }
@ -45136,7 +45136,7 @@ namespace VULKAN_HPP_NAMESPACE
, flags( flags_ ) , flags( flags_ )
, mode( mode_ ) , mode( mode_ )
, dstMicromap( dstMicromap_ ) , dstMicromap( dstMicromap_ )
, usageCountsCount( static_cast<uint32_t>( usageCounts_.size() ) ) , usageCountsCount( static_cast<uint32_t>( !usageCounts_.empty() ? usageCounts_.size() : pUsageCounts_.size() ) )
, pUsageCounts( usageCounts_.data() ) , pUsageCounts( usageCounts_.data() )
, ppUsageCounts( pUsageCounts_.data() ) , ppUsageCounts( pUsageCounts_.data() )
, data( data_ ) , data( data_ )
@ -45145,13 +45145,11 @@ namespace VULKAN_HPP_NAMESPACE
, triangleArrayStride( triangleArrayStride_ ) , triangleArrayStride( triangleArrayStride_ )
{ {
# ifdef VULKAN_HPP_NO_EXCEPTIONS # ifdef VULKAN_HPP_NO_EXCEPTIONS
VULKAN_HPP_ASSERT( usageCounts_.empty() || pUsageCounts_.empty() || ( usageCounts_.size() == pUsageCounts_.size() ) ); VULKAN_HPP_ASSERT( ( !usageCounts_.empty() + !pUsageCounts_.empty() ) <= 1 );
# else # else
if ( !usageCounts_.empty() && !pUsageCounts_.empty() && ( usageCounts_.size() != pUsageCounts_.size() ) ) if ( 1 < ( !usageCounts_.empty() + !pUsageCounts_.empty() ) )
{ {
throw LogicError( throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::MicromapBuildInfoEXT::MicromapBuildInfoEXT: 1 < ( !usageCounts_.empty() + !pUsageCounts_.empty() )" );
VULKAN_HPP_NAMESPACE_STRING
"::MicromapBuildInfoEXT::MicromapBuildInfoEXT: !usageCounts_.empty() && !pUsageCounts_.empty() && ( usageCounts_.size() != pUsageCounts_.size() )" );
} }
# endif /*VULKAN_HPP_NO_EXCEPTIONS*/ # endif /*VULKAN_HPP_NO_EXCEPTIONS*/
} }