MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Hpp / generateStructHashStructures

Method generateStructHashStructures

generator/VulkanHppGenerator.cpp:10997–11025  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10995}
10996
10997std::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
11027std::string VulkanHppGenerator::generateStructHashSum( std::string const & structName, std::vector<MemberData> const & members ) const
11028{

Callers

nothing calls this directly

Calls 1

replaceWithMapFunction · 0.85

Tested by

no test coverage detected