From 2600a8ada06f06175f3cb01672b791adf7e61ac2 Mon Sep 17 00:00:00 2001 From: fincs Date: Sat, 6 Mar 2021 14:26:32 +0100 Subject: [PATCH] gx2: enhance GX2AttribFormat with info from decaf-emu https://github.com/decaf-emu/decaf-emu/blob/master/src/libdecaf/src/cafe/libraries/gx2/gx2_enum.h#L21-L49 --- include/gx2/enum.h | 60 +++++++++++++++++++++++++++++++++------------- 1 file changed, 44 insertions(+), 16 deletions(-) diff --git a/include/gx2/enum.h b/include/gx2/enum.h index 60de2c7..5104dd6 100644 --- a/include/gx2/enum.h +++ b/include/gx2/enum.h @@ -43,28 +43,56 @@ typedef enum GX2AlphaToMaskMode typedef enum GX2AttribFormat { - GX2_ATTRIB_FORMAT_UNORM_8 = 0x0, - GX2_ATTRIB_FORMAT_UNORM_8_8 = 0x04, - GX2_ATTRIB_FORMAT_UNORM_8_8_8_8 = 0x0A, + GX2_ATTRIB_TYPE_8 = 0x00, + GX2_ATTRIB_TYPE_4_4 = 0x01, + GX2_ATTRIB_TYPE_16 = 0x02, + GX2_ATTRIB_TYPE_16_FLOAT = 0x03, + GX2_ATTRIB_TYPE_8_8 = 0x04, + GX2_ATTRIB_TYPE_32 = 0x05, + GX2_ATTRIB_TYPE_32_FLOAT = 0x06, + GX2_ATTRIB_TYPE_16_16 = 0x07, + GX2_ATTRIB_TYPE_16_16_FLOAT = 0x08, + GX2_ATTRIB_TYPE_10_11_11_FLOAT = 0x09, + GX2_ATTRIB_TYPE_8_8_8_8 = 0x0A, + GX2_ATTRIB_TYPE_10_10_10_2 = 0x0B, + GX2_ATTRIB_TYPE_32_32 = 0x0C, + GX2_ATTRIB_TYPE_32_32_FLOAT = 0x0D, + GX2_ATTRIB_TYPE_16_16_16_16 = 0x0E, + GX2_ATTRIB_TYPE_16_16_16_16_FLOAT = 0x0F, + GX2_ATTRIB_TYPE_32_32_32 = 0x10, + GX2_ATTRIB_TYPE_32_32_32_FLOAT = 0x11, + GX2_ATTRIB_TYPE_32_32_32_32 = 0x12, + GX2_ATTRIB_TYPE_32_32_32_32_FLOAT = 0x13, - GX2_ATTRIB_FORMAT_UINT_8 = 0x100, - GX2_ATTRIB_FORMAT_UINT_8_8 = 0x104, - GX2_ATTRIB_FORMAT_UINT_8_8_8_8 = 0x10A, + GX2_ATTRIB_FLAG_INTEGER = 0x100, + GX2_ATTRIB_FLAG_SIGNED = 0x200, + GX2_ATTRIB_FLAG_DEGAMMA = 0x400, + GX2_ATTRIB_FLAG_SCALED = 0x800, - GX2_ATTRIB_FORMAT_SNORM_8 = 0x200, - GX2_ATTRIB_FORMAT_SNORM_8_8 = 0x204, - GX2_ATTRIB_FORMAT_SNORM_8_8_8_8 = 0x20A, + GX2_ATTRIB_FORMAT_UNORM_8 = GX2_ATTRIB_TYPE_8, + GX2_ATTRIB_FORMAT_UNORM_8_8 = GX2_ATTRIB_TYPE_8_8, + GX2_ATTRIB_FORMAT_UNORM_8_8_8_8 = GX2_ATTRIB_TYPE_8_8_8_8, - GX2_ATTRIB_FORMAT_SINT_8 = 0x300, - GX2_ATTRIB_FORMAT_SINT_8_8 = 0x304, - GX2_ATTRIB_FORMAT_SINT_8_8_8_8 = 0x30A, + GX2_ATTRIB_FORMAT_UINT_8 = GX2_ATTRIB_FLAG_INTEGER | GX2_ATTRIB_TYPE_8, + GX2_ATTRIB_FORMAT_UINT_8_8 = GX2_ATTRIB_FLAG_INTEGER | GX2_ATTRIB_TYPE_8_8, + GX2_ATTRIB_FORMAT_UINT_8_8_8_8 = GX2_ATTRIB_FLAG_INTEGER | GX2_ATTRIB_TYPE_8_8_8_8, - GX2_ATTRIB_FORMAT_FLOAT_32 = 0x806, - GX2_ATTRIB_FORMAT_FLOAT_32_32 = 0x80d, - GX2_ATTRIB_FORMAT_FLOAT_32_32_32 = 0x811, - GX2_ATTRIB_FORMAT_FLOAT_32_32_32_32 = 0x813, + GX2_ATTRIB_FORMAT_SNORM_8 = GX2_ATTRIB_FLAG_SIGNED | GX2_ATTRIB_TYPE_8, + GX2_ATTRIB_FORMAT_SNORM_8_8 = GX2_ATTRIB_FLAG_SIGNED | GX2_ATTRIB_TYPE_8_8, + GX2_ATTRIB_FORMAT_SNORM_8_8_8_8 = GX2_ATTRIB_FLAG_SIGNED | GX2_ATTRIB_TYPE_8_8_8_8, + + GX2_ATTRIB_FORMAT_SINT_8 = GX2_ATTRIB_FLAG_SIGNED | GX2_ATTRIB_FLAG_INTEGER | GX2_ATTRIB_TYPE_8, + GX2_ATTRIB_FORMAT_SINT_8_8 = GX2_ATTRIB_FLAG_SIGNED | GX2_ATTRIB_FLAG_INTEGER | GX2_ATTRIB_TYPE_8_8, + GX2_ATTRIB_FORMAT_SINT_8_8_8_8 = GX2_ATTRIB_FLAG_SIGNED | GX2_ATTRIB_FLAG_INTEGER | GX2_ATTRIB_TYPE_8_8_8_8, + + GX2_ATTRIB_FORMAT_FLOAT_32 = GX2_ATTRIB_FLAG_SCALED | GX2_ATTRIB_TYPE_32_FLOAT, + GX2_ATTRIB_FORMAT_FLOAT_32_32 = GX2_ATTRIB_FLAG_SCALED | GX2_ATTRIB_TYPE_32_32_FLOAT, + GX2_ATTRIB_FORMAT_FLOAT_32_32_32 = GX2_ATTRIB_FLAG_SCALED | GX2_ATTRIB_TYPE_32_32_32_FLOAT, + GX2_ATTRIB_FORMAT_FLOAT_32_32_32_32 = GX2_ATTRIB_FLAG_SCALED | GX2_ATTRIB_TYPE_32_32_32_32_FLOAT, } GX2AttribFormat; +WUT_ENUM_BITMASK_TYPE(GX2AttribFormat) + typedef enum GX2AttribIndexType { GX2_ATTRIB_INDEX_PER_VERTEX = 0,