summaryrefslogtreecommitdiffstats
path: root/src/video_core/sampler_cache.cpp
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2019-04-02 20:54:11 +0200
committerReinUsesLisp <reinuseslisp@airmail.cc>2019-04-02 20:54:11 +0200
commitc5047540c9c3f807ed2164b938898ffff27f53bc (patch)
tree317395c2df72428942d25ac3d185d763cb52972d /src/video_core/sampler_cache.cpp
parentMerge pull request #2316 from ReinUsesLisp/fixup-process (diff)
downloadyuzu-c5047540c9c3f807ed2164b938898ffff27f53bc.tar
yuzu-c5047540c9c3f807ed2164b938898ffff27f53bc.tar.gz
yuzu-c5047540c9c3f807ed2164b938898ffff27f53bc.tar.bz2
yuzu-c5047540c9c3f807ed2164b938898ffff27f53bc.tar.lz
yuzu-c5047540c9c3f807ed2164b938898ffff27f53bc.tar.xz
yuzu-c5047540c9c3f807ed2164b938898ffff27f53bc.tar.zst
yuzu-c5047540c9c3f807ed2164b938898ffff27f53bc.zip
Diffstat (limited to 'src/video_core/sampler_cache.cpp')
-rw-r--r--src/video_core/sampler_cache.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/video_core/sampler_cache.cpp b/src/video_core/sampler_cache.cpp
new file mode 100644
index 000000000..53c7ef12d
--- /dev/null
+++ b/src/video_core/sampler_cache.cpp
@@ -0,0 +1,21 @@
+// Copyright 2019 yuzu Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#include "common/cityhash.h"
+#include "common/common_types.h"
+#include "video_core/sampler_cache.h"
+
+namespace VideoCommon {
+
+std::size_t SamplerCacheKey::Hash() const {
+ static_assert(sizeof(raw) % sizeof(u64) == 0);
+ return static_cast<std::size_t>(
+ Common::CityHash64(reinterpret_cast<const char*>(raw.data()), sizeof(raw) / sizeof(u64)));
+}
+
+bool SamplerCacheKey::operator==(const SamplerCacheKey& rhs) const {
+ return raw == rhs.raw;
+}
+
+} // namespace VideoCommon