diff options
| author | bunnei <bunneidev@gmail.com> | 2019-04-17 21:45:56 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-17 21:45:56 -0400 |
| commit | 4294062516c91c8fdabbcb5b5bcde641c03c9218 (patch) | |
| tree | 8420493647f54dbab66b3b654115e8c509f536d6 /src/video_core/sampler_cache.cpp | |
| parent | 5bd5140bdecd7139029426502b3a474a7d9c9608 (diff) | |
| parent | 576ad9a012a22615ad430dd898b47a8d59b9ee3f (diff) | |
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.cpp | 21 |
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 |
