Add support for new attribute "validstructs"; ignore new possible values for attribute "limittype".

This commit is contained in:
asuessenbach 2022-07-04 11:37:22 +02:00
parent 312b8ef80d
commit a7d2d85d63
2 changed files with 18 additions and 2 deletions

View File

@ -1914,6 +1914,19 @@ void VulkanHppGenerator::checkStructMemberCorrectness( std::string const &
} }
} }
void VulkanHppGenerator::checkValidStructs( int line, std::map<std::string, std::string> const & attributes ) const
{
auto it = attributes.find( "validstructs" );
if ( it != attributes.end() )
{
std::vector<std::string> validStructs = tokenize( it->second, "," );
for ( auto const & vs : validStructs )
{
check( m_structures.find( vs ) != m_structures.end(), line, "unknown struct <" + vs + "> listed in attribute <validstructs>" );
}
}
}
std::string VulkanHppGenerator::combineDataTypes( std::map<size_t, size_t> const & vectorParams, std::string VulkanHppGenerator::combineDataTypes( std::map<size_t, size_t> const & vectorParams,
std::vector<size_t> const & returnParams, std::vector<size_t> const & returnParams,
bool singular, bool singular,
@ -10622,7 +10635,9 @@ VulkanHppGenerator::ParamData VulkanHppGenerator::readCommandsCommandParam( tiny
{ "len", {} }, { "len", {} },
{ "noautovalidity", { "true" } }, { "noautovalidity", { "true" } },
{ "objecttype", { "objectType" } }, { "objecttype", { "objectType" } },
{ "optional", { "false", "true" } } } ); { "optional", { "false", "true" } },
{ "validstructs", {} } } );
checkValidStructs( line, attributes );
ParamData paramData( line ); ParamData paramData( line );
for ( auto attribute : attributes ) for ( auto attribute : attributes )
@ -12638,7 +12653,7 @@ void VulkanHppGenerator::readTypesTypeStructMember( tinyxml2::XMLElement const *
{ { "altlen", {} }, { { "altlen", {} },
{ "externsync", { "true" } }, { "externsync", { "true" } },
{ "len", {} }, { "len", {} },
{ "limittype", { "bitmask", "max", "min", "noauto", "range", "struct" } }, { "limittype", { "bitmask", "bits", "exact", "max", "min", "mul", "noauto", "pot", "range", "struct" } },
{ "noautovalidity", { "true" } }, { "noautovalidity", { "true" } },
{ "objecttype", { "objectType" } }, { "objecttype", { "objectType" } },
{ "optional", { "false", "true" } }, { "optional", { "false", "true" } },

View File

@ -396,6 +396,7 @@ private:
void checkHandleCorrectness() const; void checkHandleCorrectness() const;
void checkStructCorrectness() const; void checkStructCorrectness() const;
void checkStructMemberCorrectness( std::string const & structureName, std::vector<MemberData> const & members, std::set<std::string> & sTypeValues ) const; void checkStructMemberCorrectness( std::string const & structureName, std::vector<MemberData> const & members, std::set<std::string> & sTypeValues ) const;
void checkValidStructs( int line, std::map<std::string, std::string> const & attributes ) const;
std::string combineDataTypes( std::map<size_t, size_t> const & vectorParams, std::string combineDataTypes( std::map<size_t, size_t> const & vectorParams,
std::vector<size_t> const & returnParams, std::vector<size_t> const & returnParams,
bool singular, bool singular,