diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index 7f1cb40..f5c4775 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -1914,6 +1914,19 @@ void VulkanHppGenerator::checkStructMemberCorrectness( std::string const & } } +void VulkanHppGenerator::checkValidStructs( int line, std::map const & attributes ) const +{ + auto it = attributes.find( "validstructs" ); + if ( it != attributes.end() ) + { + std::vector validStructs = tokenize( it->second, "," ); + for ( auto const & vs : validStructs ) + { + check( m_structures.find( vs ) != m_structures.end(), line, "unknown struct <" + vs + "> listed in attribute " ); + } + } +} + std::string VulkanHppGenerator::combineDataTypes( std::map const & vectorParams, std::vector const & returnParams, bool singular, @@ -10556,7 +10569,9 @@ VulkanHppGenerator::ParamData VulkanHppGenerator::readCommandsCommandParam( tiny { "len", {} }, { "noautovalidity", { "true" } }, { "objecttype", { "objectType" } }, - { "optional", { "false", "true" } } } ); + { "optional", { "false", "true" } }, + { "validstructs", {} } } ); + checkValidStructs( line, attributes ); ParamData paramData( line ); for ( auto attribute : attributes ) @@ -12572,7 +12587,7 @@ void VulkanHppGenerator::readTypesTypeStructMember( tinyxml2::XMLElement const * { { "altlen", {} }, { "externsync", { "true" } }, { "len", {} }, - { "limittype", { "bitmask", "max", "min", "noauto", "range", "struct" } }, + { "limittype", { "bitmask", "bits", "exact", "max", "min", "mul", "noauto", "pot", "range", "struct" } }, { "noautovalidity", { "true" } }, { "objecttype", { "objectType" } }, { "optional", { "false", "true" } }, diff --git a/VulkanHppGenerator.hpp b/VulkanHppGenerator.hpp index df92fb7..e6fc5ee 100644 --- a/VulkanHppGenerator.hpp +++ b/VulkanHppGenerator.hpp @@ -396,6 +396,7 @@ private: void checkHandleCorrectness() const; void checkStructCorrectness() const; void checkStructMemberCorrectness( std::string const & structureName, std::vector const & members, std::set & sTypeValues ) const; + void checkValidStructs( int line, std::map const & attributes ) const; std::string combineDataTypes( std::map const & vectorParams, std::vector const & returnParams, bool singular,