| 10995 | } |
| 10996 | |
| 10997 | std::string VulkanHppGenerator::generateStructHashStructures() const |
| 10998 | { |
| 10999 | std::string const hashesTemplate = R"( |
| 11000 | #if 14 <= VULKAN_HPP_CPP_VERSION |
| 11001 | //====================================== |
| 11002 | //=== HASH structures for structures === |
| 11003 | //====================================== |
| 11004 | |
| 11005 | # if !defined( VULKAN_HPP_HASH_COMBINE ) |
| 11006 | # define VULKAN_HPP_HASH_COMBINE( seed, value ) \ |
| 11007 | seed ^= std::hash<std::decay<decltype( value )>::type>{}( value ) + 0x9e3779b9 + ( seed << 6 ) + ( seed >> 2 ) |
| 11008 | # endif |
| 11009 | |
| 11010 | ${hashes} |
| 11011 | #endif // 14 <= VULKAN_HPP_CPP_VERSION |
| 11012 | )"; |
| 11013 | |
| 11014 | // Note reordering structs or handles by features and extensions is not possible! |
| 11015 | std::set<std::string> listedStructs; |
| 11016 | std::string hashes; |
| 11017 | for ( auto const & structure : m_structs ) |
| 11018 | { |
| 11019 | if ( !listedStructs.contains( structure.first ) && isTypeUsed( structure.first ) ) |
| 11020 | { |
| 11021 | hashes += generateStructHashStructure( structure, listedStructs ); |
| 11022 | } |
| 11023 | } |
| 11024 | return replaceWithMap( hashesTemplate, { { "hashes", hashes } } ); |
| 11025 | } |
| 11026 | |
| 11027 | std::string VulkanHppGenerator::generateStructHashSum( std::string const & structName, std::vector<MemberData> const & members ) const |
| 11028 | { |
nothing calls this directly
no test coverage detected