mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2024-10-14 16:32:17 +00:00
Merge pull request #541 from asuessenbach/check
Add a check on having a valid value for struct members sType.
This commit is contained in:
commit
784ce5d12c
@ -3447,6 +3447,9 @@ void VulkanHppGenerator::checkCorrectness()
|
|||||||
check(m_types.find(funcPointer.second.requirements) != m_types.end(), funcPointer.second.xmlLine, "funcpointer requires unknown <" + funcPointer.second.requirements + ">");
|
check(m_types.find(funcPointer.second.requirements) != m_types.end(), funcPointer.second.xmlLine, "funcpointer requires unknown <" + funcPointer.second.requirements + ">");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto structureTypeIt = m_enums.find("VkStructureType");
|
||||||
|
assert(structureTypeIt != m_enums.end());
|
||||||
for (auto const& structure : m_structures)
|
for (auto const& structure : m_structures)
|
||||||
{
|
{
|
||||||
for (auto const& extend : structure.second.structExtends)
|
for (auto const& extend : structure.second.structExtends)
|
||||||
@ -3455,6 +3458,12 @@ void VulkanHppGenerator::checkCorrectness()
|
|||||||
}
|
}
|
||||||
for (auto const& member : structure.second.members)
|
for (auto const& member : structure.second.members)
|
||||||
{
|
{
|
||||||
|
if (!member.values.empty())
|
||||||
|
{
|
||||||
|
assert(member.name == "sType");
|
||||||
|
check(std::find_if(structureTypeIt->second.values.begin(), structureTypeIt->second.values.end(), [&member](auto const& evd) { return member.values == evd.vulkanValue; }) != structureTypeIt->second.values.end(),
|
||||||
|
member.xmlLine, "sType value <" + member.values + "> not listed for VkStructureType");
|
||||||
|
}
|
||||||
check(m_types.find(member.type.type) != m_types.end(), member.xmlLine, "struct member uses unknown type <" + member.type.type + ">");
|
check(m_types.find(member.type.type) != m_types.end(), member.xmlLine, "struct member uses unknown type <" + member.type.type + ">");
|
||||||
if (!member.usedConstant.empty())
|
if (!member.usedConstant.empty())
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user