mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2025-09-09 11:58:06 -04:00
Don't create destroy functions for alias commands (#191)
This commit is contained in:
parent
164cd27be0
commit
8dbe1fa9d4
@ -1709,6 +1709,7 @@ void VulkanHppGenerator::readCommandsCommand(tinyxml2::XMLElement const* element
|
|||||||
assert(commandsIt != m_commands.end());
|
assert(commandsIt != m_commands.end());
|
||||||
commandData = commandsIt->second;
|
commandData = commandsIt->second;
|
||||||
commandData.fullName = startLowerCase(strip(attributes.find("name")->second, "vk"));
|
commandData.fullName = startLowerCase(strip(attributes.find("name")->second, "vk"));
|
||||||
|
commandData.isAlias = true;
|
||||||
determineReducedName(commandData);
|
determineReducedName(commandData);
|
||||||
linkCommandToHandle(commandData);
|
linkCommandToHandle(commandData);
|
||||||
|
|
||||||
@ -4403,8 +4404,8 @@ ${commands}
|
|||||||
assert((cit != m_commands.end()) && !cit->second.className.empty());
|
assert((cit != m_commands.end()) && !cit->second.className.empty());
|
||||||
writeTypeCommand(commands, " ", cit->second, false);
|
writeTypeCommand(commands, " ", cit->second, false);
|
||||||
|
|
||||||
// special handling for destroy functions
|
// special handling for destroy functions which are not aliased.
|
||||||
if (((cit->second.fullName.substr(0, 7) == "destroy") && (cit->second.reducedName != "destroy")) || (cit->second.fullName.substr(0, 4) == "free"))
|
if (!cit->second.isAlias && (((cit->second.fullName.substr(0, 7) == "destroy") && (cit->second.reducedName != "destroy")) || (cit->second.fullName.substr(0, 4) == "free")))
|
||||||
{
|
{
|
||||||
CommandData shortenedCommand = cit->second;
|
CommandData shortenedCommand = cit->second;
|
||||||
shortenedCommand.reducedName = (cit->second.fullName.substr(0, 7) == "destroy") ? "destroy" : "free";
|
shortenedCommand.reducedName = (cit->second.fullName.substr(0, 7) == "destroy") ? "destroy" : "free";
|
||||||
@ -4429,7 +4430,7 @@ ${commands}
|
|||||||
writeTypeCommand(os, " ", cit->second, true);
|
writeTypeCommand(os, " ", cit->second, true);
|
||||||
|
|
||||||
// special handling for destroy functions
|
// special handling for destroy functions
|
||||||
if (((cit->second.fullName.substr(0, 7) == "destroy") && (cit->second.reducedName != "destroy")) || (cit->second.fullName.substr(0, 4) == "free"))
|
if (!cit->second.isAlias && (((cit->second.fullName.substr(0, 7) == "destroy") && (cit->second.reducedName != "destroy")) || (cit->second.fullName.substr(0, 4) == "free")))
|
||||||
{
|
{
|
||||||
CommandData shortenedCommand = cit->second;
|
CommandData shortenedCommand = cit->second;
|
||||||
shortenedCommand.reducedName = (cit->second.fullName.substr(0, 7) == "destroy") ? "destroy" : "free";
|
shortenedCommand.reducedName = (cit->second.fullName.substr(0, 7) == "destroy") ? "destroy" : "free";
|
||||||
|
@ -103,6 +103,7 @@ class VulkanHppGenerator
|
|||||||
: returnParam(~0)
|
: returnParam(~0)
|
||||||
, templateParam(~0)
|
, templateParam(~0)
|
||||||
, twoStep(false)
|
, twoStep(false)
|
||||||
|
, isAlias(false)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
std::string className;
|
std::string className;
|
||||||
@ -117,8 +118,9 @@ class VulkanHppGenerator
|
|||||||
std::set<size_t> skippedParams;
|
std::set<size_t> skippedParams;
|
||||||
std::vector<std::string> successCodes;
|
std::vector<std::string> successCodes;
|
||||||
size_t templateParam;
|
size_t templateParam;
|
||||||
bool twoStep;
|
|
||||||
std::map<size_t, size_t> vectorParams;
|
std::map<size_t, size_t> vectorParams;
|
||||||
|
bool twoStep;
|
||||||
|
bool isAlias;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct DeleterData
|
struct DeleterData
|
||||||
|
Loading…
x
Reference in New Issue
Block a user