From ee906ae6e80f8eb5ba2689b52afa15395b3c0421 Mon Sep 17 00:00:00 2001 From: iwubcode Date: Mon, 20 Jan 2025 14:24:54 -0600 Subject: [PATCH] VideoCommon: add formatter for AbstractTextureType --- Source/Core/VideoCommon/TextureConfig.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Source/Core/VideoCommon/TextureConfig.h b/Source/Core/VideoCommon/TextureConfig.h index e53245777a..1844a969cf 100644 --- a/Source/Core/VideoCommon/TextureConfig.h +++ b/Source/Core/VideoCommon/TextureConfig.h @@ -7,6 +7,7 @@ #include #include "Common/CommonTypes.h" +#include "Common/EnumFormatter.h" #include "Common/MathUtil.h" enum class AbstractTextureFormat : u32 @@ -41,11 +42,11 @@ enum AbstractTextureFlag : u32 AbstractTextureFlag_ComputeImage = (1 << 1), // Texture is used as a compute image. }; -enum class AbstractTextureType +enum class AbstractTextureType : u8 { - Texture_2DArray, // Used as a 2D texture array - Texture_2D, // Used as a normal 2D texture - Texture_CubeMap, // Used as a cube map texture + Texture_2DArray = 0, // Used as a 2D texture array + Texture_2D = 1, // Used as a normal 2D texture + Texture_CubeMap = 2, // Used as a cube map texture }; struct TextureConfig @@ -92,3 +93,9 @@ struct std::hash return std::hash{}(id); } }; + +template <> +struct fmt::formatter : EnumFormatter +{ + constexpr formatter() : EnumFormatter({"2D Array", "2D", "Cubemap"}) {} +};