mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-10-15 23:17:52 +00:00
video_core: Abstract vk_sampler_cache into a templated class
This commit is contained in:
parent
094442e8a3
commit
e62b0ad6ae
5 changed files with 101 additions and 58 deletions
21
src/video_core/sampler_cache.cpp
Normal file
21
src/video_core/sampler_cache.cpp
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue