sampler_cache.cpp 615 B

123456789101112131415161718192021
  1. // Copyright 2019 yuzu Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #include "common/cityhash.h"
  5. #include "common/common_types.h"
  6. #include "video_core/sampler_cache.h"
  7. namespace VideoCommon {
  8. std::size_t SamplerCacheKey::Hash() const {
  9. static_assert(sizeof(raw) % sizeof(u64) == 0);
  10. return static_cast<std::size_t>(
  11. Common::CityHash64(reinterpret_cast<const char*>(raw.data()), sizeof(raw) / sizeof(u64)));
  12. }
  13. bool SamplerCacheKey::operator==(const SamplerCacheKey& rhs) const {
  14. return raw == rhs.raw;
  15. }
  16. } // namespace VideoCommon