mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2024-10-14 16:32:17 +00:00
Added test on existence of ObjectType enum value corresponding to handle type in extensions. (#477)
This commit is contained in:
parent
8d62969b4d
commit
979af1b46e
@ -3806,10 +3806,23 @@ void VulkanHppGenerator::readExtensionRequireType(tinyxml2::XMLElement const* el
|
||||
checkElements(getChildElements(element), {});
|
||||
|
||||
// add the protect-string to the appropriate type: enum, flag, handle, scalar, or struct
|
||||
if (!platform.empty())
|
||||
{
|
||||
std::string name = attributes.find("name")->second;
|
||||
|
||||
auto handleIt = m_handles.find(name);
|
||||
if (handleIt != m_handles.end())
|
||||
{
|
||||
assert(beginsWith(name, "Vk"));
|
||||
auto objectTypeIt = m_enums.find("VkObjectType");
|
||||
assert(objectTypeIt != m_enums.end());
|
||||
std::string objectTypeName = "e" + stripPrefix(handleIt->first, "Vk");
|
||||
if (std::find_if(objectTypeIt->second.values.begin(), objectTypeIt->second.values.end(), [objectTypeName](EnumValueData const& evd) {return evd.vkValue == objectTypeName; }) == objectTypeIt->second.values.end())
|
||||
{
|
||||
throw std::runtime_error("Spec error on line " + std::to_string(element->GetLineNum()) + ": missing entry in VkObjectType enum for handle <" + name + ">.");
|
||||
}
|
||||
}
|
||||
|
||||
if (!platform.empty())
|
||||
{
|
||||
auto bmit = m_bitmasks.find(name);
|
||||
if (bmit != m_bitmasks.end())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user