Add error message when referencing undefined type requirements (#473)

This commit is contained in:
Markus Tavenrath 2020-01-07 16:50:46 +01:00 committed by Andreas Süßenbach
parent 4ee2d61ef6
commit d5f58e07dd

View File

@ -803,7 +803,10 @@ void VulkanHppGenerator::appendBitmasks(std::string & str) const
for (auto const& bitmask : m_bitmasks) for (auto const& bitmask : m_bitmasks)
{ {
auto bitmaskBits = m_bitmaskBits.find(bitmask.second.requirement); auto bitmaskBits = m_bitmaskBits.find(bitmask.second.requirement);
assert(bitmaskBits != m_bitmaskBits.end()); if (bitmaskBits == m_bitmaskBits.end())
{
throw std::runtime_error( bitmask.first + " references the undefined requirement '" + bitmask.second.requirement + "'");
}
std::string strippedBitmaskName = stripPrefix(bitmask.first, "Vk"); std::string strippedBitmaskName = stripPrefix(bitmask.first, "Vk");
std::string strippedEnumName = stripPrefix(bitmaskBits->first, "Vk"); std::string strippedEnumName = stripPrefix(bitmaskBits->first, "Vk");