Update to Vulkan 1.0.55 (#116)

This commit is contained in:
Andreas Süßenbach 2017-07-19 09:35:28 +02:00 committed by Markus Tavenrath
parent 195479de01
commit a50ea7dc6c
3 changed files with 3029 additions and 712 deletions

@ -1 +1 @@
Subproject commit 1d67e47f1464d5f5e654a405e9a91c7d5441bbb6 Subproject commit 8e6dc96ef04a12dc4018ca682146d953733f105b

View File

@ -1203,15 +1203,15 @@ std::string readArraySize(tinyxml2::XMLNode * node, std::string& name)
assert(node && node->ToElement() && (strcmp(node->Value(), "enum") == 0)); assert(node && node->ToElement() && (strcmp(node->Value(), "enum") == 0));
arraySize = node->ToElement()->GetText(); arraySize = node->ToElement()->GetText();
node = node->NextSibling(); node = node->NextSibling();
assert(node && node->ToText() && (strcmp(node->Value(), "]") == 0) && !node->NextSibling()); assert(node && node->ToText() && (strcmp(node->Value(), "]") == 0));
} }
else else
{ {
// otherwise, the node holds '[' and ']', so get the stuff in between those as the array size // otherwise, the node holds '[' and ']', so get the stuff in between those as the array size
assert((value.front() == '[') && (value.back() == ']')); assert((value.front() == '[') && (value.back() == ']'));
arraySize = value.substr(1, value.length() - 2); arraySize = value.substr(1, value.length() - 2);
assert(!node->NextSibling());
} }
assert(!node->NextSibling() || ((strcmp(node->NextSibling()->Value(), "comment") == 0) && !node->NextSibling()->NextSibling()));
} }
} }
return arraySize; return arraySize;
@ -1367,23 +1367,26 @@ std::vector<std::string> readCommandSuccessCodes(tinyxml2::XMLElement* element,
void readComment(tinyxml2::XMLElement * element, std::string & header) void readComment(tinyxml2::XMLElement * element, std::string & header)
{ {
assert(element->GetText()); assert(element->GetText());
assert(header.empty()); std::string text = element->GetText();
header = element->GetText(); if (text.find("\nCopyright") == 0)
assert(header.find("\nCopyright") == 0);
// erase the part after the Copyright text
size_t pos = header.find("\n\n-----");
assert(pos != std::string::npos);
header.erase(pos);
// replace any '\n' with "\n// "
for (size_t pos = header.find('\n'); pos != std::string::npos; pos = header.find('\n', pos + 1))
{ {
header.replace(pos, 1, "\n// "); assert(header.empty());
} header = text;
// and add a little message on our own // erase the part after the Copyright text
header += "\n\n// This header is generated from the Khronos Vulkan XML API Registry."; size_t pos = header.find("\n\n-----");
assert(pos != std::string::npos);
header.erase(pos);
// replace any '\n' with "\n// "
for (size_t pos = header.find('\n'); pos != std::string::npos; pos = header.find('\n', pos + 1))
{
header.replace(pos, 1, "\n// ");
}
// and add a little message on our own
header += "\n\n// This header is generated from the Khronos Vulkan XML API Registry.";
}
} }
void readEnums( tinyxml2::XMLElement * element, VkData & vkData ) void readEnums( tinyxml2::XMLElement * element, VkData & vkData )
@ -1827,8 +1830,11 @@ void readTypeStruct( tinyxml2::XMLElement * element, VkData & vkData, bool isUni
{ {
assert( child->Value() ); assert( child->Value() );
std::string value = child->Value(); std::string value = child->Value();
assert(value == "member"); assert((value == "comment") || (value == "member"));
readTypeStructMember( child, it->second.members, vkData.dependencies.back().dependencies ); if (value == "member")
{
readTypeStructMember(child, it->second.members, vkData.dependencies.back().dependencies);
}
} }
assert( vkData.vkTypes.find( name ) == vkData.vkTypes.end() ); assert( vkData.vkTypes.find( name ) == vkData.vkTypes.end() );
@ -1864,50 +1870,53 @@ void readTypes(tinyxml2::XMLElement * element, VkData & vkData)
{ {
for (tinyxml2::XMLElement * child = element->FirstChildElement(); child; child = child->NextSiblingElement()) for (tinyxml2::XMLElement * child = element->FirstChildElement(); child; child = child->NextSiblingElement())
{ {
assert( strcmp( child->Value(), "type" ) == 0 ); assert(child->Value());
std::string type = child->Value(); std::string value = child->Value();
assert( type == "type" ); assert((value == "comment") || (value == "type"));
if ( child->Attribute( "category" ) ) if (value == "type")
{ {
std::string category = child->Attribute( "category" ); if (child->Attribute("category"))
if ( category == "basetype" )
{ {
readTypeBasetype( child, vkData.dependencies ); std::string category = child->Attribute("category");
} if (category == "basetype")
else if ( category == "bitmask" ) {
{ readTypeBasetype(child, vkData.dependencies);
readTypeBitmask( child, vkData); }
} else if (category == "bitmask")
else if ( category == "define" ) {
{ readTypeBitmask(child, vkData);
readTypeDefine( child, vkData ); }
} else if (category == "define")
else if ( category == "funcpointer" ) {
{ readTypeDefine(child, vkData);
readTypeFuncpointer( child, vkData.dependencies ); }
} else if (category == "funcpointer")
else if ( category == "handle" ) {
{ readTypeFuncpointer(child, vkData.dependencies);
readTypeHandle( child, vkData ); }
} else if (category == "handle")
else if ( category == "struct" ) {
{ readTypeHandle(child, vkData);
readTypeStruct( child, vkData, false ); }
} else if (category == "struct")
else if ( category == "union" ) {
{ readTypeStruct(child, vkData, false);
readTypeStruct( child, vkData, true ); }
else if (category == "union")
{
readTypeStruct(child, vkData, true);
}
else
{
assert((category == "enum") || (category == "include"));
}
} }
else else
{ {
assert( ( category == "enum" ) || ( category == "include" ) ); assert(child->Attribute("name"));
vkData.dependencies.push_back(DependencyData(DependencyData::Category::REQUIRED, child->Attribute("name")));
} }
} }
else
{
assert( child->Attribute( "name" ) );
vkData.dependencies.push_back( DependencyData( DependencyData::Category::REQUIRED, child->Attribute( "name" ) ) );
}
} }
} }

File diff suppressed because it is too large Load Diff