mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2025-09-12 21:38:42 -04:00
Adjustments to changes with Vulkan 1.0.61 (#131)
To generate Vulkan.hpp version 1.0.61 change line 5336 in vk.xml from <command> to <command successcodes="VK_SUCCESS" errorcodes="VK_ERROR_OUT_OF_HOST_MEMORY">
This commit is contained in:
parent
8da778cfb3
commit
0b8ab65be2
@ -1 +1 @@
|
|||||||
Subproject commit a9231ec465ec08eb367fc990ca160fe45d545470
|
Subproject commit 0cc6bba634aeecb88e4b43f1bdfd84a339c1869e
|
@ -856,6 +856,14 @@ struct DeleterData
|
|||||||
std::string call;
|
std::string call;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if !defined(NDEBUG)
|
||||||
|
struct ExtensionData
|
||||||
|
{
|
||||||
|
std::string protect;
|
||||||
|
std::vector<std::string> requires;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
struct VkData
|
struct VkData
|
||||||
{
|
{
|
||||||
std::map<std::string, CommandData> commands;
|
std::map<std::string, CommandData> commands;
|
||||||
@ -873,6 +881,9 @@ struct VkData
|
|||||||
std::string version;
|
std::string version;
|
||||||
std::set<std::string> vkTypes;
|
std::set<std::string> vkTypes;
|
||||||
std::string vulkanLicenseHeader;
|
std::string vulkanLicenseHeader;
|
||||||
|
#if !defined(NDEBUG)
|
||||||
|
std::map<std::string, ExtensionData> extensions;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
void createDefaults( VkData const& vkData, std::map<std::string,std::string> & defaultValues );
|
void createDefaults( VkData const& vkData, std::map<std::string,std::string> & defaultValues );
|
||||||
@ -925,6 +936,7 @@ void sortDependencies( std::list<DependencyData> & dependencies );
|
|||||||
std::string strip(std::string const& value, std::string const& prefix, std::string const& postfix = std::string());
|
std::string strip(std::string const& value, std::string const& prefix, std::string const& postfix = std::string());
|
||||||
std::string stripPluralS(std::string const& name);
|
std::string stripPluralS(std::string const& name);
|
||||||
std::string toCamelCase(std::string const& value);
|
std::string toCamelCase(std::string const& value);
|
||||||
|
std::vector<std::string> tokenize(std::string tokenString, char separator);
|
||||||
std::string toUpperCase(std::string const& name);
|
std::string toUpperCase(std::string const& name);
|
||||||
std::string trimEnd(std::string const& input);
|
std::string trimEnd(std::string const& input);
|
||||||
void writeCall(std::ostream & os, CommandData const& commandData, std::set<std::string> const& vkTypes, bool firstCall, bool singular);
|
void writeCall(std::ostream & os, CommandData const& commandData, std::set<std::string> const& vkTypes, bool firstCall, bool singular);
|
||||||
@ -1446,17 +1458,13 @@ std::vector<std::string> readCommandSuccessCodes(tinyxml2::XMLElement* element,
|
|||||||
{
|
{
|
||||||
std::string successCodes = element->Attribute("successcodes");
|
std::string successCodes = element->Attribute("successcodes");
|
||||||
|
|
||||||
// tokenize the successCodes string, using ',' as the separator
|
results = tokenize(successCodes, ',');
|
||||||
size_t start = 0, end;
|
for (auto & code : results)
|
||||||
do
|
|
||||||
{
|
{
|
||||||
end = successCodes.find(',', start);
|
|
||||||
std::string code = successCodes.substr(start, end - start);
|
|
||||||
std::string tag = findTag(code, tags);
|
std::string tag = findTag(code, tags);
|
||||||
// on each success code: prepend 'e', strip "VK_" and a tag, convert it to camel case, and add the tag again
|
// on each success code: prepend 'e', strip "VK_" and a tag, convert it to camel case, and add the tag again
|
||||||
results.push_back(std::string("e") + toCamelCase(strip(code, "VK_", tag)) + tag);
|
code = std::string("e") + toCamelCase(strip(code, "VK_", tag)) + tag;
|
||||||
start = end + 1;
|
}
|
||||||
} while (end != std::string::npos);
|
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
@ -1675,7 +1683,7 @@ void readExtensionRequire(tinyxml2::XMLElement * element, VkData & vkData, std::
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
assert(value=="usage");
|
assert((value == "comment") || (value=="usage"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1691,27 +1699,44 @@ void readExtensions(tinyxml2::XMLElement * element, VkData & vkData)
|
|||||||
|
|
||||||
void readExtensionsExtension(tinyxml2::XMLElement * element, VkData & vkData)
|
void readExtensionsExtension(tinyxml2::XMLElement * element, VkData & vkData)
|
||||||
{
|
{
|
||||||
assert( element->Attribute( "name" ) );
|
|
||||||
std::string tag = extractTag(element->Attribute("name"));
|
|
||||||
assert(vkData.tags.find(tag) != vkData.tags.end());
|
|
||||||
|
|
||||||
tinyxml2::XMLElement * child = element->FirstChildElement();
|
|
||||||
assert(child && (strcmp(child->Value(), "require") == 0) && !child->NextSiblingElement());
|
|
||||||
|
|
||||||
if (strcmp(element->Attribute("supported"), "disabled") == 0)
|
if (strcmp(element->Attribute("supported"), "disabled") == 0)
|
||||||
{
|
{
|
||||||
// kick out all the disabled stuff we've read before !!
|
// kick out all the disabled stuff we've read before !!
|
||||||
readDisabledExtensionRequire(child, vkData);
|
for (tinyxml2::XMLElement * child = element->FirstChildElement(); child; child = child->NextSiblingElement())
|
||||||
|
{
|
||||||
|
assert(strcmp(child->Value(), "require") == 0);
|
||||||
|
readDisabledExtensionRequire(child, vkData);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
assert( element->Attribute( "name" ) );
|
||||||
|
std::string name = element->Attribute("name");
|
||||||
|
|
||||||
|
std::string tag = extractTag(name);
|
||||||
|
assert(vkData.tags.find(tag) != vkData.tags.end());
|
||||||
|
|
||||||
std::string protect;
|
std::string protect;
|
||||||
if (element->Attribute("protect"))
|
if (element->Attribute("protect"))
|
||||||
{
|
{
|
||||||
protect = element->Attribute("protect");
|
protect = element->Attribute("protect");
|
||||||
}
|
}
|
||||||
|
|
||||||
readExtensionRequire(child, vkData, protect, tag);
|
#if !defined(NDEBUG)
|
||||||
|
assert(vkData.extensions.find(name) == vkData.extensions.end());
|
||||||
|
ExtensionData & extension = vkData.extensions.insert(std::make_pair(name, ExtensionData())).first->second;
|
||||||
|
extension.protect = protect;
|
||||||
|
if (element->Attribute("requires"))
|
||||||
|
{
|
||||||
|
extension.requires = tokenize(element->Attribute("requires"), ',');
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
for (tinyxml2::XMLElement * child = element->FirstChildElement(); child; child = child->NextSiblingElement())
|
||||||
|
{
|
||||||
|
assert(strcmp(child->Value(), "require") == 0);
|
||||||
|
readExtensionRequire(child, vkData, protect, tag);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1925,18 +1950,14 @@ void readTypeStruct( tinyxml2::XMLElement * element, VkData & vkData, bool isUni
|
|||||||
|
|
||||||
if (element->Attribute("structextends"))
|
if (element->Attribute("structextends"))
|
||||||
{
|
{
|
||||||
std::string structextends = element->Attribute("structextends");
|
std::vector<std::string> structExtends = tokenize(element->Attribute("structextends"), ',');
|
||||||
std::vector<std::string> structs;
|
for (auto const& s : structExtends)
|
||||||
size_t endPos = -1;
|
|
||||||
do
|
|
||||||
{
|
{
|
||||||
size_t startPos = endPos + 1;
|
assert(s.substr(0, 2) == "Vk");
|
||||||
endPos = structextends.find(',', startPos);
|
std::string strippedName = s.substr(2);
|
||||||
assert(structextends.substr(startPos, 2) == "Vk");
|
it->second.structExtends.push_back(strippedName);
|
||||||
std::string structExtendName = structextends.substr(startPos + 2, endPos - startPos - 2);
|
vkData.extendedStructs.insert(strippedName);
|
||||||
it->second.structExtends.push_back(structExtendName);
|
}
|
||||||
vkData.extendedStructs.insert(structExtendName);
|
|
||||||
} while (endPos != std::string::npos);
|
|
||||||
assert(!it->second.structExtends.empty());
|
assert(!it->second.structExtends.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2200,6 +2221,19 @@ std::string toCamelCase(std::string const& value)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> tokenize(std::string tokenString, char separator)
|
||||||
|
{
|
||||||
|
std::vector<std::string> tokens;
|
||||||
|
size_t start = 0, end;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
end = tokenString.find(separator, start);
|
||||||
|
tokens.push_back(tokenString.substr(start, end - start));
|
||||||
|
start = end + 1;
|
||||||
|
} while (end != std::string::npos);
|
||||||
|
return tokens;
|
||||||
|
}
|
||||||
|
|
||||||
std::string toUpperCase(std::string const& name)
|
std::string toUpperCase(std::string const& name)
|
||||||
{
|
{
|
||||||
assert(isupper(name.front()));
|
assert(isupper(name.front()));
|
||||||
@ -4306,6 +4340,18 @@ int main( int argc, char **argv )
|
|||||||
|
|
||||||
sortDependencies(vkData.dependencies);
|
sortDependencies(vkData.dependencies);
|
||||||
|
|
||||||
|
#if !defined(NDEBUG)
|
||||||
|
for (auto const& ext : vkData.extensions)
|
||||||
|
{
|
||||||
|
for (auto const& req : ext.second.requires)
|
||||||
|
{
|
||||||
|
auto reqExt = vkData.extensions.find(req);
|
||||||
|
assert(reqExt != vkData.extensions.end());
|
||||||
|
assert(reqExt->second.protect.empty() || (reqExt->second.protect == ext.second.protect));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
std::map<std::string, std::string> defaultValues;
|
std::map<std::string, std::string> defaultValues;
|
||||||
createDefaults(vkData, defaultValues);
|
createDefaults(vkData, defaultValues);
|
||||||
|
|
||||||
|
2282
vulkan/vulkan.hpp
2282
vulkan/vulkan.hpp
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user