mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
34 lines
487 B
C
34 lines
487 B
C
|
#pragma once
|
||
|
|
||
|
#include <cstddef>
|
||
|
|
||
|
namespace dxvk {
|
||
|
|
||
|
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;
|
||
|
|
||
|
};
|
||
|
|
||
|
}
|