// Copyright 2017 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. #pragma once #include #include #include "Common/CommonTypes.h" #include "Common/MathUtil.h" enum class AbstractTextureFormat : u32 { RGBA8, DXT1, DXT3, DXT5, BPTC }; struct TextureConfig { constexpr TextureConfig() = default; bool operator==(const TextureConfig& o) const; MathUtil::Rectangle GetRect() const; u32 width = 0; u32 height = 0; u32 levels = 1; u32 layers = 1; AbstractTextureFormat format = AbstractTextureFormat::RGBA8; bool rendertarget = false; }; 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