mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2025-09-11 04:50:34 -04:00
Merge pull request #946 from asuessenbach/check
Relax check on mutual exclusive arrays as part of a structure to allow all empty as well.
This commit is contained in:
commit
d58b93d8e5
@ -11951,11 +11951,11 @@ std::string
|
|||||||
sum += "!" + startLowerCase( stripPrefix( arrayIts[first]->name, "p" ) ) + "_.empty() + ";
|
sum += "!" + startLowerCase( stripPrefix( arrayIts[first]->name, "p" ) ) + "_.empty() + ";
|
||||||
}
|
}
|
||||||
sum += "!" + startLowerCase( stripPrefix( arrayIts.back()->name, "p" ) ) + "_.empty()";
|
sum += "!" + startLowerCase( stripPrefix( arrayIts.back()->name, "p" ) ) + "_.empty()";
|
||||||
assertionText += prefix + " VULKAN_HPP_ASSERT( ( " + sum + " ) == 1 );\n";
|
assertionText += prefix + " VULKAN_HPP_ASSERT( ( " + sum + " ) <= 1);\n";
|
||||||
throwText += prefix + " if ( ( " + sum + " ) != 1 )\n";
|
throwText += prefix + " if ( 1 < ( " + sum + " ) )\n";
|
||||||
throwText += prefix + " {\n";
|
throwText += prefix + " {\n";
|
||||||
throwText += prefix + " throw LogicError( VULKAN_HPP_NAMESPACE_STRING \"::" + structName + "::" + structName +
|
throwText += prefix + " throw LogicError( VULKAN_HPP_NAMESPACE_STRING \"::" + structName + "::" + structName +
|
||||||
": ( " + sum + " ) != 1\" );\n";
|
": 1 < ( " + sum + " )\" );\n";
|
||||||
throwText += prefix + " }\n";
|
throwText += prefix + " }\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -14059,7 +14059,7 @@ void VulkanHppGenerator::readStruct( tinyxml2::XMLElement const *
|
|||||||
it->second.subStruct = determineSubStruct( *it );
|
it->second.subStruct = determineSubStruct( *it );
|
||||||
|
|
||||||
// check if multiple structure members use the very same (not empty) len attribute
|
// check if multiple structure members use the very same (not empty) len attribute
|
||||||
// Note: even though the arrays are not mared 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",
|
static std::set<std::string> mutualExclusiveStructs = { "VkAccelerationStructureBuildGeometryInfoKHR",
|
||||||
|
@ -20578,13 +20578,13 @@ namespace VULKAN_HPP_NAMESPACE
|
|||||||
, scratchData( scratchData_ )
|
, scratchData( scratchData_ )
|
||||||
{
|
{
|
||||||
# ifdef VULKAN_HPP_NO_EXCEPTIONS
|
# ifdef VULKAN_HPP_NO_EXCEPTIONS
|
||||||
VULKAN_HPP_ASSERT( ( !geometries_.empty() + !pGeometries_.empty() ) == 1 );
|
VULKAN_HPP_ASSERT( ( !geometries_.empty() + !pGeometries_.empty() ) <= 1 );
|
||||||
# else
|
# else
|
||||||
if ( ( !geometries_.empty() + !pGeometries_.empty() ) != 1 )
|
if ( 1 < ( !geometries_.empty() + !pGeometries_.empty() ) )
|
||||||
{
|
{
|
||||||
throw LogicError(
|
throw LogicError(
|
||||||
VULKAN_HPP_NAMESPACE_STRING
|
VULKAN_HPP_NAMESPACE_STRING
|
||||||
"::AccelerationStructureBuildGeometryInfoKHR::AccelerationStructureBuildGeometryInfoKHR: ( !geometries_.empty() + !pGeometries_.empty() ) != 1" );
|
"::AccelerationStructureBuildGeometryInfoKHR::AccelerationStructureBuildGeometryInfoKHR: 1 < ( !geometries_.empty() + !pGeometries_.empty() )" );
|
||||||
}
|
}
|
||||||
# endif /*VULKAN_HPP_NO_EXCEPTIONS*/
|
# endif /*VULKAN_HPP_NO_EXCEPTIONS*/
|
||||||
}
|
}
|
||||||
@ -35197,13 +35197,13 @@ namespace VULKAN_HPP_NAMESPACE
|
|||||||
, pTexelBufferView( texelBufferView_.data() )
|
, pTexelBufferView( texelBufferView_.data() )
|
||||||
{
|
{
|
||||||
# ifdef VULKAN_HPP_NO_EXCEPTIONS
|
# ifdef VULKAN_HPP_NO_EXCEPTIONS
|
||||||
VULKAN_HPP_ASSERT( ( !imageInfo_.empty() + !bufferInfo_.empty() + !texelBufferView_.empty() ) == 1 );
|
VULKAN_HPP_ASSERT( ( !imageInfo_.empty() + !bufferInfo_.empty() + !texelBufferView_.empty() ) <= 1 );
|
||||||
# else
|
# else
|
||||||
if ( ( !imageInfo_.empty() + !bufferInfo_.empty() + !texelBufferView_.empty() ) != 1 )
|
if ( 1 < ( !imageInfo_.empty() + !bufferInfo_.empty() + !texelBufferView_.empty() ) )
|
||||||
{
|
{
|
||||||
throw LogicError(
|
throw LogicError(
|
||||||
VULKAN_HPP_NAMESPACE_STRING
|
VULKAN_HPP_NAMESPACE_STRING
|
||||||
"::WriteDescriptorSet::WriteDescriptorSet: ( !imageInfo_.empty() + !bufferInfo_.empty() + !texelBufferView_.empty() ) != 1" );
|
"::WriteDescriptorSet::WriteDescriptorSet: 1 < ( !imageInfo_.empty() + !bufferInfo_.empty() + !texelBufferView_.empty() )" );
|
||||||
}
|
}
|
||||||
# endif /*VULKAN_HPP_NO_EXCEPTIONS*/
|
# endif /*VULKAN_HPP_NO_EXCEPTIONS*/
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user