diff --git a/Source/Core/VideoCommon/TextureCacheBase.h b/Source/Core/VideoCommon/TextureCacheBase.h index 00ca728157..f5b2a1a8a0 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.h +++ b/Source/Core/VideoCommon/TextureCacheBase.h @@ -212,9 +212,9 @@ private: int frameCount = FRAMECOUNT_INVALID; TexPoolEntry(std::unique_ptr tex) : texture(std::move(tex)) {} }; - typedef std::multimap TexAddrCache; - typedef std::multimap TexHashCache; - typedef std::unordered_multimap TexPool; + using TexAddrCache = std::multimap; + using TexHashCache = std::multimap; + using TexPool = std::unordered_multimap; void SetBackupConfig(const VideoConfig& config); diff --git a/Source/Core/VideoCommon/TextureConfig.h b/Source/Core/VideoCommon/TextureConfig.h index 7a9ac08bcc..86ea88f651 100644 --- a/Source/Core/VideoCommon/TextureConfig.h +++ b/Source/Core/VideoCommon/TextureConfig.h @@ -31,14 +31,22 @@ struct TextureConfig u32 layers = 1; AbstractTextureFormat format = AbstractTextureFormat::RGBA8; bool rendertarget = false; - - struct Hasher : std::hash - { - size_t operator()(const TextureConfig& c) const - { - u64 id = (u64)c.rendertarget << 63 | (u64)c.format << 50 | (u64)c.layers << 48 | - (u64)c.levels << 32 | (u64)c.height << 16 | (u64)c.width; - return std::hash::operator()(id); - } - }; }; + +namespace std +{ +template <> +struct hash +{ + using argument_type = TextureConfig; + using result_type = size_t; + + result_type operator()(const argument_type& c) const noexcept + { + const u64 id = static_cast(c.rendertarget) << 63 | static_cast(c.format) << 50 | + static_cast(c.layers) << 48 | static_cast(c.levels) << 32 | + static_cast(c.height) << 16 | static_cast(c.width); + return std::hash{}(id); + } +}; +} // namespace std