Create a gist now

Instantly share code, notes, and snippets.

@aras-p /main.cpp
Last active Oct 25, 2017

What would you like to do?
Slow to compile inline tables under MSVC
// See http://aras-p.info/blog/2017/10/24/Slow-to-Compile-Table-Initializers/
//
// Some combination of "enums-like-ints" utilities (global operators) and
// large constant data tables placed inside functions (instead of global variables)
// is causing VS2015+ to be fairly slow at compiling with /O2
//
// Here's a simplified excerpt taken from a larger codebase (Unity game engine),
// and cut down a bit to have a small-ish repro. The most slow part was the
// GetDesc function, with a large FormatDesc table initialization inside of it,
// coupled with FormatPropertyFlags using ENUM_FLAGS macros to define "type-safe"
// operators & utility functions.
//
// The command line used to compile is:
// cl /O2 /Zi /GS- /GR- /EHsc- /MT main.cpp /link /OPT:REF /OPT:ICF
//
// The results I get are:
//
// time exe kb large symbols
// VS2010 SP1: 1.8s 58 12kb GetDesc
// /DUSE_ENUM_FLAGS=0 0.2s 46
// /DUSE_INLINE_TABLE=0 1.4s 50 2kb dynamicinitializerfor'table'
// both 0.2s 46
// VS2015 Update 3: 15.1s (!) 189 45kb IsFloatFormat, 45kb IsHalfFormat
// /cgthreads1 42.6s (!)
// /DUSE_ENUM_FLAGS=0 0.4s 96
// /DUSE_INLINE_TABLE=0 2.1s 96
// both 0.4s 96
// VS2017 15.3: 19.2s (!) 96
// /cgthreads1 37.5s (!)
// /DUSE_ENUM_FLAGS=0 0.4s 96
// /DUSE_INLINE_TABLE=0 2.7s 96
// both 0.4s 96
//
// What seems to be happening is:
//
// - VS2015 emits super large initializers for the table, inlined into IsFloatFormat & IsHalfFormat.
// Super-long sequences of
// movdqa xmm0,xmmword ptr [__xmm@00000000000000040000000400000005 (07FF7302AA430h)]
// movdqa xmmword ptr[__NULL_IMPORT_DESCRIPTOR + 0E68h(07FF7302AC080h)], xmm0
// movdqa xmm0, xmmword ptr[__xmm@00000004000000050000000200000001 (07FF7302AA690h)]
// movdqa xmmword ptr[__NULL_IMPORT_DESCRIPTOR + 0E98h(07FF7302AC0B0h)], xmm0
// movdqa xmm0, xmmword ptr[__xmm@00000004000000040000000000000003 (07FF7302AA680h)]
// movdqa xmmword ptr[__NULL_IMPORT_DESCRIPTOR + 0ED8h(07FF7302AC0F0h)], xmm0
// movdqa xmm0, xmmword ptr[__xmm@00000008000000050000000400000004 (07FF7302AA710h)]
// movdqa xmmword ptr[__NULL_IMPORT_DESCRIPTOR + 0F08h(07FF7302AC120h)], xmm0
// movdqa xmm0, xmmword ptr[__xmm@0000003e000000080000000800000005 (07FF7302AAAF0h)]
// movdqa xmmword ptr[__NULL_IMPORT_DESCRIPTOR + 0F48h(07FF7302AC160h)], xmm0
// movdqa xmm0, xmmword ptr[__xmm@00000008000000050000000200000001 (07FF7302AA700h)]
// movdqa xmmword ptr[__NULL_IMPORT_DESCRIPTOR + 0F78h(07FF7302AC190h)], xmm0
// movdqa xmm0, xmmword ptr[__xmm@00000004000000080000000000000003 (07FF7302AA6A0h)]
// movdqa xmmword ptr[__NULL_IMPORT_DESCRIPTOR + 0FB8h(07FF7302AC1D0h)], xmm0
// movdqa xmm0, xmmword ptr[__xmm@0000000c000000050000000400000004 (07FF7302AA7A0h)]
// movdqa xmmword ptr[__NULL_IMPORT_DESCRIPTOR + 0FE8h(07FF7302AC200h)], xmm0
// movdqa xmm0, xmmword ptr[__xmm@000000000000000c0000000c00000005 (07FF7302AA480h)]
// movdqa xmmword ptr[__NULL_IMPORT_DESCRIPTOR + 1028h(07FF7302AC240h)], xmm0
// mov dword ptr[__NULL_IMPORT_DESCRIPTOR + 0E50h(07FF7302AC068h)], 1Ch
// mov qword ptr[__NULL_IMPORT_DESCRIPTOR + 0E58h(07FF7302AC070h)], 1010102h
// mov dword ptr[__NULL_IMPORT_DESCRIPTOR + 0E60h(07FF7302AC078h)], 1
// mov dword ptr[__NULL_IMPORT_DESCRIPTOR + 0E64h(07FF7302AC07Ch)], 4
// mov dword ptr[__NULL_IMPORT_DESCRIPTOR + 0E78h(07FF7302AC090h)], 1Ch
// mov word ptr[__NULL_IMPORT_DESCRIPTOR + 0E7Ch(07FF7302AC094h)], 2
// <... a lot of code skipped >
//
// - If USE_ENUM_FLAGS is not used, then VS2015 optimizer can "see past that"; resulting code is small
// and compiles fast.
//
// - VS2017 in all cases emits roughly the same code, with table being purely in constant data segment,
// and functions become just simple inline checks. However presence of USE_ENUM_FLAGS causes it to take
// 19 seconds to compile this file, as opposed to half a second without them.
//
//
// For comparison, I also compiled this same file with g++ 5.4 (part of Win10 Linux subsystem), and it compiles
// it with -O2 in 0.35 seconds, no matter which of USE_* option is used. Resulting executable size is roughly the
// same in all cases too.
//
// Note: using constexpr on the ENUM_FLAGS operator and table data initialization
// makes it compile fast & executable is small. Just might be a bit of a surprise when upgrading
// old pre-C++11 codebase to a later compiler.
#ifndef USE_ENUM_FLAGS
#define USE_ENUM_FLAGS 1
#endif
#ifndef USE_INLINE_TABLE
#define USE_INLINE_TABLE 1
#endif
#ifndef USE_CONSTEXPR
#define USE_CONSTEXPR 0
#endif
#if USE_CONSTEXPR && _MSC_VER >= 1900
#define CONST constexpr
#else
#define CONST const
#endif
// -----------------------------------
// A bunch of enums & structs describing a "graphics format", taken from our much larger codebase and simplified
// a bit to be isolated from the rest.
enum FormatPropertyFlags
{
kFormatPropertyCompressedBit = (1 << 0),
kFormatPropertyPackedBit = (1 << 1),
kFormatPropertySRGBBit = (1 << 2),
kFormatPropertyNormBit = (1 << 3),
kFormatPropertyUnsignedBit = (1 << 4),
kFormatPropertySignedBit = (1 << 5),
kFormatPropertyIntegerBit = (1 << 6),
kFormatPropertyIEEE754Bit = (1 << 7),
kFormatPropertyDepthBit = (1 << 8),
kFormatPropertyStencilBit = (1 << 9),
kFormatPropertyBlockSizeIsMinTextureMipSizeBit = (1 << 10),
kFormatPropertyNoNeedMipMapsBit = (1 << 11),
};
#if USE_ENUM_FLAGS
#define ENUM_FLAGS(T) CONST inline T operator |(const T left, const T right) { return static_cast<T>(static_cast<unsigned>(left) | static_cast<unsigned>(right)); }
ENUM_FLAGS(FormatPropertyFlags);
#endif
enum FormatSwizzle
{
kFormatSwizzleR, kFormatSwizzleChannelFirst = kFormatSwizzleR,
kFormatSwizzleG,
kFormatSwizzleB,
kFormatSwizzleA, kFormatSwizzleChannelLast = kFormatSwizzleA,
kFormatSwizzle0,
kFormatSwizzle1, kFormatSwizzleMax = kFormatSwizzle1
};
enum GraphicsFormat
{
kFormatNone = 0, kFormatFirst = kFormatNone,
// sRGB formats
kFormatR8_SRGB,
kFormatRG8_SRGB,
kFormatRGB8_SRGB,
kFormatRGBA8_SRGB,
// 8 bit integer formats
kFormatR8_UNorm,
kFormatRG8_UNorm,
kFormatRGB8_UNorm,
kFormatRGBA8_UNorm,
kFormatR8_SNorm,
kFormatRG8_SNorm,
kFormatRGB8_SNorm,
kFormatRGBA8_SNorm,
kFormatR8_UInt,
kFormatRG8_UInt,
kFormatRGB8_UInt,
kFormatRGBA8_UInt,
kFormatR8_SInt,
kFormatRG8_SInt,
kFormatRGB8_SInt,
kFormatRGBA8_SInt,
// 16 bit integer formats
kFormatR16_UNorm,
kFormatRG16_UNorm,
kFormatRGB16_UNorm,
kFormatRGBA16_UNorm,
kFormatR16_SNorm,
kFormatRG16_SNorm,
kFormatRGB16_SNorm,
kFormatRGBA16_SNorm,
kFormatR16_UInt,
kFormatRG16_UInt,
kFormatRGB16_UInt,
kFormatRGBA16_UInt,
kFormatR16_SInt,
kFormatRG16_SInt,
kFormatRGB16_SInt,
kFormatRGBA16_SInt,
// 32 bit integer formats
kFormatR32_UInt,
kFormatRG32_UInt,
kFormatRGB32_UInt,
kFormatRGBA32_UInt,
kFormatR32_SInt,
kFormatRG32_SInt,
kFormatRGB32_SInt,
kFormatRGBA32_SInt,
// HDR formats
kFormatR16_SFloat,
kFormatRG16_SFloat,
kFormatRGB16_SFloat,
kFormatRGBA16_SFloat,
kFormatR32_SFloat,
kFormatRG32_SFloat,
kFormatRGB32_SFloat,
kFormatRGBA32_SFloat,
// Packed formats
kFormatRGB10A2_UNorm,
kFormatRGB10A2_UInt,
kFormatRGB10A2_SInt,
kFormatRGB9E5_UFloat,
kFormatRG11B10_UFloat,
// Alpha format
kFormatA8_UNorm,
kFormatA16_UNorm,
// BGR formats
kFormatBGR8_SRGB,
kFormatBGRA8_SRGB,
kFormatBGR8_UNorm,
kFormatBGRA8_UNorm,
kFormatBGR8_SNorm,
kFormatBGRA8_SNorm,
kFormatBGR8_UInt,
kFormatBGRA8_UInt,
kFormatBGR8_SInt,
kFormatBGRA8_SInt,
kFormatBGR10A2_UNorm,
kFormatBGR10A2_UInt,
kFormatBGR10A2XR_SRGB,
kFormatBGR10A2XR_UNorm,
kFormatBGR10XR_SRGB,
kFormatBGR10XR_UNorm,
kFormatBGRA10XR_SRGB,
kFormatBGRA10XR_UNorm,
// 16 bit packed formats
kFormatRGBA4_UNorm,
kFormatBGRA4_UNorm,
kFormatR5G6B5_UNorm,
kFormatB5G6R5_UNorm,
kFormatRGB5A1_UNorm,
kFormatBGR5A1_UNorm,
kFormatA1RGB5_UNorm,
// ARGB formats... TextureFormat legacy
kFormatARGB8_SRGB,
kFormatARGB8_UNorm,
kFormatARGB32_SFloat,
// Depth Stencil for formats
kFormatDepth16_UInt,
kFormatDepth24_UInt,
kFormatDepth24_UInt_Stencil8_UInt,
kFormatDepth32_SFloat,
kFormatD32_SFloat_Stencil8_Uint,
kFormatStencil8_Uint,
// Compression formats
kFormatRGB_DXT1_SRGB, kFormatDXTCFirst = kFormatRGB_DXT1_SRGB,
kFormatRGB_DXT1_UNorm,
kFormatRGBA_DXT3_SRGB,
kFormatRGBA_DXT3_UNorm,
kFormatRGBA_DXT5_SRGB,
kFormatRGBA_DXT5_UNorm, kFormatDXTCLast = kFormatRGBA_DXT5_UNorm,
kFormatR_BC4_UNorm, kFormatRGTCFirst = kFormatR_BC4_UNorm,
kFormatR_BC4_SNorm,
kFormatRG_BC5_UNorm,
kFormatRG_BC5_SNorm, kFormatRGTCLast = kFormatRG_BC5_SNorm,
kFormatRGB_BC6H_UFloat, kFormatBPTCFirst = kFormatRGB_BC6H_UFloat,
kFormatRGB_BC6H_SFloat,
kFormatRGBA_BC7_SRGB,
kFormatRGBA_BC7_UNorm, kFormatBPTCLast = kFormatRGBA_BC7_UNorm,
kFormatRGB_PVRTC_2Bpp_SRGB, kFormatPVRTCFirst = kFormatRGB_PVRTC_2Bpp_SRGB,
kFormatRGB_PVRTC_2Bpp_UNorm,
kFormatRGB_PVRTC_4Bpp_SRGB,
kFormatRGB_PVRTC_4Bpp_UNorm,
kFormatRGBA_PVRTC_2Bpp_SRGB,
kFormatRGBA_PVRTC_2Bpp_UNorm,
kFormatRGBA_PVRTC_4Bpp_SRGB,
kFormatRGBA_PVRTC_4Bpp_UNorm, kFormatPVRTCLast = kFormatRGBA_PVRTC_4Bpp_UNorm,
kFormatRGB_ATC_UNorm, kFormatATCFirst = kFormatRGB_ATC_UNorm,
kFormatRGBA_ATC_UNorm, kFormatATCLast = kFormatRGBA_ATC_UNorm,
kFormatRGB_ETC_UNorm, kFormatETCFirst = kFormatRGB_ETC_UNorm,
kFormatRGB_ETC2_SRGB,
kFormatRGB_ETC2_UNorm,
kFormatRGB_A1_ETC2_SRGB,
kFormatRGB_A1_ETC2_UNorm,
kFormatRGBA_ETC2_SRGB,
kFormatRGBA_ETC2_UNorm, kFormatETCLast = kFormatRGBA_ETC2_UNorm,
kFormatR_EAC_UNorm, kFormatEACFirst = kFormatR_EAC_UNorm,
kFormatR_EAC_SNorm,
kFormatRG_EAC_UNorm,
kFormatRG_EAC_SNorm, kFormatEACLast = kFormatRG_EAC_SNorm,
kFormatRGBA_ASTC4X4_SRGB, kFormatASTCFirst = kFormatRGBA_ASTC4X4_SRGB,
kFormatRGBA_ASTC4X4_UNorm,
kFormatRGBA_ASTC5X5_SRGB,
kFormatRGBA_ASTC5X5_UNorm,
kFormatRGBA_ASTC6X6_SRGB,
kFormatRGBA_ASTC6X6_UNorm,
kFormatRGBA_ASTC8X8_SRGB,
kFormatRGBA_ASTC8X8_UNorm,
kFormatRGBA_ASTC10X10_SRGB,
kFormatRGBA_ASTC10X10_UNorm,
kFormatRGBA_ASTC12X12_SRGB,
kFormatRGBA_ASTC12X12_UNorm, kFormatASTCLast = kFormatRGBA_ASTC12X12_UNorm,
};
// Legacy enum
enum TextureFormat
{
kTexFormatUnknown = -1,
kTexFormatNone = 0,
kTexFormatAlpha8 = 1,
kTexFormatARGB4444 = 2,
kTexFormatRGB24 = 3,
kTexFormatRGBA32 = 4,
kTexFormatARGB32 = 5,
kTexFormatARGBFloat = 6,
kTexFormatRGB565 = 7,
kTexFormatBGR24 = 8,
kTexFormatAlphaLum16 = 9,
kTexFormatDXT1 = 10,
kTexFormatDXT3 = 11,
kTexFormatDXT5 = 12,
kTexFormatRGBA4444 = 13,
kTexFormatBGRA32 = 14,
kTexFormatRHalf = 15,
kTexFormatRGHalf = 16,
kTexFormatRGBAHalf = 17,
kTexFormatRFloat = 18,
kTexFormatRGFloat = 19,
kTexFormatRGBAFloat = 20,
kTexFormatYUY2 = 21,
kTexFormatRGB9e5Float = 22,
kTexFormatRGBFloat = 23,
kTexFormatBC6H = 24,
kTexFormatBC7 = 25,
kTexFormatBC4 = 26,
kTexFormatBC5 = 27,
kTexFormatDXT1Crunched = 28,
kTexFormatDXT5Crunched = 29,
kTexFormatPVRTC_RGB2 = 30,
kTexFormatPVRTC_RGBA2 = 31,
kTexFormatPVRTC_RGB4 = 32,
kTexFormatPVRTC_RGBA4 = 33,
kTexFormatETC_RGB4 = 34,
kTexFormatATC_RGB4 = 35,
kTexFormatATC_RGBA8 = 36,
kTexFormatEAC_R = 41,
kTexFormatEAC_R_SIGNED = 42,
kTexFormatEAC_RG = 43,
kTexFormatEAC_RG_SIGNED = 44,
kTexFormatETC2_RGB = 45,
kTexFormatETC2_RGBA1 = 46,
kTexFormatETC2_RGBA8 = 47,
kTexFormatASTC_RGB_4x4 = 48,
kTexFormatASTC_RGB_5x5 = 49,
kTexFormatASTC_RGB_6x6 = 50,
kTexFormatASTC_RGB_8x8 = 51,
kTexFormatASTC_RGB_10x10 = 52,
kTexFormatASTC_RGB_12x12 = 53,
kTexFormatASTC_RGBA_4x4 = 54,
kTexFormatASTC_RGBA_5x5 = 55,
kTexFormatASTC_RGBA_6x6 = 56,
kTexFormatASTC_RGBA_8x8 = 57,
kTexFormatASTC_RGBA_10x10 = 58,
kTexFormatASTC_RGBA_12x12 = 59,
kTexFormatETC_RGB4_3DS = 60,
kTexFormatETC_RGBA8_3DS = 61,
kTexFormatRG16 = 62,
kTexFormatR8 = 63,
kTexFormatETC_RGB4Crunched = 64,
kTexFormatETC2_RGBA8Crunched = 65,
kTexFormatTotalCount,
};
// Legacy enum
enum RenderTextureFormat
{
kRTFormatARGB32 = 0, kRTFormatFirst = kRTFormatARGB32,
kRTFormatDepth,
kRTFormatARGBHalf,
kRTFormatShadowMap,
kRTFormatRGB565,
kRTFormatARGB4444,
kRTFormatARGB1555,
kRTFormatDefault,
kRTFormatA2R10G10B10,
kRTFormatDefaultHDR,
kRTFormatARGB64,
kRTFormatARGBFloat,
kRTFormatRGFloat,
kRTFormatRGHalf,
kRTFormatRFloat,
kRTFormatRHalf,
kRTFormatR8,
kRTFormatARGBInt,
kRTFormatRGInt,
kRTFormatRInt,
kRTFormatBGRA32,
kRTFormatVideo,
kRTFormatR11G11B10Float,
kRTFormatRG32,
kRTFormatRGBAUShort,
kRTFormatRG16,
kRTFormatBGRA10_XR,
kRTFormatBGR10_XR,
kRTFormatCount
};
typedef unsigned char UInt8;
typedef unsigned int UInt32;
struct FormatDesc
{
UInt8 blockSize;
UInt8 blockX;
UInt8 blockY;
UInt8 blockZ;
FormatSwizzle swizzleR;
FormatSwizzle swizzleG;
FormatSwizzle swizzleB;
FormatSwizzle swizzleA;
GraphicsFormat fallbackFormat;
GraphicsFormat alphaFormat;
TextureFormat textureFormat;
RenderTextureFormat renderTextureFormat;
UInt8 colorComponents;
UInt8 alphaComponents;
const char* name;
int flags; // a combination of GraphicsFormatFlag
};
#if USE_INLINE_TABLE
const FormatDesc& GetDesc(GraphicsFormat format)
{
#endif
static CONST FormatDesc table[] =
{
// blockSize, blockX, blockY, blockZ, swizzleR, swizzleG, swizzleB, swizzleA, fallbackFormat, alphaFormat, textureFormat, renderTextureFormat, colorComponents, alphaComponents, name, flags
{0, 0, 0, 0, kFormatSwizzle0, kFormatSwizzle0, kFormatSwizzle0, kFormatSwizzle1, kFormatNone, kFormatNone, kTexFormatNone, kRTFormatCount, 0, 0, "None", 0}, //kFormatNone,
{1, 1, 1, 1, kFormatSwizzleR, kFormatSwizzle0, kFormatSwizzle0, kFormatSwizzle1, kFormatRGBA8_SRGB, kFormatRGBA8_SRGB, kTexFormatNone, kRTFormatCount, 1, 0, "", kFormatPropertyNormBit | kFormatPropertySRGBBit | kFormatPropertyUnsignedBit}, //kFormatR8_SRGB
{2, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzle0, kFormatSwizzle1, kFormatRGBA8_SRGB, kFormatRGBA8_SRGB, kTexFormatNone, kRTFormatCount, 2, 0, "", kFormatPropertyNormBit | kFormatPropertySRGBBit | kFormatPropertyUnsignedBit}, //kFormatRG8_SRGB
{3, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatRGBA8_SRGB, kFormatRGBA8_SRGB, kTexFormatRGB24, kRTFormatCount, 3, 0, "", kFormatPropertyNormBit | kFormatPropertySRGBBit | kFormatPropertyUnsignedBit}, //kFormatRGB8_SRGB
{4, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatNone, kFormatRGBA8_SRGB, kTexFormatRGBA32, kRTFormatARGB32, 3, 1, "", kFormatPropertyNormBit | kFormatPropertySRGBBit | kFormatPropertyUnsignedBit}, //kFormatRGBA8_SRGB
{1, 1, 1, 1, kFormatSwizzleR, kFormatSwizzle0, kFormatSwizzle0, kFormatSwizzle1, kFormatRGBA8_UNorm, kFormatRGBA8_UNorm, kTexFormatR8, kRTFormatR8, 1, 0, "", kFormatPropertyNormBit | kFormatPropertyUnsignedBit}, //kFormatR8_UNorm
{2, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzle0, kFormatSwizzle1, kFormatRGBA8_UNorm, kFormatRGBA8_UNorm, kTexFormatRG16, kRTFormatRG16, 2, 0, "", kFormatPropertyNormBit | kFormatPropertyUnsignedBit}, //kFormatRG8_UNorm
{3, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatRGBA8_UNorm, kFormatRGBA8_UNorm, kTexFormatRGB24, kRTFormatCount, 3, 0, "", kFormatPropertyNormBit | kFormatPropertyUnsignedBit}, //kFormatRGB8_UNorm
{4, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatNone, kFormatRGBA8_UNorm, kTexFormatRGBA32, kRTFormatARGB32, 3, 1, "", kFormatPropertyNormBit | kFormatPropertyUnsignedBit}, //kFormatRGBA8_UNorm
{1, 1, 1, 1, kFormatSwizzleR, kFormatSwizzle0, kFormatSwizzle0, kFormatSwizzle1, kFormatRGBA8_SNorm, kFormatRGBA8_SNorm, kTexFormatNone, kRTFormatCount, 1, 0, "", kFormatPropertyNormBit | kFormatPropertySignedBit}, //kFormatR8_SNorm
{2, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzle0, kFormatSwizzle1, kFormatRGBA8_SNorm, kFormatRGBA8_SNorm, kTexFormatNone, kRTFormatCount, 2, 0, "", kFormatPropertyNormBit | kFormatPropertySignedBit}, //kFormatRG8_SNorm
{3, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatRGBA8_SNorm, kFormatRGBA8_SNorm, kTexFormatNone, kRTFormatCount, 3, 0, "", kFormatPropertyNormBit | kFormatPropertySignedBit}, //kFormatRGB8_SNorm
{4, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatNone, kFormatRGBA8_SNorm, kTexFormatNone, kRTFormatCount, 3, 1, "", kFormatPropertyNormBit | kFormatPropertySignedBit}, //kFormatRGBA8_SNorm
{1, 1, 1, 1, kFormatSwizzleR, kFormatSwizzle0, kFormatSwizzle0, kFormatSwizzle1, kFormatRGBA8_UInt, kFormatRGBA8_UInt, kTexFormatNone, kRTFormatCount, 1, 0, "", kFormatPropertyIntegerBit | kFormatPropertyUnsignedBit}, //kFormatR8_UInt
{2, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzle0, kFormatSwizzle1, kFormatRGBA8_UInt, kFormatRGBA8_UInt, kTexFormatNone, kRTFormatCount, 2, 0, "", kFormatPropertyIntegerBit | kFormatPropertyUnsignedBit}, //kFormatRG8_UInt
{3, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatRGBA8_UInt, kFormatRGBA8_UInt, kTexFormatNone, kRTFormatCount, 3, 0, "", kFormatPropertyIntegerBit | kFormatPropertyUnsignedBit}, //kFormatRGB8_UInt
{4, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatNone, kFormatRGBA8_UInt, kTexFormatNone, kRTFormatCount, 3, 1, "", kFormatPropertyIntegerBit | kFormatPropertyUnsignedBit}, //kFormatRGBA8_UInt
{1, 1, 1, 1, kFormatSwizzleR, kFormatSwizzle0, kFormatSwizzle0, kFormatSwizzle1, kFormatRGBA8_SInt, kFormatRGBA8_SInt, kTexFormatNone, kRTFormatCount, 1, 0, "", kFormatPropertyIntegerBit | kFormatPropertySignedBit}, //kFormatR8_SInt
{2, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzle0, kFormatSwizzle1, kFormatRGBA8_SInt, kFormatRGBA8_SInt, kTexFormatNone, kRTFormatCount, 2, 0, "", kFormatPropertyIntegerBit | kFormatPropertySignedBit}, //kFormatRG8_SInt
{3, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatRGBA8_SInt, kFormatRGBA8_SInt, kTexFormatNone, kRTFormatCount, 3, 0, "", kFormatPropertyIntegerBit | kFormatPropertySignedBit}, //kFormatRGB8_SInt
{4, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatNone, kFormatRGBA8_SInt, kTexFormatNone, kRTFormatCount, 3, 1, "", kFormatPropertyIntegerBit | kFormatPropertySignedBit}, //kFormatRGBA8_SInt
{2, 1, 1, 1, kFormatSwizzleR, kFormatSwizzle0, kFormatSwizzle0, kFormatSwizzle1, kFormatRGBA16_UNorm, kFormatRGBA16_UNorm, kTexFormatNone, kRTFormatCount, 1, 0, "", kFormatPropertyNormBit | kFormatPropertyUnsignedBit}, //kFormatR16_UNorm
{4, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzle0, kFormatSwizzle1, kFormatRGBA16_UNorm, kFormatRGBA16_UNorm, kTexFormatNone, kRTFormatRG32, 2, 0, "", kFormatPropertyNormBit | kFormatPropertyUnsignedBit}, //kFormatRG16_UNorm
{6, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatRGBA16_UNorm, kFormatRGBA16_UNorm, kTexFormatNone, kRTFormatCount, 3, 0, "", kFormatPropertyNormBit | kFormatPropertyUnsignedBit}, //kFormatRGB16_UNorm
{8, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatNone, kFormatRGBA16_UNorm, kTexFormatNone, kRTFormatARGB64, 3, 1, "", kFormatPropertyNormBit | kFormatPropertyUnsignedBit}, //kFormatRGBA16_UNorm
{2, 1, 1, 1, kFormatSwizzleR, kFormatSwizzle0, kFormatSwizzle0, kFormatSwizzle1, kFormatRGBA16_SNorm, kFormatRGBA16_SNorm, kTexFormatNone, kRTFormatCount, 1, 0, "", kFormatPropertyNormBit | kFormatPropertySignedBit}, //kFormatR16_SNorm
{4, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzle0, kFormatSwizzle1, kFormatRGBA16_SNorm, kFormatRGBA16_SNorm, kTexFormatNone, kRTFormatCount, 2, 0, "", kFormatPropertyNormBit | kFormatPropertySignedBit}, //kFormatRG16_SNorm
{6, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatRGBA16_SNorm, kFormatRGBA16_SNorm, kTexFormatNone, kRTFormatCount, 3, 0, "", kFormatPropertyNormBit | kFormatPropertySignedBit}, //kFormatRGB16_SNorm
{8, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatNone, kFormatRGBA16_SNorm, kTexFormatNone, kRTFormatCount, 3, 1, "", kFormatPropertyNormBit | kFormatPropertySignedBit}, //kFormatRGBA16_SNorm
{2, 1, 1, 1, kFormatSwizzleR, kFormatSwizzle0, kFormatSwizzle0, kFormatSwizzle1, kFormatRGBA16_UInt, kFormatRGBA16_UInt, kTexFormatNone, kRTFormatCount, 1, 0, "", kFormatPropertyIntegerBit | kFormatPropertyUnsignedBit}, //kFormatR16_UInt
{4, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzle0, kFormatSwizzle1, kFormatRGBA16_UInt, kFormatRGBA16_UInt, kTexFormatNone, kRTFormatCount, 2, 0, "", kFormatPropertyIntegerBit | kFormatPropertyUnsignedBit}, //kFormatRG16_UInt
{6, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatRGBA16_UInt, kFormatRGBA16_UInt, kTexFormatNone, kRTFormatCount, 3, 0, "", kFormatPropertyIntegerBit | kFormatPropertyUnsignedBit}, //kFormatRGB16_UInt
{8, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatNone, kFormatRGBA16_UInt, kTexFormatNone, kRTFormatRGBAUShort, 3, 1, "", kFormatPropertyIntegerBit | kFormatPropertyUnsignedBit}, //kFormatRGBA16_UInt
{2, 1, 1, 1, kFormatSwizzleR, kFormatSwizzle0, kFormatSwizzle0, kFormatSwizzle1, kFormatRGBA16_SInt, kFormatRGBA16_SInt, kTexFormatNone, kRTFormatCount, 1, 0, "", kFormatPropertyIntegerBit | kFormatPropertySignedBit}, //kFormatR16_SInt
{4, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzle0, kFormatSwizzle1, kFormatRGBA16_SInt, kFormatRGBA16_SInt, kTexFormatNone, kRTFormatCount, 2, 0, "", kFormatPropertyIntegerBit | kFormatPropertySignedBit}, //kFormatRG16_SInt
{6, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatRGBA16_SInt, kFormatRGBA16_SInt, kTexFormatNone, kRTFormatCount, 3, 0, "", kFormatPropertyIntegerBit | kFormatPropertySignedBit}, //kFormatRGB16_SInt
{8, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatNone, kFormatRGBA16_SInt, kTexFormatNone, kRTFormatCount, 3, 1, "", kFormatPropertyIntegerBit | kFormatPropertySignedBit}, //kFormatRGBA16_SInt
{4, 1, 1, 1, kFormatSwizzleR, kFormatSwizzle0, kFormatSwizzle0, kFormatSwizzle1, kFormatNone, kFormatRGBA32_UInt, kTexFormatNone, kRTFormatCount, 1, 0, "", kFormatPropertyIntegerBit | kFormatPropertyUnsignedBit}, //kFormatR32_UInt
{8, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzle0, kFormatSwizzle1, kFormatNone, kFormatRGBA32_UInt, kTexFormatNone, kRTFormatCount, 2, 0, "", kFormatPropertyIntegerBit | kFormatPropertyUnsignedBit}, //kFormatRG32_UInt
{12, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatNone, kFormatRGBA32_UInt, kTexFormatNone, kRTFormatCount, 3, 0, "", kFormatPropertyIntegerBit | kFormatPropertyUnsignedBit}, //kFormatRGB32_UInt
{16, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatNone, kFormatRGBA32_UInt, kTexFormatNone, kRTFormatCount, 3, 1, "", kFormatPropertyIntegerBit | kFormatPropertyUnsignedBit}, //kFormatRGBA32_UInt
{4, 1, 1, 1, kFormatSwizzleR, kFormatSwizzle0, kFormatSwizzle0, kFormatSwizzle1, kFormatNone, kFormatRGBA32_SInt, kTexFormatNone, kRTFormatRInt, 1, 0, "", kFormatPropertyIntegerBit | kFormatPropertySignedBit}, //kFormatR32_SInt
{8, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzle0, kFormatSwizzle1, kFormatNone, kFormatRGBA32_SInt, kTexFormatNone, kRTFormatRGInt, 2, 0, "", kFormatPropertyIntegerBit | kFormatPropertySignedBit}, //kFormatRG32_SInt
{12, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatNone, kFormatRGBA32_SInt, kTexFormatNone, kRTFormatCount, 3, 0, "", kFormatPropertyIntegerBit | kFormatPropertySignedBit}, //kFormatRGB32_SInt
{16, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatNone, kFormatRGBA32_SInt, kTexFormatNone, kRTFormatARGBInt, 3, 1, "", kFormatPropertyIntegerBit | kFormatPropertySignedBit}, //kFormatRGBA32_SInt
{2, 1, 1, 1, kFormatSwizzleR, kFormatSwizzle0, kFormatSwizzle0, kFormatSwizzle1, kFormatRGBA16_SFloat, kFormatRGBA16_SFloat, kTexFormatRHalf, kRTFormatRHalf, 1, 0, "", kFormatPropertyIEEE754Bit | kFormatPropertySignedBit}, //kFormatR16_SFloat
{4, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzle0, kFormatSwizzle1, kFormatRGBA16_SFloat, kFormatRGBA16_SFloat, kTexFormatRGHalf, kRTFormatRGHalf, 2, 0, "", kFormatPropertyIEEE754Bit | kFormatPropertySignedBit}, //kFormatRG16_SFloat
{6, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatRGBA16_SFloat, kFormatRGBA16_SFloat, kTexFormatNone, kRTFormatCount, 3, 0, "", kFormatPropertyIEEE754Bit | kFormatPropertySignedBit}, //kFormatRGB16_SFloat
{8, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA32_SFloat, kFormatRGBA16_SFloat, kTexFormatRGBAHalf, kRTFormatARGBHalf, 3, 1, "", kFormatPropertyIEEE754Bit | kFormatPropertySignedBit}, //kFormatRGBA16_SFloat
{4, 1, 1, 1, kFormatSwizzleR, kFormatSwizzle0, kFormatSwizzle0, kFormatSwizzle1, kFormatRGBA32_SFloat, kFormatRGBA32_SFloat, kTexFormatRFloat, kRTFormatRFloat, 1, 0, "", kFormatPropertyIEEE754Bit | kFormatPropertySignedBit}, //kFormatR32_SFloat
{8, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzle0, kFormatSwizzle1, kFormatRGBA32_SFloat, kFormatRGBA32_SFloat, kTexFormatRGFloat, kRTFormatRGFloat, 2, 0, "", kFormatPropertyIEEE754Bit | kFormatPropertySignedBit}, //kFormatRG32_SFloat
{12, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatRGBA32_SFloat, kFormatRGBA32_SFloat, kTexFormatRGBFloat, kRTFormatCount, 3, 0, "", kFormatPropertyIEEE754Bit | kFormatPropertySignedBit}, //kFormatRGB32_SFloat
{16, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatNone, kFormatRGBA32_SFloat, kTexFormatRGBAFloat, kRTFormatARGBFloat, 3, 1, "", kFormatPropertyIEEE754Bit | kFormatPropertySignedBit}, //kFormatRGBA32_SFloat
{4, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatNone, kFormatRGB10A2_UNorm, kTexFormatNone, kRTFormatA2R10G10B10, 3, 1, "RGB10A2", kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertyPackedBit}, //kFormatRGB10A2_UNorm
{4, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatNone, kFormatRGB10A2_UInt, kTexFormatNone, kRTFormatCount, 3, 1, "RGB10A2", kFormatPropertyIntegerBit | kFormatPropertyUnsignedBit | kFormatPropertyPackedBit}, //kFormatRGB10A2_UInt
{4, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatNone, kFormatRGB10A2_SInt, kTexFormatNone, kRTFormatCount, 3, 1, "RGB10A2", kFormatPropertyIntegerBit | kFormatPropertySignedBit | kFormatPropertyPackedBit}, //kFormatRGB10A2_SInt
{4, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatRGB16_SFloat, kFormatRGBA16_SFloat, kTexFormatRGB9e5Float, kRTFormatCount, 3, 0, "RGB9E5", kFormatPropertyIEEE754Bit | kFormatPropertyUnsignedBit | kFormatPropertyPackedBit}, //kFormatRGB9E5_UFloat
{4, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatRGB16_SFloat, kFormatRGBA16_SFloat, kTexFormatNone, kRTFormatR11G11B10Float, 3, 0, "RG11B10", kFormatPropertyIEEE754Bit | kFormatPropertyUnsignedBit | kFormatPropertyPackedBit}, //kFormatRG11B10_UFloat
{1, 1, 1, 1, kFormatSwizzle0, kFormatSwizzle0, kFormatSwizzle0, kFormatSwizzleR, kFormatRGBA8_UNorm, kFormatA8_UNorm, kTexFormatAlpha8, kRTFormatCount, 0, 1, "", kFormatPropertyNormBit | kFormatPropertyUnsignedBit}, //kFormatA8_UNorm
{2, 1, 1, 1, kFormatSwizzle0, kFormatSwizzle0, kFormatSwizzle0, kFormatSwizzleR, kFormatA8_UNorm, kFormatA16_UNorm, kTexFormatAlphaLum16, kRTFormatCount, 0, 1, "", kFormatPropertyNormBit | kFormatPropertyUnsignedBit}, //kFormatA16_UNorm
{3, 1, 1, 1, kFormatSwizzleB, kFormatSwizzleG, kFormatSwizzleR, kFormatSwizzle1, kFormatRGB8_SRGB, kFormatBGRA8_SRGB, kTexFormatBGR24, kRTFormatCount, 3, 0, "", kFormatPropertyNormBit | kFormatPropertySRGBBit | kFormatPropertyUnsignedBit}, //kFormatBGR8_SRGB
{4, 1, 1, 1, kFormatSwizzleB, kFormatSwizzleG, kFormatSwizzleR, kFormatSwizzleA, kFormatRGBA8_SRGB, kFormatBGRA8_SRGB, kTexFormatBGRA32, kRTFormatBGRA32, 3, 1, "", kFormatPropertyNormBit | kFormatPropertySRGBBit | kFormatPropertyUnsignedBit}, //kFormatBGRA8_SRGB
{3, 1, 1, 1, kFormatSwizzleB, kFormatSwizzleG, kFormatSwizzleR, kFormatSwizzle1, kFormatRGB8_UNorm, kFormatBGRA8_UNorm, kTexFormatBGR24, kRTFormatCount, 3, 0, "", kFormatPropertyNormBit | kFormatPropertyUnsignedBit}, //kFormatBGR8_UNorm
{4, 1, 1, 1, kFormatSwizzleB, kFormatSwizzleG, kFormatSwizzleR, kFormatSwizzleA, kFormatRGBA8_UNorm, kFormatBGRA8_UNorm, kTexFormatBGRA32, kRTFormatBGRA32, 3, 1, "", kFormatPropertyNormBit | kFormatPropertyUnsignedBit}, //kFormatBGRA8_UNorm
{3, 1, 1, 1, kFormatSwizzleB, kFormatSwizzleG, kFormatSwizzleR, kFormatSwizzle1, kFormatRGB8_SNorm, kFormatBGRA8_SNorm, kTexFormatNone, kRTFormatCount, 3, 0, "", kFormatPropertyNormBit | kFormatPropertySignedBit}, //kFormatBGR8_SNorm
{4, 1, 1, 1, kFormatSwizzleB, kFormatSwizzleG, kFormatSwizzleR, kFormatSwizzleA, kFormatRGBA8_SNorm, kFormatBGRA8_SNorm, kTexFormatNone, kRTFormatCount, 3, 1, "", kFormatPropertyNormBit | kFormatPropertySignedBit}, //kFormatBGRA8_SNorm
{3, 1, 1, 1, kFormatSwizzleB, kFormatSwizzleG, kFormatSwizzleR, kFormatSwizzle1, kFormatRGB8_UInt, kFormatBGRA8_UInt, kTexFormatNone, kRTFormatCount, 3, 0, "", kFormatPropertyIntegerBit | kFormatPropertyUnsignedBit}, //kFormatBGR8_UInt
{4, 1, 1, 1, kFormatSwizzleB, kFormatSwizzleG, kFormatSwizzleR, kFormatSwizzleA, kFormatRGBA8_UInt, kFormatBGRA8_UInt, kTexFormatNone, kRTFormatCount, 3, 1, "", kFormatPropertyIntegerBit | kFormatPropertyUnsignedBit}, //kFormatBGRA8_UInt
{3, 1, 1, 1, kFormatSwizzleB, kFormatSwizzleG, kFormatSwizzleR, kFormatSwizzle1, kFormatRGB8_SInt, kFormatBGRA8_SInt, kTexFormatNone, kRTFormatCount, 3, 0, "", kFormatPropertyIntegerBit | kFormatPropertySignedBit}, //kFormatBGR8_SInt
{4, 1, 1, 1, kFormatSwizzleB, kFormatSwizzleG, kFormatSwizzleR, kFormatSwizzleA, kFormatRGBA8_SInt, kFormatBGRA8_SInt, kTexFormatNone, kRTFormatCount, 3, 1, "", kFormatPropertyIntegerBit | kFormatPropertySignedBit}, //kFormatBGRA8_SInt
{4, 1, 1, 1, kFormatSwizzleB, kFormatSwizzleG, kFormatSwizzleR, kFormatSwizzleA, kFormatRGB10A2_UNorm, kFormatBGR10A2_UNorm, kTexFormatNone, kRTFormatA2R10G10B10, 3, 1, "BGR10A2", kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertyPackedBit}, //kFormatBGR10A2_UNorm
{4, 1, 1, 1, kFormatSwizzleB, kFormatSwizzleG, kFormatSwizzleR, kFormatSwizzleA, kFormatRGB10A2_UInt, kFormatBGR10A2_UInt, kTexFormatNone, kRTFormatCount, 3, 1, "BGR10A2", kFormatPropertyIntegerBit | kFormatPropertyUnsignedBit | kFormatPropertyPackedBit}, //kFormatBGR10A2_UInt
{4, 1, 1, 1, kFormatSwizzleB, kFormatSwizzleG, kFormatSwizzleR, kFormatSwizzleA, kFormatNone, kFormatBGR10A2XR_SRGB, kTexFormatNone, kRTFormatCount, 3, 1, "BGR10A2XR", kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertyPackedBit | kFormatPropertySRGBBit}, //kFormatBGR10A2XR_SRGB
{4, 1, 1, 1, kFormatSwizzleB, kFormatSwizzleG, kFormatSwizzleR, kFormatSwizzleA, kFormatNone, kFormatBGR10A2XR_UNorm, kTexFormatNone, kRTFormatCount, 3, 1, "BGR10A2XR", kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertyPackedBit}, //kFormatBGR10A2XR_UNorm
{4, 1, 1, 1, kFormatSwizzleB, kFormatSwizzleG, kFormatSwizzleR, kFormatSwizzle1, kFormatNone, kFormatBGRA10XR_SRGB, kTexFormatNone, kRTFormatCount, 3, 0, "BGR10XR", kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertyPackedBit | kFormatPropertySRGBBit}, //kFormatBGR10XR_SRGB
{4, 1, 1, 1, kFormatSwizzleB, kFormatSwizzleG, kFormatSwizzleR, kFormatSwizzle1, kFormatNone, kFormatBGRA10XR_UNorm, kTexFormatNone, kRTFormatBGR10_XR, 3, 0, "BGR10XR", kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertyPackedBit}, //kFormatBGR10XR_UNorm
{8, 1, 1, 1, kFormatSwizzleB, kFormatSwizzleG, kFormatSwizzleR, kFormatSwizzleA, kFormatNone, kFormatBGRA10XR_SRGB, kTexFormatNone, kRTFormatCount, 3, 1, "BGRA10XR", kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertyPackedBit | kFormatPropertySRGBBit}, //kFormatBGRA10XR_SRGB
{8, 1, 1, 1, kFormatSwizzleB, kFormatSwizzleG, kFormatSwizzleR, kFormatSwizzleA, kFormatNone, kFormatBGRA10XR_UNorm, kTexFormatNone, kRTFormatBGRA10_XR, 3, 1, "BGRA10XR", kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertyPackedBit}, //kFormatBGRA10XR_UNorm
{2, 1, 1, 1, kFormatSwizzleB, kFormatSwizzleG, kFormatSwizzleR, kFormatSwizzleA, kFormatRGBA8_UNorm, kFormatRGBA4_UNorm, kTexFormatRGBA4444, kRTFormatCount, 3, 1, "RGBA4", kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertyPackedBit}, //kFormatRGBA4_UNorm
{2, 1, 1, 1, kFormatSwizzleB, kFormatSwizzleG, kFormatSwizzleR, kFormatSwizzleA, kFormatRGBA4_UNorm, kFormatBGRA4_UNorm, kTexFormatARGB4444, kRTFormatARGB4444, 3, 1, "BGRA4", kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertyPackedBit}, //kFormatBGRA4_UNorm
{2, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatRGB8_UNorm, kFormatRGBA4_UNorm, kTexFormatNone, kRTFormatCount, 3, 0, "R5G6B5", kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertyPackedBit}, //kFormatR5G6B5_UNorm
{2, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatR5G6B5_UNorm, kFormatBGRA4_UNorm, kTexFormatRGB565, kRTFormatRGB565, 3, 0, "B5G6B5", kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertyPackedBit}, //kFormatB5G6R5_UNorm
{2, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA8_UNorm, kFormatRGBA4_UNorm, kTexFormatNone, kRTFormatCount, 3, 1, "RGB5A1", kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertyPackedBit}, //kFormatRGB5A1_UNorm
{2, 1, 1, 1, kFormatSwizzleB, kFormatSwizzleG, kFormatSwizzleR, kFormatSwizzleA, kFormatRGB5A1_UNorm, kFormatBGRA4_UNorm, kTexFormatNone, kRTFormatARGB1555, 3, 1, "BGR5A1", kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertyPackedBit}, //kFormatBGR5A1_UNorm
{2, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatBGR5A1_UNorm, kFormatRGBA4_UNorm, kTexFormatNone, kRTFormatCount, 3, 1, "A1RGB5", kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertyPackedBit}, //kFormatA1RGB5_UNorm
{4, 1, 1, 1, kFormatSwizzleA, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatRGBA8_SRGB, kFormatARGB8_SRGB, kTexFormatARGB32, kRTFormatCount, 3, 1, "", kFormatPropertyNormBit | kFormatPropertySRGBBit | kFormatPropertyUnsignedBit}, //kFormatARGB8_SRGB
{4, 1, 1, 1, kFormatSwizzleA, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatRGBA8_UNorm, kFormatARGB8_UNorm, kTexFormatARGB32, kRTFormatCount, 3, 1, "", kFormatPropertyNormBit | kFormatPropertyUnsignedBit}, //kFormatARGB8_UNorm
{16, 1, 1, 1, kFormatSwizzleA, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatRGBA32_SFloat, kFormatARGB32_SFloat, kTexFormatARGBFloat, kRTFormatCount, 3, 1, "", kFormatPropertyIEEE754Bit | kFormatPropertySignedBit}, //kFormatARGB32_SFloat
{2, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatNone, kFormatNone, kTexFormatNone, kRTFormatCount, 1, 0, "D16 UInt", kFormatPropertyPackedBit | kFormatPropertyDepthBit | kFormatPropertyIntegerBit}, //kFormatDepth16_UInt
{3, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatNone, kFormatNone, kTexFormatNone, kRTFormatCount, 1, 0, "D24 UInt", kFormatPropertyPackedBit | kFormatPropertyDepthBit | kFormatPropertyIntegerBit}, //kFormatDepth24_UInt
{4, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatNone, kFormatNone, kTexFormatNone, kRTFormatCount, 2, 0, "D24 UInt S8 UInt", kFormatPropertyPackedBit | kFormatPropertyDepthBit | kFormatPropertyStencilBit | kFormatPropertyIntegerBit}, //kFormatDepth24_UInt_Stencil8_UInt
{4, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatNone, kFormatNone, kTexFormatNone, kRTFormatCount, 1, 0, "D32 SFloat", kFormatPropertyPackedBit | kFormatPropertyDepthBit | kFormatPropertyIEEE754Bit}, //kFormatDepth32_SFloat
{8, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatNone, kFormatNone, kTexFormatNone, kRTFormatCount, 2, 0, "D32 SFloat S8 UInt", kFormatPropertyPackedBit | kFormatPropertyDepthBit | kFormatPropertyStencilBit | kFormatPropertyIEEE754Bit}, //kFormatD32_SFloat_Stencil8_Uint
{1, 1, 1, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatNone, kFormatNone, kTexFormatNone, kRTFormatCount, 1, 0, "S8 UInt", kFormatPropertyPackedBit | kFormatPropertyStencilBit | kFormatPropertyIntegerBit}, //kFormatStencil8_Uint
{8, 4, 4, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatRGBA8_SRGB, kFormatRGBA_DXT5_SRGB, kTexFormatDXT1, kRTFormatCount, 3, 0, "DXT1", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertySRGBBit}, //kFormatRGB_DXT1_SRGB
{8, 4, 4, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatRGBA8_UNorm, kFormatRGBA_DXT5_UNorm, kTexFormatDXT1, kRTFormatCount, 3, 0, "DXT1", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit}, //kFormatRGB_DXT1_UNorm
{16, 4, 4, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA8_SRGB, kFormatRGBA_DXT3_SRGB, kTexFormatDXT3, kRTFormatCount, 3, 1, "DXT3", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertySRGBBit}, //kFormatRGBA_DXT3_SRGB
{16, 4, 4, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA8_UNorm, kFormatRGBA_DXT3_UNorm, kTexFormatDXT3, kRTFormatCount, 3, 1, "DXT3", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit}, //kFormatRGBA_DXT3_UNorm
{16, 4, 4, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA8_SRGB, kFormatRGBA_DXT5_SRGB, kTexFormatDXT5, kRTFormatCount, 3, 1, "DXT5", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertySRGBBit}, //kFormatRGBA_DXT5_SRGB
{16, 4, 4, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA8_UNorm, kFormatRGBA_DXT5_UNorm, kTexFormatDXT5, kRTFormatCount, 3, 1, "DXT5", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit}, //kFormatRGBA_DXT5_UNorm
{8, 4, 4, 1, kFormatSwizzleR, kFormatSwizzle0, kFormatSwizzle0, kFormatSwizzle1, kFormatRGBA8_UNorm, kFormatNone, kTexFormatBC4, kRTFormatCount, 1, 0, "BC4", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit}, //kFormatR_BC4_UNorm
{8, 4, 4, 1, kFormatSwizzleR, kFormatSwizzle0, kFormatSwizzle0, kFormatSwizzle1, kFormatRG8_SNorm, kFormatNone, kTexFormatNone, kRTFormatCount, 1, 0, "BC4", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertySignedBit}, //kFormatR_BC4_SNorm
{16, 4, 4, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzle0, kFormatSwizzle1, kFormatRGBA8_UNorm, kFormatNone, kTexFormatBC5, kRTFormatCount, 2, 0, "BC5", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit}, //kFormatRG_BC5_UNorm
{16, 4, 4, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzle0, kFormatSwizzle1, kFormatRGBA8_SNorm, kFormatNone, kTexFormatNone, kRTFormatCount, 2, 0, "BC5", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertySignedBit}, //kFormatRG_BC5_SNorm
{16, 4, 4, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatRGBA16_SFloat, kFormatNone, kTexFormatBC6H, kRTFormatCount, 3, 0, "BC6H", kFormatPropertyCompressedBit | kFormatPropertyUnsignedBit | kFormatPropertyIEEE754Bit}, //kFormatRGB_BC6H_UFloat
{16, 4, 4, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatRGBA16_SFloat, kFormatNone, kTexFormatNone, kRTFormatCount, 3, 0, "BC6H", kFormatPropertyCompressedBit | kFormatPropertySignedBit | kFormatPropertyIEEE754Bit}, //kFormatRGB_BC6H_SFloat
{16, 4, 4, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA8_SRGB, kFormatRGBA_BC7_SRGB, kTexFormatBC7, kRTFormatCount, 3, 1, "BC7", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertySRGBBit}, //kFormatRGBA_BC7_SRGB
{16, 4, 4, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA8_UNorm, kFormatRGBA_BC7_UNorm, kTexFormatBC7, kRTFormatCount, 3, 1, "BC7", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit}, //kFormatRGBA_BC7_UNorm
{32, 16, 8, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatRGBA8_SRGB, kFormatRGBA_PVRTC_2Bpp_SRGB, kTexFormatPVRTC_RGB2, kRTFormatCount, 3, 0, "PVRTC 2BPP", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertySRGBBit | kFormatPropertyBlockSizeIsMinTextureMipSizeBit}, //kFormatRGB_PVRTC_2Bpp_SRGB
{32, 16, 8, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatRGBA8_UNorm, kFormatRGBA_PVRTC_2Bpp_UNorm, kTexFormatPVRTC_RGB2, kRTFormatCount, 3, 0, "PVRTC 2BPP", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertyBlockSizeIsMinTextureMipSizeBit}, //kFormatRGB_PVRTC_2Bpp_UNorm
{32, 8, 8, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatRGBA8_SRGB, kFormatRGBA_PVRTC_4Bpp_SRGB, kTexFormatPVRTC_RGB4, kRTFormatCount, 3, 0, "PVRTC 4BPP", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertySRGBBit | kFormatPropertyBlockSizeIsMinTextureMipSizeBit}, //kFormatRGB_PVRTC_4Bpp_SRGB
{32, 8, 8, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatRGBA8_UNorm, kFormatRGBA_PVRTC_4Bpp_UNorm, kTexFormatPVRTC_RGB4, kRTFormatCount, 3, 0, "PVRTC 4BPP", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertyBlockSizeIsMinTextureMipSizeBit}, //kFormatRGB_PVRTC_4Bpp_UNorm
{32, 16, 8, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA8_SRGB, kFormatRGBA_PVRTC_2Bpp_SRGB, kTexFormatPVRTC_RGBA2, kRTFormatCount, 3, 1, "PVRTC 2BPP", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertySRGBBit | kFormatPropertyBlockSizeIsMinTextureMipSizeBit}, //kFormatRGBA_PVRTC_2Bpp_SRGB
{32, 16, 8, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA8_UNorm, kFormatRGBA_PVRTC_2Bpp_UNorm, kTexFormatPVRTC_RGBA2, kRTFormatCount, 3, 1, "PVRTC 2BPP", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertyBlockSizeIsMinTextureMipSizeBit}, //kFormatRGBA_PVRTC_2Bpp_UNorm
{32, 8, 8, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA8_SRGB, kFormatRGBA_PVRTC_4Bpp_SRGB, kTexFormatPVRTC_RGBA4, kRTFormatCount, 3, 1, "PVRTC 4BPP", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertySRGBBit | kFormatPropertyBlockSizeIsMinTextureMipSizeBit}, //kFormatRGBA_PVRTC_4Bpp_SRGB
{32, 8, 8, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA8_UNorm, kFormatRGBA_PVRTC_4Bpp_UNorm, kTexFormatPVRTC_RGBA4, kRTFormatCount, 3, 1, "PVRTC 4BPP", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertyBlockSizeIsMinTextureMipSizeBit}, //kFormatRGBA_PVRTC_4Bpp_UNorm
{8, 4, 4, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatRGBA8_UNorm, kFormatRGBA_ATC_UNorm, kTexFormatATC_RGB4, kRTFormatCount, 3, 0, "ATC", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit}, //kFormatRGB_ATC_UNorm
{16, 4, 4, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA8_UNorm, kFormatRGBA_ATC_UNorm, kTexFormatATC_RGBA8, kRTFormatCount, 3, 1, "ATC", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit}, //kFormatRGBA_ATC_UNorm
{8, 4, 4, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatRGBA8_UNorm, kFormatRGBA_ETC2_UNorm, kTexFormatETC_RGB4, kRTFormatCount, 3, 0, "ETC", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertyBlockSizeIsMinTextureMipSizeBit}, //kFormatRGB_ETC_UNorm
{8, 4, 4, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatRGBA8_SRGB, kFormatRGBA_ETC2_SRGB, kTexFormatETC2_RGB, kRTFormatCount, 3, 0, "ETC2", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertySRGBBit | kFormatPropertyBlockSizeIsMinTextureMipSizeBit}, //kFormatRGB_ETC2_SRGB
{8, 4, 4, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzle1, kFormatRGBA8_UNorm, kFormatRGBA_ETC2_UNorm, kTexFormatETC2_RGB, kRTFormatCount, 3, 0, "ETC2", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertyBlockSizeIsMinTextureMipSizeBit}, //kFormatRGB_ETC2_UNorm
{8, 4, 4, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA8_SRGB, kFormatRGBA_ETC2_SRGB, kTexFormatETC2_RGBA1, kRTFormatCount, 3, 1, "ETC2 punchthrough", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertySRGBBit | kFormatPropertyBlockSizeIsMinTextureMipSizeBit}, //kFormatRGB_A1_ETC2_SRGB
{8, 4, 4, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA8_UNorm, kFormatRGBA_ETC2_UNorm, kTexFormatETC2_RGBA1, kRTFormatCount, 3, 1, "ETC2 punchthrough", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertyBlockSizeIsMinTextureMipSizeBit}, //kFormatRGB_A1_ETC2_UNorm
{16, 4, 4, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA8_SRGB, kFormatRGBA_ETC2_SRGB, kTexFormatETC2_RGBA8, kRTFormatCount, 3, 1, "ETC2", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertySRGBBit | kFormatPropertyBlockSizeIsMinTextureMipSizeBit}, //kFormatRGBA_ETC2_SRGB
{16, 4, 4, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA8_UNorm, kFormatRGBA_ETC2_UNorm, kTexFormatETC2_RGBA8, kRTFormatCount, 3, 1, "ETC2", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertyBlockSizeIsMinTextureMipSizeBit}, //kFormatRGBA_ETC2_UNorm
{8, 4, 4, 1, kFormatSwizzleR, kFormatSwizzle0, kFormatSwizzle0, kFormatSwizzle1, kFormatR8_UNorm, kFormatNone, kTexFormatEAC_R, kRTFormatCount, 1, 0, "EAC", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertyBlockSizeIsMinTextureMipSizeBit}, //kFormatR_EAC_UNorm
{8, 4, 4, 1, kFormatSwizzleR, kFormatSwizzle0, kFormatSwizzle0, kFormatSwizzle1, kFormatR8_SNorm, kFormatNone, kTexFormatEAC_R_SIGNED, kRTFormatCount, 1, 0, "EAC", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertySignedBit | kFormatPropertyBlockSizeIsMinTextureMipSizeBit}, //kFormatR_EAC_SNorm
{16, 4, 4, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzle0, kFormatSwizzle1, kFormatRG8_UNorm, kFormatNone, kTexFormatEAC_RG, kRTFormatCount, 2, 0, "EAC", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertyBlockSizeIsMinTextureMipSizeBit}, //kFormatRG_EAC_UNorm
{16, 4, 4, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzle0, kFormatSwizzle1, kFormatRG8_SNorm, kFormatNone, kTexFormatEAC_RG_SIGNED, kRTFormatCount, 2, 0, "EAC", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertySignedBit | kFormatPropertyBlockSizeIsMinTextureMipSizeBit}, //kFormatRG_EAC_SNorm
{16, 4, 4, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA8_SRGB, kFormatRGBA_ASTC4X4_SRGB, kTexFormatASTC_RGB_4x4, kRTFormatCount, 3, 1, "ASTC4X4", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertySRGBBit}, //kFormatRGBA_ASTC4X4_SRGB
{16, 4, 4, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA8_UNorm, kFormatRGBA_ASTC4X4_UNorm, kTexFormatASTC_RGB_4x4, kRTFormatCount, 3, 1, "ASTC4X4", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit}, //kFormatRGBA_ASTC4X4_UNorm
{16, 5, 5, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA8_SRGB, kFormatRGBA_ASTC5X5_SRGB, kTexFormatASTC_RGB_5x5, kRTFormatCount, 3, 1, "ASTC5X5", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertySRGBBit}, //kFormatRGBA_ASTC5X5_SRGB
{16, 5, 5, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA8_UNorm, kFormatRGBA_ASTC5X5_UNorm, kTexFormatASTC_RGB_5x5, kRTFormatCount, 3, 1, "ASTC5X5", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit}, //kFormatRGBA_ASTC5X5_UNorm
{16, 6, 6, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA8_SRGB, kFormatRGBA_ASTC6X6_SRGB, kTexFormatASTC_RGB_6x6, kRTFormatCount, 3, 1, "ASTC6X6", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertySRGBBit}, //kFormatRGBA_ASTC6X6_SRGB
{16, 6, 6, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA8_UNorm, kFormatRGBA_ASTC6X6_UNorm, kTexFormatASTC_RGB_6x6, kRTFormatCount, 3, 1, "ASTC6X6", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit}, //kFormatRGBA_ASTC6X6_UNorm
{16, 8, 8, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA8_SRGB, kFormatRGBA_ASTC8X8_SRGB, kTexFormatASTC_RGB_8x8, kRTFormatCount, 3, 1, "ASTC8X8", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertySRGBBit}, //kFormatRGBA_ASTC8X8_SRGB
{16, 8, 8, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA8_UNorm, kFormatRGBA_ASTC8X8_UNorm, kTexFormatASTC_RGB_8x8, kRTFormatCount, 3, 1, "ASTC8X8", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit}, //kFormatRGBA_ASTC8X8_UNorm
{16, 10, 10, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA8_SRGB, kFormatRGBA_ASTC10X10_SRGB, kTexFormatASTC_RGB_10x10, kRTFormatCount, 3, 1, "ASTC10X10", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertySRGBBit}, //kFormatRGBA_ASTC10X10_SRGB
{16, 10, 10, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA8_UNorm, kFormatRGBA_ASTC10X10_UNorm, kTexFormatASTC_RGB_10x10, kRTFormatCount, 3, 1, "ASTC10X10", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit}, //kFormatRGBA_ASTC10X10_UNorm
{16, 12, 12, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA8_SRGB, kFormatRGBA_ASTC12X12_SRGB, kTexFormatASTC_RGB_12x12, kRTFormatCount, 3, 1, "ASTC12X12", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit | kFormatPropertySRGBBit}, //kFormatRGBA_ASTC12X12_SRGB
{16, 12, 12, 1, kFormatSwizzleR, kFormatSwizzleG, kFormatSwizzleB, kFormatSwizzleA, kFormatRGBA8_UNorm, kFormatRGBA_ASTC12X12_UNorm, kTexFormatASTC_RGB_12x12, kRTFormatCount, 3, 1, "ASTC12X12", kFormatPropertyCompressedBit | kFormatPropertyNormBit | kFormatPropertyUnsignedBit}, //kFormatRGBA_ASTC12X12_UNorm
};
#if !USE_INLINE_TABLE
const FormatDesc& GetDesc(GraphicsFormat format)
{
#endif
return table[format];
}
UInt32 GetColorComponentCount(GraphicsFormat format)
{
return GetDesc(format).colorComponents;
}
UInt32 GetAlphaComponentCount(GraphicsFormat format)
{
return GetDesc(format).alphaComponents;
}
UInt32 GetComponentCount(GraphicsFormat format)
{
return GetDesc(format).colorComponents + GetDesc(format).alphaComponents;
}
UInt32 GetBlockSize(GraphicsFormat format)
{
return GetDesc(format).blockSize;
}
bool IsCompressedFormat(GraphicsFormat format)
{
return (GetDesc(format).flags & kFormatPropertyCompressedBit) != 0;
}
bool IsPackedFormat(GraphicsFormat format)
{
return (GetDesc(format).flags & kFormatPropertyPackedBit) != 0;
}
bool Is16BitPackedFormat(GraphicsFormat format)
{
return GetColorComponentCount(format) >= 3 && GetBlockSize(format) == 2;
}
GraphicsFormat ConvertToAlphaFormat(GraphicsFormat format)
{
return GetDesc(format).alphaFormat;
}
bool IsAlphaOnlyFormat(GraphicsFormat format)
{
return GetAlphaComponentCount(format) == 1 && GetColorComponentCount(format) == 0;
}
bool HasAlphaChannel(GraphicsFormat format)
{
return GetAlphaComponentCount(format) != 0;
}
bool IsDepthFormat(GraphicsFormat format)
{
return (GetDesc(format).flags & kFormatPropertyDepthBit) != 0;
}
bool IsStencilFormat(GraphicsFormat format)
{
return (GetDesc(format).flags & kFormatPropertyStencilBit) != 0;
}
bool IsIEEE754Format(GraphicsFormat format)
{
return (GetDesc(format).flags & kFormatPropertyIEEE754Bit) != 0;
}
bool IsFloatFormat(GraphicsFormat format)
{
return ((GetDesc(format).flags & kFormatPropertyIEEE754Bit) != 0) && (GetDesc(format).blockSize / GetComponentCount(format) == 4);
}
bool IsHalfFormat(GraphicsFormat format)
{
return ((GetDesc(format).flags & kFormatPropertyIEEE754Bit) != 0) && (GetDesc(format).blockSize / GetComponentCount(format) == 2);
}
int main(int argc, const char** argv)
{
int res = 0;
if (IsFloatFormat((GraphicsFormat)(argc + 0))) res += 1;
if (IsHalfFormat((GraphicsFormat)(argc + 1))) res += 1;
if (IsFloatFormat((GraphicsFormat)(argc + 2))) res += 1;
if (IsHalfFormat((GraphicsFormat)(argc + 3))) res += 1;
if (IsFloatFormat((GraphicsFormat)(argc + 4))) res += 1;
if (IsHalfFormat((GraphicsFormat)(argc + 5))) res += 1;
if (IsFloatFormat((GraphicsFormat)(argc + 6))) res += 1;
if (IsHalfFormat((GraphicsFormat)(argc + 7))) res += 1;
if (IsFloatFormat((GraphicsFormat)(argc + 8))) res += 1;
if (IsHalfFormat((GraphicsFormat)(argc + 9))) res += 1;
if (IsFloatFormat((GraphicsFormat)(argc + 10))) res += 1;
if (IsHalfFormat((GraphicsFormat)(argc + 11))) res += 1;
if (IsFloatFormat((GraphicsFormat)(argc + 12))) res += 1;
if (IsHalfFormat((GraphicsFormat)(argc + 13))) res += 1;
if (IsFloatFormat((GraphicsFormat)(argc + 14))) res += 1;
if (IsHalfFormat((GraphicsFormat)(argc + 15))) res += 1;
return res;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment