Introduce support of std::hash for vk-structures.

This commit is contained in:
asuessenbach
2021-12-02 12:21:30 +01:00
parent bc7a5b56b9
commit 3515c720fc
7 changed files with 17287 additions and 593 deletions

View File

@@ -591,6 +591,10 @@ By default, a little helper class ```DynamicLoader``` is used to dynamically loa
By default, the member ```m_mask``` of the ```Flags``` template class is private. This is to prevent accidentally setting a ```Flags``` with some inappropriate value. But it also prevents using a ```Flags```, or a structure holding a ```Flags```, to be used as a non-type template parameter. If you really need that functionality, and accept the reduced security, you can use this define to change the access specifier for m_mask from private to public, which allows using a ```Flags``` as a non-type template parameter.
#### VULKAN_HPP_HASH_COMBINE
This define can be used to specify your own hash combiner function. In order to determine the hash of a vk-structure, the hashes of the members of that struct are to be combined. This is done by this define, which by default is identical to what the function ```boost::hash_combine()``` does. It gets the type of the to-be-combined value, the seed, which is the combined value up to that point, and finally the to-be-combined value. This hash calculation determines a "shallow" hash, as it takes the hashes of any pointer in a structure, and not the hash of a pointed-to value.
#### VULKAN_HPP_INLINE
This is set to be the compiler-dependent attribute used to mark functions as inline. If your compiler happens to need some different attribute, you can set this define accordingly before including vulkan.hpp.