aboutsummaryrefslogtreecommitdiff
path: root/src/common/hash.h
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-09-23 14:02:02 -0400
committerFernandoS27 <fsahmkow27@gmail.com>2019-10-25 09:01:29 -0400
commit1a58f45d76fe7756dd365e099d1536da769c1eab (patch)
tree668a61e870c57249edf94ba2e2002d3ace18b118 /src/common/hash.h
parent2ef696c85a37917102a9f869775180ab225f0d56 (diff)
VideoCore: Unify const buffer accessing along engines and provide ConstBufferLocker class to shaders.
Diffstat (limited to 'src/common/hash.h')
-rw-r--r--src/common/hash.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/common/hash.h b/src/common/hash.h
index 40194d1ee4..c939709bc9 100644
--- a/src/common/hash.h
+++ b/src/common/hash.h
@@ -6,6 +6,8 @@
#include <cstddef>
#include <cstring>
+#include <utility>
+#include <boost/functional/hash.hpp>
#include "common/cityhash.h"
#include "common/common_types.h"
@@ -68,4 +70,13 @@ struct HashableStruct {
}
};
+struct PairHash {
+ template <class T1, class T2>
+ std::size_t operator()(const std::pair<T1, T2>& pair) const {
+ std::size_t seed = std::hash<T1>()(pair.first);
+ boost::hash_combine(seed, std::hash<T2>()(pair.second));
+ return seed;
+ }
+};
+
} // namespace Common