summaryrefslogtreecommitdiff
path: root/src/video_core/sampler_cache.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2019-04-17 21:45:56 -0400
committerGravatar GitHub2019-04-17 21:45:56 -0400
commit4294062516c91c8fdabbcb5b5bcde641c03c9218 (patch)
tree8420493647f54dbab66b3b654115e8c509f536d6 /src/video_core/sampler_cache.cpp
parentMerge pull request #2348 from FernandoS27/guest-bindless (diff)
parentgl_sampler_cache: Port sampler cache to OpenGL (diff)
downloadyuzu-4294062516c91c8fdabbcb5b5bcde641c03c9218.tar.gz
yuzu-4294062516c91c8fdabbcb5b5bcde641c03c9218.tar.xz
yuzu-4294062516c91c8fdabbcb5b5bcde641c03c9218.zip
Merge pull request #2318 from ReinUsesLisp/sampler-cache
gl_sampler_cache: Port sampler cache to OpenGL
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 @@
1// Copyright 2019 yuzu Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "common/cityhash.h"
6#include "common/common_types.h"
7#include "video_core/sampler_cache.h"
8
9namespace VideoCommon {
10
11std::size_t SamplerCacheKey::Hash() const {
12 static_assert(sizeof(raw) % sizeof(u64) == 0);
13 return static_cast<std::size_t>(
14 Common::CityHash64(reinterpret_cast<const char*>(raw.data()), sizeof(raw) / sizeof(u64)));
15}
16
17bool SamplerCacheKey::operator==(const SamplerCacheKey& rhs) const {
18 return raw == rhs.raw;
19}
20
21} // namespace VideoCommon