diff options
Diffstat (limited to 'src/libs/dxvk-native-1.9.2a/src/dxvk/dxvk_hash.h')
-rw-r--r-- | src/libs/dxvk-native-1.9.2a/src/dxvk/dxvk_hash.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/libs/dxvk-native-1.9.2a/src/dxvk/dxvk_hash.h b/src/libs/dxvk-native-1.9.2a/src/dxvk/dxvk_hash.h new file mode 100644 index 00000000..a0fe561d --- /dev/null +++ b/src/libs/dxvk-native-1.9.2a/src/dxvk/dxvk_hash.h @@ -0,0 +1,41 @@ +#pragma once + +#include <cstddef> + +namespace dxvk { + + struct DxvkEq { + template<typename T> + size_t operator () (const T& a, const T& b) const { + return a.eq(b); + } + }; + + struct DxvkHash { + template<typename T> + size_t operator () (const T& object) const { + return object.hash(); + } + }; + + class DxvkHashState { + + public: + + void add(size_t hash) { + m_value ^= hash + 0x9e3779b9 + + (m_value << 6) + + (m_value >> 2); + } + + operator size_t () const { + return m_value; + } + + private: + + size_t m_value = 0; + + }; + +}
\ No newline at end of file |