Merge pull request #912 from asuessenbach/typesafeCheck

Add support of define VK_USE_64_BIT_PTR_DEFINES.
This commit is contained in:
Andreas Süßenbach 2021-03-22 12:34:07 +01:00 committed by GitHub
commit 1bc11b2e54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11731,12 +11731,20 @@ void VulkanHppGenerator::readDefine( tinyxml2::XMLElement const *
if ( !name.empty() )
{
check( !element->FirstChildElement(), line, "unknown formatting of type category=define name <" + name + ">" );
check( name == "VK_DEFINE_NON_DISPATCHABLE_HANDLE", line, "unknown type category=define name <" + name + ">" );
check( ( name == "VK_USE_64_BIT_PTR_DEFINES" ) || ( name == "VK_DEFINE_NON_DISPATCHABLE_HANDLE" ),
line,
"unknown type category=define name <" + name + ">" );
check( element->LastChild() && element->LastChild()->ToText() && element->LastChild()->ToText()->Value(),
line,
"unknown formatting of type category=define named <" + name + ">" );
// filter out the check for the different types of VK_DEFINE_NON_DISPATCHABLE_HANDLE
if ( name == "VK_USE_64_BIT_PTR_DEFINES" )
{
m_typesafeCheck = "#if defined( VK_USE_64_BIT_PTR_DEFINES )\n";
}
else if ( m_typesafeCheck.empty() )
{
std::string text = element->LastChild()->ToText()->Value();
size_t start = text.find( "#if defined(__LP64__)" );
check( start != std::string::npos, line, "unexpected text in type category=define named <" + name + ">" );
@ -11744,6 +11752,7 @@ void VulkanHppGenerator::readDefine( tinyxml2::XMLElement const *
check( end != std::string::npos, line, "unexpected text in type category=define named <" + name + ">" );
m_typesafeCheck = text.substr( start, end - start );
}
}
else if ( element->GetText() )
{
std::string text = element->GetText();