Generate std::hash specializations into the new file vulkan_hash.hpp, requiring C++14 for std::hash specializations of the vulkan structures.
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
// unknow compiler... just ignore the warnings for yourselves ;)
|
||||
#endif
|
||||
|
||||
#include "vulkan/vulkan.hpp"
|
||||
#include "vulkan/vulkan_hash.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <unordered_map>
|
||||
@@ -49,6 +49,10 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
std::unordered_map<vk::Instance, size_t> umap;
|
||||
umap[*instance] = 1;
|
||||
|
||||
vk::FormatFeatureFlags fff;
|
||||
auto hf = std::hash<vk::FormatFeatureFlags>{}( fff );
|
||||
|
||||
#if 14 <= VULKAN_HPP_CPP_VERSION
|
||||
vk::AabbPositionsKHR aabb0, aabb1;
|
||||
auto h3 = std::hash<vk::AabbPositionsKHR>{}( aabb0 );
|
||||
auto h4 = std::hash<vk::AabbPositionsKHR>{}( aabb1 );
|
||||
@@ -64,12 +68,9 @@ int main( int /*argc*/, char ** /*argv*/ )
|
||||
std::unordered_map<vk::AabbPositionsKHR, size_t> aabbMap;
|
||||
aabbMap[aabb0] = 1;
|
||||
|
||||
vk::AccelerationStructureInstanceKHR asi;
|
||||
asi.instanceCustomIndex = 1;
|
||||
asi.mask = 2;
|
||||
asi.instanceShaderBindingTableRecordOffset = 3;
|
||||
asi.flags = 4;
|
||||
auto h6 = std::hash<vk::AccelerationStructureInstanceKHR>{}( asi );
|
||||
vk::AccelerationStructureBuildSizesInfoKHR asbsi;
|
||||
auto h6 = std::hash<vk::AccelerationStructureBuildSizesInfoKHR>{}( asbsi );
|
||||
#endif
|
||||
}
|
||||
catch ( vk::SystemError const & err )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user