From 70f9fc4e7526fc9cfc008a43cd33229f62be99b6 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Wed, 10 Feb 2021 18:11:31 -0800 Subject: Convert BPMemory to BitField and enum class Additional changes: - For TevStageCombiner's ColorCombiner and AlphaCombiner, op/comparison and scale/compare_mode have been split as there are different meanings and enums if bias is set to compare. (Shift has also been renamed to scale) - In TexMode0, min_filter has been split into min_mip and min_filter. - In TexImage1, image_type is now cache_manually_managed. - The unused bit in GenMode is now exposed. - LPSize's lineaspect is now named adjust_for_aspect_ratio. --- Source/Core/VideoCommon/TextureDecoder.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'Source/Core/VideoCommon/TextureDecoder.h') 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 #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 : EnumFormatter +{ + 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 : EnumFormatter +{ + 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 : EnumFormatter +{ + formatter() : EnumFormatter({"IA8", "RGB565", "RGB5A3"}) {} +}; static inline bool IsValidTLUTFormat(TLUTFormat tlutfmt) { -- cgit v1.2.3