qvkgen: Skip command elements with alias

Otherwise we end up with generating broken qvulkanfunctions cpp and h
files.

For example, encountering the following command element should lead to
taking no action, this is not something we want to emit a corresponding
wrapper function for:
  <command name="vkResetQueryPoolEXT" alias="vkResetQueryPool"/>

This is required to be able to upgrade the bundled vk.xml to something
newer.

Fixes: QTBUG-90330
Task-number: QTBUG-90219
Change-Id: Ie6e3a8794207e30a172820eb055238bf52a0c0b9
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This commit is contained in:
Laszlo Agocs 2021-01-14 16:10:20 +01:00
parent ade24763c7
commit 2aa7ad5e67

View File

@ -104,8 +104,11 @@ void VkSpecParser::parseCommands()
m_reader.readNext();
if (m_reader.isEndElement() && m_reader.name() == QStringLiteral("commands"))
return;
if (m_reader.isStartElement() && m_reader.name() == u"command")
m_commands.append(parseCommand());
if (m_reader.isStartElement() && m_reader.name() == u"command") {
const Command c = parseCommand();
if (!c.cmd.name.isEmpty()) // skip aliases
m_commands.append(c);
}
}
}