summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/TextureDecoder.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/VideoCommon/TextureDecoder.h')
-rw-r--r--Source/Core/VideoCommon/TextureDecoder.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/TextureDecoder.h b/Source/Core/VideoCommon/TextureDecoder.h
index 7a08a6514a..e4b25e50ec 100644
--- a/Source/Core/VideoCommon/TextureDecoder.h
+++ b/Source/Core/VideoCommon/TextureDecoder.h
@@ -6,6 +6,7 @@
#include <tuple>
#include "Common/CommonTypes.h"
+#include "Common/EnumFormatter.h"
enum
{
@@ -32,8 +33,17 @@ enum class TextureFormat
// Special texture format used to represent YUVY xfb copies.
// They aren't really textures, but they share so much hardware and usecases that it makes sense
// to emulate them as part of texture cache.
+ // This isn't a real value that can be used on console; it only exists for ease of implementation.
XFB = 0xF,
};
+template <>
+struct fmt::formatter<TextureFormat> : EnumFormatter<TextureFormat::CMPR>
+{
+ static constexpr array_type names = {"I4", "I8", "IA4", "IA8", "RGB565",
+ "RGB5A3", "RGBA8", nullptr, "C4", "C8",
+ "C14X2", nullptr, nullptr, nullptr, "CMPR"};
+ formatter() : EnumFormatter(names) {}
+};
static inline bool IsColorIndexed(TextureFormat format)
{
@@ -82,8 +92,20 @@ enum class EFBCopyFormat
// Special texture format used to represent YUVY xfb copies.
// They aren't really textures, but they share so much hardware and usecases that it makes sense
// to emulate them as part of texture cache.
+ // This isn't a real value that can be used on console; it only exists for ease of implementation.
XFB = 0xF,
};
+template <>
+struct fmt::formatter<EFBCopyFormat> : EnumFormatter<EFBCopyFormat::GB8>
+{
+ static constexpr array_type names = {
+ "R4/I4/Z4", "R8/I8/Z8H (?)", "RA4/IA4", "RA8/IA8 (Z16 too?)",
+ "RGB565", "RGB5A3", "RGBA8", "A8",
+ "R8/I8/Z8H", "G8/Z8M", "B8/Z8L", "RG8/Z16R (Note: G and R are reversed)",
+ "GB8/Z16L",
+ };
+ formatter() : EnumFormatter(names) {}
+};
enum class TLUTFormat
{
@@ -92,6 +114,11 @@ enum class TLUTFormat
RGB565 = 0x1,
RGB5A3 = 0x2,
};
+template <>
+struct fmt::formatter<TLUTFormat> : EnumFormatter<TLUTFormat::RGB5A3>
+{
+ formatter() : EnumFormatter({"IA8", "RGB565", "RGB5A3"}) {}
+};
static inline bool IsValidTLUTFormat(TLUTFormat tlutfmt)
{