diff options
| author | Pokechu22 <Pokechu022@gmail.com> | 2021-02-10 18:11:31 -0800 |
|---|---|---|
| committer | Pokechu22 <Pokechu022@gmail.com> | 2021-03-06 19:27:19 -0800 |
| commit | 70f9fc4e7526fc9cfc008a43cd33229f62be99b6 (patch) | |
| tree | 48fae2cac1ed47ec5912dca4bf00716509192225 /Source/Core/VideoCommon/TextureDecoder.h | |
| parent | db8ced7e4e4724c38f148ee449c346e447dd3942 (diff) | |
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.
Diffstat (limited to 'Source/Core/VideoCommon/TextureDecoder.h')
| -rw-r--r-- | Source/Core/VideoCommon/TextureDecoder.h | 27 |
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) { |
