// Auto generated by formatgen on Sep 21 2019
#pragma once
#if !defined(TINYIMAGEFORMAT_APIS_H_) && !defined(TINYIMAGEFORMAT_IMAGEFORMAT_H)
#define TINYIMAGEFORMAT_APIS_H_ 1

#include "tinyimageformat_base.h"

#ifndef TINYIMAGEFORMAT_VKFORMAT
#define TINYIMAGEFORMAT_VKFORMAT
typedef enum TinyImageFormat_VkFormat {
	TIF_VK_FORMAT_UNDEFINED = 0,
	TIF_VK_FORMAT_R4G4_UNORM_PACK8 = 1,
	TIF_VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2,
	TIF_VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3,
	TIF_VK_FORMAT_R5G6B5_UNORM_PACK16 = 4,
	TIF_VK_FORMAT_B5G6R5_UNORM_PACK16 = 5,
	TIF_VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6,
	TIF_VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7,
	TIF_VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
	TIF_VK_FORMAT_R8_UNORM = 9,
	TIF_VK_FORMAT_R8_SNORM = 10,
	TIF_VK_FORMAT_R8_USCALED = 11,
	TIF_VK_FORMAT_R8_SSCALED = 12,
	TIF_VK_FORMAT_R8_UINT = 13,
	TIF_VK_FORMAT_R8_SINT = 14,
	TIF_VK_FORMAT_R8_SRGB = 15,
	TIF_VK_FORMAT_R8G8_UNORM = 16,
	TIF_VK_FORMAT_R8G8_SNORM = 17,
	TIF_VK_FORMAT_R8G8_USCALED = 18,
	TIF_VK_FORMAT_R8G8_SSCALED = 19,
	TIF_VK_FORMAT_R8G8_UINT = 20,
	TIF_VK_FORMAT_R8G8_SINT = 21,
	TIF_VK_FORMAT_R8G8_SRGB = 22,
	TIF_VK_FORMAT_R8G8B8_UNORM = 23,
	TIF_VK_FORMAT_R8G8B8_SNORM = 24,
	TIF_VK_FORMAT_R8G8B8_USCALED = 25,
	TIF_VK_FORMAT_R8G8B8_SSCALED = 26,
	TIF_VK_FORMAT_R8G8B8_UINT = 27,
	TIF_VK_FORMAT_R8G8B8_SINT = 28,
	TIF_VK_FORMAT_R8G8B8_SRGB = 29,
	TIF_VK_FORMAT_B8G8R8_UNORM = 30,
	TIF_VK_FORMAT_B8G8R8_SNORM = 31,
	TIF_VK_FORMAT_B8G8R8_USCALED = 32,
	TIF_VK_FORMAT_B8G8R8_SSCALED = 33,
	TIF_VK_FORMAT_B8G8R8_UINT = 34,
	TIF_VK_FORMAT_B8G8R8_SINT = 35,
	TIF_VK_FORMAT_B8G8R8_SRGB = 36,
	TIF_VK_FORMAT_R8G8B8A8_UNORM = 37,
	TIF_VK_FORMAT_R8G8B8A8_SNORM = 38,
	TIF_VK_FORMAT_R8G8B8A8_USCALED = 39,
	TIF_VK_FORMAT_R8G8B8A8_SSCALED = 40,
	TIF_VK_FORMAT_R8G8B8A8_UINT = 41,
	TIF_VK_FORMAT_R8G8B8A8_SINT = 42,
	TIF_VK_FORMAT_R8G8B8A8_SRGB = 43,
	TIF_VK_FORMAT_B8G8R8A8_UNORM = 44,
	TIF_VK_FORMAT_B8G8R8A8_SNORM = 45,
	TIF_VK_FORMAT_B8G8R8A8_USCALED = 46,
	TIF_VK_FORMAT_B8G8R8A8_SSCALED = 47,
	TIF_VK_FORMAT_B8G8R8A8_UINT = 48,
	TIF_VK_FORMAT_B8G8R8A8_SINT = 49,
	TIF_VK_FORMAT_B8G8R8A8_SRGB = 50,
	TIF_VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51,
	TIF_VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52,
	TIF_VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53,
	TIF_VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54,
	TIF_VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55,
	TIF_VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56,
	TIF_VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57,
	TIF_VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58,
	TIF_VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59,
	TIF_VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60,
	TIF_VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61,
	TIF_VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62,
	TIF_VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63,
	TIF_VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64,
	TIF_VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65,
	TIF_VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66,
	TIF_VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67,
	TIF_VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68,
	TIF_VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69,
	TIF_VK_FORMAT_R16_UNORM = 70,
	TIF_VK_FORMAT_R16_SNORM = 71,
	TIF_VK_FORMAT_R16_USCALED = 72,
	TIF_VK_FORMAT_R16_SSCALED = 73,
	TIF_VK_FORMAT_R16_UINT = 74,
	TIF_VK_FORMAT_R16_SINT = 75,
	TIF_VK_FORMAT_R16_SFLOAT = 76,
	TIF_VK_FORMAT_R16G16_UNORM = 77,
	TIF_VK_FORMAT_R16G16_SNORM = 78,
	TIF_VK_FORMAT_R16G16_USCALED = 79,
	TIF_VK_FORMAT_R16G16_SSCALED = 80,
	TIF_VK_FORMAT_R16G16_UINT = 81,
	TIF_VK_FORMAT_R16G16_SINT = 82,
	TIF_VK_FORMAT_R16G16_SFLOAT = 83,
	TIF_VK_FORMAT_R16G16B16_UNORM = 84,
	TIF_VK_FORMAT_R16G16B16_SNORM = 85,
	TIF_VK_FORMAT_R16G16B16_USCALED = 86,
	TIF_VK_FORMAT_R16G16B16_SSCALED = 87,
	TIF_VK_FORMAT_R16G16B16_UINT = 88,
	TIF_VK_FORMAT_R16G16B16_SINT = 89,
	TIF_VK_FORMAT_R16G16B16_SFLOAT = 90,
	TIF_VK_FORMAT_R16G16B16A16_UNORM = 91,
	TIF_VK_FORMAT_R16G16B16A16_SNORM = 92,
	TIF_VK_FORMAT_R16G16B16A16_USCALED = 93,
	TIF_VK_FORMAT_R16G16B16A16_SSCALED = 94,
	TIF_VK_FORMAT_R16G16B16A16_UINT = 95,
	TIF_VK_FORMAT_R16G16B16A16_SINT = 96,
	TIF_VK_FORMAT_R16G16B16A16_SFLOAT = 97,
	TIF_VK_FORMAT_R32_UINT = 98,
	TIF_VK_FORMAT_R32_SINT = 99,
	TIF_VK_FORMAT_R32_SFLOAT = 100,
	TIF_VK_FORMAT_R32G32_UINT = 101,
	TIF_VK_FORMAT_R32G32_SINT = 102,
	TIF_VK_FORMAT_R32G32_SFLOAT = 103,
	TIF_VK_FORMAT_R32G32B32_UINT = 104,
	TIF_VK_FORMAT_R32G32B32_SINT = 105,
	TIF_VK_FORMAT_R32G32B32_SFLOAT = 106,
	TIF_VK_FORMAT_R32G32B32A32_UINT = 107,
	TIF_VK_FORMAT_R32G32B32A32_SINT = 108,
	TIF_VK_FORMAT_R32G32B32A32_SFLOAT = 109,
	TIF_VK_FORMAT_R64_UINT = 110,
	TIF_VK_FORMAT_R64_SINT = 111,
	TIF_VK_FORMAT_R64_SFLOAT = 112,
	TIF_VK_FORMAT_R64G64_UINT = 113,
	TIF_VK_FORMAT_R64G64_SINT = 114,
	TIF_VK_FORMAT_R64G64_SFLOAT = 115,
	TIF_VK_FORMAT_R64G64B64_UINT = 116,
	TIF_VK_FORMAT_R64G64B64_SINT = 117,
	TIF_VK_FORMAT_R64G64B64_SFLOAT = 118,
	TIF_VK_FORMAT_R64G64B64A64_UINT = 119,
	TIF_VK_FORMAT_R64G64B64A64_SINT = 120,
	TIF_VK_FORMAT_R64G64B64A64_SFLOAT = 121,
	TIF_VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122,
	TIF_VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123,
	TIF_VK_FORMAT_D16_UNORM = 124,
	TIF_VK_FORMAT_X8_D24_UNORM_PACK32 = 125,
	TIF_VK_FORMAT_D32_SFLOAT = 126,
	TIF_VK_FORMAT_S8_UINT = 127,
	TIF_VK_FORMAT_D16_UNORM_S8_UINT = 128,
	TIF_VK_FORMAT_D24_UNORM_S8_UINT = 129,
	TIF_VK_FORMAT_D32_SFLOAT_S8_UINT = 130,
	TIF_VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131,
	TIF_VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132,
	TIF_VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133,
	TIF_VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134,
	TIF_VK_FORMAT_BC2_UNORM_BLOCK = 135,
	TIF_VK_FORMAT_BC2_SRGB_BLOCK = 136,
	TIF_VK_FORMAT_BC3_UNORM_BLOCK = 137,
	TIF_VK_FORMAT_BC3_SRGB_BLOCK = 138,
	TIF_VK_FORMAT_BC4_UNORM_BLOCK = 139,
	TIF_VK_FORMAT_BC4_SNORM_BLOCK = 140,
	TIF_VK_FORMAT_BC5_UNORM_BLOCK = 141,
	TIF_VK_FORMAT_BC5_SNORM_BLOCK = 142,
	TIF_VK_FORMAT_BC6H_UFLOAT_BLOCK = 143,
	TIF_VK_FORMAT_BC6H_SFLOAT_BLOCK = 144,
	TIF_VK_FORMAT_BC7_UNORM_BLOCK = 145,
	TIF_VK_FORMAT_BC7_SRGB_BLOCK = 146,
	TIF_VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147,
	TIF_VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148,
	TIF_VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149,
	TIF_VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150,
	TIF_VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151,
	TIF_VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152,
	TIF_VK_FORMAT_EAC_R11_UNORM_BLOCK = 153,
	TIF_VK_FORMAT_EAC_R11_SNORM_BLOCK = 154,
	TIF_VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155,
	TIF_VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156,
	TIF_VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157,
	TIF_VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158,
	TIF_VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159,
	TIF_VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160,
	TIF_VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161,
	TIF_VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162,
	TIF_VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163,
	TIF_VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164,
	TIF_VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165,
	TIF_VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166,
	TIF_VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167,
	TIF_VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168,
	TIF_VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169,
	TIF_VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170,
	TIF_VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171,
	TIF_VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172,
	TIF_VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173,
	TIF_VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174,
	TIF_VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175,
	TIF_VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176,
	TIF_VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177,
	TIF_VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178,
	TIF_VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179,
	TIF_VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180,
	TIF_VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181,
	TIF_VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182,
	TIF_VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183,
	TIF_VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184,

	TIF_VK_FORMAT_G8B8G8R8_422_UNORM = 1000156000,
	TIF_VK_FORMAT_B8G8R8G8_422_UNORM = 1000156001,
	TIF_VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM = 1000156002,
	TIF_VK_FORMAT_G8_B8R8_2PLANE_420_UNORM = 1000156003,
	TIF_VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM = 1000156004,
	TIF_VK_FORMAT_G8_B8R8_2PLANE_422_UNORM = 1000156005,
	TIF_VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM = 1000156006,
	TIF_VK_FORMAT_R10X6_UNORM_PACK16 = 1000156007,
	TIF_VK_FORMAT_R10X6G10X6_UNORM_2PACK16 = 1000156008,
	TIF_VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16 = 1000156009,
	TIF_VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16 = 1000156010,
	TIF_VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16 = 1000156011,
	TIF_VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16 = 1000156012,
	TIF_VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16 = 1000156013,
	TIF_VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16 = 1000156014,
	TIF_VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16 = 1000156015,
	TIF_VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16 = 1000156016,
	TIF_VK_FORMAT_R12X4_UNORM_PACK16 = 1000156017,
	TIF_VK_FORMAT_R12X4G12X4_UNORM_2PACK16 = 1000156018,
	TIF_VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16 = 1000156019,
	TIF_VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16 = 1000156020,
	TIF_VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16 = 1000156021,
	TIF_VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16 = 1000156022,
	TIF_VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16 = 1000156023,
	TIF_VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16 = 1000156024,
	TIF_VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16 = 1000156025,
	TIF_VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16 = 1000156026,
	TIF_VK_FORMAT_G16B16G16R16_422_UNORM = 1000156027,
	TIF_VK_FORMAT_B16G16R16G16_422_UNORM = 1000156028,
	TIF_VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM = 1000156029,
	TIF_VK_FORMAT_G16_B16R16_2PLANE_420_UNORM = 1000156030,
	TIF_VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM = 1000156031,
	TIF_VK_FORMAT_G16_B16R16_2PLANE_422_UNORM = 1000156032,
	TIF_VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM = 1000156033,
	TIF_VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000,
	TIF_VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001,
	TIF_VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002,
	TIF_VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003,
	TIF_VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004,
	TIF_VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005,
	TIF_VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006,
	TIF_VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007,
} TinyImageFormat_VkFormat;
#endif

inline TinyImageFormat TinyImageFormat_FromVkFormat(TinyImageFormat_VkFormat fmt) {
	switch (fmt) {

	case TIF_VK_FORMAT_UNDEFINED: return TinyImageFormat_UNDEFINED;
	case TIF_VK_FORMAT_R4G4_UNORM_PACK8: return TinyImageFormat_G4R4_UNORM;
	case TIF_VK_FORMAT_R4G4B4A4_UNORM_PACK16: return TinyImageFormat_A4B4G4R4_UNORM;
	case TIF_VK_FORMAT_B4G4R4A4_UNORM_PACK16: return TinyImageFormat_A4R4G4B4_UNORM;
	case TIF_VK_FORMAT_R5G6B5_UNORM_PACK16: return TinyImageFormat_B5G6R5_UNORM;
	case TIF_VK_FORMAT_B5G6R5_UNORM_PACK16: return TinyImageFormat_R5G6B5_UNORM;
	case TIF_VK_FORMAT_R5G5B5A1_UNORM_PACK16: return TinyImageFormat_A1B5G5R5_UNORM;
	case TIF_VK_FORMAT_B5G5R5A1_UNORM_PACK16: return TinyImageFormat_A1R5G5B5_UNORM;
	case TIF_VK_FORMAT_A1R5G5B5_UNORM_PACK16: return TinyImageFormat_B5G5R5A1_UNORM;
	case TIF_VK_FORMAT_R8_UNORM: return TinyImageFormat_R8_UNORM;
	case TIF_VK_FORMAT_R8_SNORM: return TinyImageFormat_R8_SNORM;
	case TIF_VK_FORMAT_R8_UINT: return TinyImageFormat_R8_UINT;
	case TIF_VK_FORMAT_R8_SINT: return TinyImageFormat_R8_SINT;
	case TIF_VK_FORMAT_R8_SRGB: return TinyImageFormat_R8_SRGB;
	case TIF_VK_FORMAT_R8G8_UNORM: return TinyImageFormat_R8G8_UNORM;
	case TIF_VK_FORMAT_R8G8_SNORM: return TinyImageFormat_R8G8_SNORM;
	case TIF_VK_FORMAT_R8G8_UINT: return TinyImageFormat_R8G8_UINT;
	case TIF_VK_FORMAT_R8G8_SINT: return TinyImageFormat_R8G8_SINT;
	case TIF_VK_FORMAT_R8G8_SRGB: return TinyImageFormat_R8G8_SRGB;
	case TIF_VK_FORMAT_R8G8B8_UNORM: return TinyImageFormat_R8G8B8_UNORM;
	case TIF_VK_FORMAT_R8G8B8_SNORM: return TinyImageFormat_R8G8B8_SNORM;
	case TIF_VK_FORMAT_R8G8B8_UINT: return TinyImageFormat_R8G8B8_UINT;
	case TIF_VK_FORMAT_R8G8B8_SINT: return TinyImageFormat_R8G8B8_SINT;
	case TIF_VK_FORMAT_R8G8B8_SRGB: return TinyImageFormat_R8G8B8_SRGB;
	case TIF_VK_FORMAT_B8G8R8_UNORM: return TinyImageFormat_B8G8R8_UNORM;
	case TIF_VK_FORMAT_B8G8R8_SNORM: return TinyImageFormat_B8G8R8_SNORM;
	case TIF_VK_FORMAT_B8G8R8_UINT: return TinyImageFormat_B8G8R8_UINT;
	case TIF_VK_FORMAT_B8G8R8_SINT: return TinyImageFormat_B8G8R8_SINT;
	case TIF_VK_FORMAT_B8G8R8_SRGB: return TinyImageFormat_B8G8R8_SRGB;
	case TIF_VK_FORMAT_R8G8B8A8_UNORM: return TinyImageFormat_R8G8B8A8_UNORM;
	case TIF_VK_FORMAT_R8G8B8A8_SNORM: return TinyImageFormat_R8G8B8A8_SNORM;
	case TIF_VK_FORMAT_R8G8B8A8_UINT: return TinyImageFormat_R8G8B8A8_UINT;
	case TIF_VK_FORMAT_R8G8B8A8_SINT: return TinyImageFormat_R8G8B8A8_SINT;
	case TIF_VK_FORMAT_R8G8B8A8_SRGB: return TinyImageFormat_R8G8B8A8_SRGB;
	case TIF_VK_FORMAT_B8G8R8A8_UNORM: return TinyImageFormat_B8G8R8A8_UNORM;
	case TIF_VK_FORMAT_B8G8R8A8_SNORM: return TinyImageFormat_B8G8R8A8_SNORM;
	case TIF_VK_FORMAT_B8G8R8A8_UINT: return TinyImageFormat_B8G8R8A8_UINT;
	case TIF_VK_FORMAT_B8G8R8A8_SINT: return TinyImageFormat_B8G8R8A8_SINT;
	case TIF_VK_FORMAT_B8G8R8A8_SRGB: return TinyImageFormat_B8G8R8A8_SRGB;
	case TIF_VK_FORMAT_A2R10G10B10_UNORM_PACK32: return TinyImageFormat_B10G10R10A2_UNORM;
	case TIF_VK_FORMAT_A2R10G10B10_UINT_PACK32: return TinyImageFormat_B10G10R10A2_UINT;
	case TIF_VK_FORMAT_A2B10G10R10_UNORM_PACK32: return TinyImageFormat_R10G10B10A2_UNORM;
	case TIF_VK_FORMAT_A2B10G10R10_UINT_PACK32: return TinyImageFormat_R10G10B10A2_UINT;
	case TIF_VK_FORMAT_R16_UNORM: return TinyImageFormat_R16_UNORM;
	case TIF_VK_FORMAT_R16_SNORM: return TinyImageFormat_R16_SNORM;
	case TIF_VK_FORMAT_R16_UINT: return TinyImageFormat_R16_UINT;
	case TIF_VK_FORMAT_R16_SINT: return TinyImageFormat_R16_SINT;
	case TIF_VK_FORMAT_R16_SFLOAT: return TinyImageFormat_R16_SFLOAT;
	case TIF_VK_FORMAT_R16G16_UNORM: return TinyImageFormat_R16G16_UNORM;
	case TIF_VK_FORMAT_R16G16_SNORM: return TinyImageFormat_R16G16_SNORM;
	case TIF_VK_FORMAT_R16G16_UINT: return TinyImageFormat_R16G16_UINT;
	case TIF_VK_FORMAT_R16G16_SINT: return TinyImageFormat_R16G16_SINT;
	case TIF_VK_FORMAT_R16G16_SFLOAT: return TinyImageFormat_R16G16_SFLOAT;
	case TIF_VK_FORMAT_R16G16B16_UNORM: return TinyImageFormat_R16G16B16_UNORM;
	case TIF_VK_FORMAT_R16G16B16_SNORM: return TinyImageFormat_R16G16B16_SNORM;
	case TIF_VK_FORMAT_R16G16B16_UINT: return TinyImageFormat_R16G16B16_UINT;
	case TIF_VK_FORMAT_R16G16B16_SINT: return TinyImageFormat_R16G16B16_SINT;
	case TIF_VK_FORMAT_R16G16B16_SFLOAT: return TinyImageFormat_R16G16B16_SFLOAT;
	case TIF_VK_FORMAT_R16G16B16A16_UNORM: return TinyImageFormat_R16G16B16A16_UNORM;
	case TIF_VK_FORMAT_R16G16B16A16_SNORM: return TinyImageFormat_R16G16B16A16_SNORM;
	case TIF_VK_FORMAT_R16G16B16A16_UINT: return TinyImageFormat_R16G16B16A16_UINT;
	case TIF_VK_FORMAT_R16G16B16A16_SINT: return TinyImageFormat_R16G16B16A16_SINT;
	case TIF_VK_FORMAT_R16G16B16A16_SFLOAT: return TinyImageFormat_R16G16B16A16_SFLOAT;
	case TIF_VK_FORMAT_R32_UINT: return TinyImageFormat_R32_UINT;
	case TIF_VK_FORMAT_R32_SINT: return TinyImageFormat_R32_SINT;
	case TIF_VK_FORMAT_R32_SFLOAT: return TinyImageFormat_R32_SFLOAT;
	case TIF_VK_FORMAT_R32G32_UINT: return TinyImageFormat_R32G32_UINT;
	case TIF_VK_FORMAT_R32G32_SINT: return TinyImageFormat_R32G32_SINT;
	case TIF_VK_FORMAT_R32G32_SFLOAT: return TinyImageFormat_R32G32_SFLOAT;
	case TIF_VK_FORMAT_R32G32B32_UINT: return TinyImageFormat_R32G32B32_UINT;
	case TIF_VK_FORMAT_R32G32B32_SINT: return TinyImageFormat_R32G32B32_SINT;
	case TIF_VK_FORMAT_R32G32B32_SFLOAT: return TinyImageFormat_R32G32B32_SFLOAT;
	case TIF_VK_FORMAT_R32G32B32A32_UINT: return TinyImageFormat_R32G32B32A32_UINT;
	case TIF_VK_FORMAT_R32G32B32A32_SINT: return TinyImageFormat_R32G32B32A32_SINT;
	case TIF_VK_FORMAT_R32G32B32A32_SFLOAT: return TinyImageFormat_R32G32B32A32_SFLOAT;
	case TIF_VK_FORMAT_R64_UINT: return TinyImageFormat_R64_UINT;
	case TIF_VK_FORMAT_R64_SINT: return TinyImageFormat_R64_SINT;
	case TIF_VK_FORMAT_R64_SFLOAT: return TinyImageFormat_R64_SFLOAT;
	case TIF_VK_FORMAT_R64G64_UINT: return TinyImageFormat_R64G64_UINT;
	case TIF_VK_FORMAT_R64G64_SINT: return TinyImageFormat_R64G64_SINT;
	case TIF_VK_FORMAT_R64G64_SFLOAT: return TinyImageFormat_R64G64_SFLOAT;
	case TIF_VK_FORMAT_R64G64B64_UINT: return TinyImageFormat_R64G64B64_UINT;
	case TIF_VK_FORMAT_R64G64B64_SINT: return TinyImageFormat_R64G64B64_SINT;
	case TIF_VK_FORMAT_R64G64B64_SFLOAT: return TinyImageFormat_R64G64B64_SFLOAT;
	case TIF_VK_FORMAT_R64G64B64A64_UINT: return TinyImageFormat_R64G64B64A64_UINT;
	case TIF_VK_FORMAT_R64G64B64A64_SINT: return TinyImageFormat_R64G64B64A64_SINT;
	case TIF_VK_FORMAT_R64G64B64A64_SFLOAT: return TinyImageFormat_R64G64B64A64_SFLOAT;
	case TIF_VK_FORMAT_B10G11R11_UFLOAT_PACK32: return TinyImageFormat_B10G11R11_UFLOAT;
	case TIF_VK_FORMAT_E5B9G9R9_UFLOAT_PACK32: return TinyImageFormat_E5B9G9R9_UFLOAT;
	case TIF_VK_FORMAT_D16_UNORM: return TinyImageFormat_D16_UNORM;
	case TIF_VK_FORMAT_X8_D24_UNORM_PACK32: return TinyImageFormat_X8_D24_UNORM;
	case TIF_VK_FORMAT_D32_SFLOAT: return TinyImageFormat_D32_SFLOAT;
	case TIF_VK_FORMAT_S8_UINT: return TinyImageFormat_S8_UINT;
	case TIF_VK_FORMAT_D16_UNORM_S8_UINT: return TinyImageFormat_D16_UNORM_S8_UINT;
	case TIF_VK_FORMAT_D24_UNORM_S8_UINT: return TinyImageFormat_D24_UNORM_S8_UINT;
	case TIF_VK_FORMAT_D32_SFLOAT_S8_UINT: return TinyImageFormat_D32_SFLOAT_S8_UINT;
	case TIF_VK_FORMAT_BC1_RGB_UNORM_BLOCK: return TinyImageFormat_DXBC1_RGB_UNORM;
	case TIF_VK_FORMAT_BC1_RGB_SRGB_BLOCK: return TinyImageFormat_DXBC1_RGB_SRGB;
	case TIF_VK_FORMAT_BC1_RGBA_UNORM_BLOCK: return TinyImageFormat_DXBC1_RGBA_UNORM;
	case TIF_VK_FORMAT_BC1_RGBA_SRGB_BLOCK: return TinyImageFormat_DXBC1_RGBA_SRGB;
	case TIF_VK_FORMAT_BC2_UNORM_BLOCK: return TinyImageFormat_DXBC2_UNORM;
	case TIF_VK_FORMAT_BC2_SRGB_BLOCK: return TinyImageFormat_DXBC2_SRGB;
	case TIF_VK_FORMAT_BC3_UNORM_BLOCK: return TinyImageFormat_DXBC3_UNORM;
	case TIF_VK_FORMAT_BC3_SRGB_BLOCK: return TinyImageFormat_DXBC3_SRGB;
	case TIF_VK_FORMAT_BC4_UNORM_BLOCK: return TinyImageFormat_DXBC4_UNORM;
	case TIF_VK_FORMAT_BC4_SNORM_BLOCK: return TinyImageFormat_DXBC4_SNORM;
	case TIF_VK_FORMAT_BC5_UNORM_BLOCK: return TinyImageFormat_DXBC5_UNORM;
	case TIF_VK_FORMAT_BC5_SNORM_BLOCK: return TinyImageFormat_DXBC5_SNORM;
	case TIF_VK_FORMAT_BC6H_UFLOAT_BLOCK: return TinyImageFormat_DXBC6H_UFLOAT;
	case TIF_VK_FORMAT_BC6H_SFLOAT_BLOCK: return TinyImageFormat_DXBC6H_SFLOAT;
	case TIF_VK_FORMAT_BC7_UNORM_BLOCK: return TinyImageFormat_DXBC7_UNORM;
	case TIF_VK_FORMAT_BC7_SRGB_BLOCK: return TinyImageFormat_DXBC7_SRGB;
	case TIF_VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK: return TinyImageFormat_ETC2_R8G8B8_UNORM;
	case TIF_VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK: return TinyImageFormat_ETC2_R8G8B8_SRGB;
	case TIF_VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK: return TinyImageFormat_ETC2_R8G8B8A1_UNORM;
	case TIF_VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK: return TinyImageFormat_ETC2_R8G8B8A1_SRGB;
	case TIF_VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK: return TinyImageFormat_ETC2_R8G8B8A8_UNORM;
	case TIF_VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK: return TinyImageFormat_ETC2_R8G8B8A8_SRGB;
	case TIF_VK_FORMAT_EAC_R11_UNORM_BLOCK: return TinyImageFormat_ETC2_EAC_R11_UNORM;
	case TIF_VK_FORMAT_EAC_R11_SNORM_BLOCK: return TinyImageFormat_ETC2_EAC_R11_SNORM;
	case TIF_VK_FORMAT_EAC_R11G11_UNORM_BLOCK: return TinyImageFormat_ETC2_EAC_R11G11_UNORM;
	case TIF_VK_FORMAT_EAC_R11G11_SNORM_BLOCK: return TinyImageFormat_ETC2_EAC_R11G11_SNORM;
	case TIF_VK_FORMAT_ASTC_4x4_UNORM_BLOCK: return TinyImageFormat_ASTC_4x4_UNORM;
	case TIF_VK_FORMAT_ASTC_4x4_SRGB_BLOCK: return TinyImageFormat_ASTC_4x4_SRGB;
	case TIF_VK_FORMAT_ASTC_5x4_UNORM_BLOCK: return TinyImageFormat_ASTC_5x4_UNORM;
	case TIF_VK_FORMAT_ASTC_5x4_SRGB_BLOCK: return TinyImageFormat_ASTC_5x4_SRGB;
	case TIF_VK_FORMAT_ASTC_5x5_UNORM_BLOCK: return TinyImageFormat_ASTC_5x5_UNORM;
	case TIF_VK_FORMAT_ASTC_5x5_SRGB_BLOCK: return TinyImageFormat_ASTC_5x5_SRGB;
	case TIF_VK_FORMAT_ASTC_6x5_UNORM_BLOCK: return TinyImageFormat_ASTC_6x5_UNORM;
	case TIF_VK_FORMAT_ASTC_6x5_SRGB_BLOCK: return TinyImageFormat_ASTC_6x5_SRGB;
	case TIF_VK_FORMAT_ASTC_6x6_UNORM_BLOCK: return TinyImageFormat_ASTC_6x6_UNORM;
	case TIF_VK_FORMAT_ASTC_6x6_SRGB_BLOCK: return TinyImageFormat_ASTC_6x6_SRGB;
	case TIF_VK_FORMAT_ASTC_8x5_UNORM_BLOCK: return TinyImageFormat_ASTC_8x5_UNORM;
	case TIF_VK_FORMAT_ASTC_8x5_SRGB_BLOCK: return TinyImageFormat_ASTC_8x5_SRGB;
	case TIF_VK_FORMAT_ASTC_8x6_UNORM_BLOCK: return TinyImageFormat_ASTC_8x6_UNORM;
	case TIF_VK_FORMAT_ASTC_8x6_SRGB_BLOCK: return TinyImageFormat_ASTC_8x6_SRGB;
	case TIF_VK_FORMAT_ASTC_8x8_UNORM_BLOCK: return TinyImageFormat_ASTC_8x8_UNORM;
	case TIF_VK_FORMAT_ASTC_8x8_SRGB_BLOCK: return TinyImageFormat_ASTC_8x8_SRGB;
	case TIF_VK_FORMAT_ASTC_10x5_UNORM_BLOCK: return TinyImageFormat_ASTC_10x5_UNORM;
	case TIF_VK_FORMAT_ASTC_10x5_SRGB_BLOCK: return TinyImageFormat_ASTC_10x5_SRGB;
	case TIF_VK_FORMAT_ASTC_10x6_UNORM_BLOCK: return TinyImageFormat_ASTC_10x6_UNORM;
	case TIF_VK_FORMAT_ASTC_10x6_SRGB_BLOCK: return TinyImageFormat_ASTC_10x6_SRGB;
	case TIF_VK_FORMAT_ASTC_10x8_UNORM_BLOCK: return TinyImageFormat_ASTC_10x8_UNORM;
	case TIF_VK_FORMAT_ASTC_10x8_SRGB_BLOCK: return TinyImageFormat_ASTC_10x8_SRGB;
	case TIF_VK_FORMAT_ASTC_10x10_UNORM_BLOCK: return TinyImageFormat_ASTC_10x10_UNORM;
	case TIF_VK_FORMAT_ASTC_10x10_SRGB_BLOCK: return TinyImageFormat_ASTC_10x10_SRGB;
	case TIF_VK_FORMAT_ASTC_12x10_UNORM_BLOCK: return TinyImageFormat_ASTC_12x10_UNORM;
	case TIF_VK_FORMAT_ASTC_12x10_SRGB_BLOCK: return TinyImageFormat_ASTC_12x10_SRGB;
	case TIF_VK_FORMAT_ASTC_12x12_UNORM_BLOCK: return TinyImageFormat_ASTC_12x12_UNORM;
	case TIF_VK_FORMAT_ASTC_12x12_SRGB_BLOCK: return TinyImageFormat_ASTC_12x12_SRGB;

	case TIF_VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG: return TinyImageFormat_PVRTC1_2BPP_UNORM;
	case TIF_VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG: return TinyImageFormat_PVRTC1_4BPP_UNORM;
	case TIF_VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG: return TinyImageFormat_PVRTC1_2BPP_SRGB;
	case TIF_VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG: return TinyImageFormat_PVRTC1_4BPP_SRGB;

	case TIF_VK_FORMAT_G16B16G16R16_422_UNORM: return TinyImageFormat_G16B16G16R16_422_UNORM;
	case TIF_VK_FORMAT_B16G16R16G16_422_UNORM: return TinyImageFormat_B16G16R16G16_422_UNORM;
	case TIF_VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16: return TinyImageFormat_R12X4G12X4B12X4A12X4_UNORM_4PACK16;
	case TIF_VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16: return TinyImageFormat_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16;
	case TIF_VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16: return TinyImageFormat_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16;
	case TIF_VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16: return TinyImageFormat_R10X6G10X6B10X6A10X6_UNORM_4PACK16;
	case TIF_VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16: return TinyImageFormat_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16;
	case TIF_VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16: return TinyImageFormat_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16;
	case TIF_VK_FORMAT_G8B8G8R8_422_UNORM: return TinyImageFormat_G8B8G8R8_422_UNORM;
	case TIF_VK_FORMAT_B8G8R8G8_422_UNORM: return TinyImageFormat_B8G8R8G8_422_UNORM;
	case TIF_VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM: return TinyImageFormat_G8_B8_R8_3PLANE_420_UNORM;
	case TIF_VK_FORMAT_G8_B8R8_2PLANE_420_UNORM: return TinyImageFormat_G8_B8R8_2PLANE_420_UNORM;
	case TIF_VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM: return TinyImageFormat_G8_B8_R8_3PLANE_422_UNORM;
	case TIF_VK_FORMAT_G8_B8R8_2PLANE_422_UNORM: return TinyImageFormat_G8_B8R8_2PLANE_422_UNORM;
	case TIF_VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM: return TinyImageFormat_G8_B8_R8_3PLANE_444_UNORM;
	case TIF_VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16: return TinyImageFormat_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16;
	case TIF_VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16: return TinyImageFormat_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16;
	case TIF_VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16: return TinyImageFormat_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16;
	case TIF_VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16: return TinyImageFormat_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16;
	case TIF_VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16: return TinyImageFormat_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16;
	case TIF_VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16: return TinyImageFormat_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16;
	case TIF_VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16: return TinyImageFormat_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16;
	case TIF_VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16: return TinyImageFormat_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16;
	case TIF_VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16: return TinyImageFormat_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16;
	case TIF_VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16: return TinyImageFormat_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16;
	case TIF_VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM: return TinyImageFormat_G16_B16_R16_3PLANE_420_UNORM;
	case TIF_VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM: return TinyImageFormat_G16_B16_R16_3PLANE_422_UNORM;
	case TIF_VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM: return TinyImageFormat_G16_B16_R16_3PLANE_444_UNORM;
	case TIF_VK_FORMAT_G16_B16R16_2PLANE_420_UNORM: return TinyImageFormat_G16_B16R16_2PLANE_420_UNORM;
	case TIF_VK_FORMAT_G16_B16R16_2PLANE_422_UNORM: return TinyImageFormat_G16_B16R16_2PLANE_422_UNORM;

	case TIF_VK_FORMAT_A8B8G8R8_UNORM_PACK32:
	case TIF_VK_FORMAT_R8_USCALED:
	case TIF_VK_FORMAT_R8_SSCALED:
	case TIF_VK_FORMAT_R8G8_USCALED:
	case TIF_VK_FORMAT_R8G8_SSCALED:
	case TIF_VK_FORMAT_R8G8B8_USCALED:
	case TIF_VK_FORMAT_R8G8B8_SSCALED:
	case TIF_VK_FORMAT_B8G8R8_USCALED:
	case TIF_VK_FORMAT_B8G8R8_SSCALED:
	case TIF_VK_FORMAT_R8G8B8A8_USCALED:
	case TIF_VK_FORMAT_R8G8B8A8_SSCALED:
	case TIF_VK_FORMAT_B8G8R8A8_USCALED:
	case TIF_VK_FORMAT_B8G8R8A8_SSCALED:
	case TIF_VK_FORMAT_A8B8G8R8_SNORM_PACK32:
	case TIF_VK_FORMAT_A8B8G8R8_USCALED_PACK32:
	case TIF_VK_FORMAT_A8B8G8R8_SSCALED_PACK32:
	case TIF_VK_FORMAT_A8B8G8R8_UINT_PACK32:
	case TIF_VK_FORMAT_A8B8G8R8_SINT_PACK32:
	case TIF_VK_FORMAT_A8B8G8R8_SRGB_PACK32:
	case TIF_VK_FORMAT_A2R10G10B10_SNORM_PACK32:
	case TIF_VK_FORMAT_A2R10G10B10_USCALED_PACK32:
	case TIF_VK_FORMAT_A2R10G10B10_SSCALED_PACK32:
	case TIF_VK_FORMAT_A2R10G10B10_SINT_PACK32:
	case TIF_VK_FORMAT_A2B10G10R10_SNORM_PACK32:
	case TIF_VK_FORMAT_A2B10G10R10_USCALED_PACK32:
	case TIF_VK_FORMAT_A2B10G10R10_SSCALED_PACK32:
	case TIF_VK_FORMAT_A2B10G10R10_SINT_PACK32:
	case TIF_VK_FORMAT_R16_USCALED:
	case TIF_VK_FORMAT_R16_SSCALED:
	case TIF_VK_FORMAT_R16G16_USCALED:
	case TIF_VK_FORMAT_R16G16_SSCALED:
	case TIF_VK_FORMAT_R16G16B16_USCALED:
	case TIF_VK_FORMAT_R16G16B16_SSCALED:
	case TIF_VK_FORMAT_R16G16B16A16_USCALED:
	case TIF_VK_FORMAT_R16G16B16A16_SSCALED:
	case TIF_VK_FORMAT_R10X6_UNORM_PACK16:
	case TIF_VK_FORMAT_R10X6G10X6_UNORM_2PACK16:
	case TIF_VK_FORMAT_R12X4_UNORM_PACK16:
	case TIF_VK_FORMAT_R12X4G12X4_UNORM_2PACK16:
	case TIF_VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:
	case TIF_VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:
	case TIF_VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:
	case TIF_VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:
		return TinyImageFormat_UNDEFINED;
	}
	return TinyImageFormat_UNDEFINED;
}

inline TinyImageFormat_VkFormat TinyImageFormat_ToVkFormat(TinyImageFormat fmt) {
	switch (fmt) {

	case TinyImageFormat_UNDEFINED: return TIF_VK_FORMAT_UNDEFINED;
	case TinyImageFormat_G4R4_UNORM: return TIF_VK_FORMAT_R4G4_UNORM_PACK8;
	case TinyImageFormat_A4B4G4R4_UNORM: return TIF_VK_FORMAT_R4G4B4A4_UNORM_PACK16;
	case TinyImageFormat_A4R4G4B4_UNORM: return TIF_VK_FORMAT_B4G4R4A4_UNORM_PACK16;
	case TinyImageFormat_R5G6B5_UNORM: return TIF_VK_FORMAT_B5G6R5_UNORM_PACK16;
	case TinyImageFormat_B5G6R5_UNORM: return TIF_VK_FORMAT_R5G6B5_UNORM_PACK16;
	case TinyImageFormat_A1B5G5R5_UNORM: return TIF_VK_FORMAT_R5G5B5A1_UNORM_PACK16;
	case TinyImageFormat_A1R5G5B5_UNORM: return TIF_VK_FORMAT_B5G5R5A1_UNORM_PACK16;
	case TinyImageFormat_B5G5R5A1_UNORM: return TIF_VK_FORMAT_A1R5G5B5_UNORM_PACK16;
	case TinyImageFormat_A2B10G10R10_UNORM: return TIF_VK_FORMAT_A2B10G10R10_UNORM_PACK32;

	case TinyImageFormat_R8_UNORM: return TIF_VK_FORMAT_R8_UNORM;
	case TinyImageFormat_R8_SNORM: return TIF_VK_FORMAT_R8_SNORM;
	case TinyImageFormat_R8_UINT: return TIF_VK_FORMAT_R8_UINT;
	case TinyImageFormat_R8_SINT: return TIF_VK_FORMAT_R8_SINT;
	case TinyImageFormat_R8_SRGB: return TIF_VK_FORMAT_R8_SRGB;
	case TinyImageFormat_R8G8_UNORM: return TIF_VK_FORMAT_R8G8_UNORM;
	case TinyImageFormat_R8G8_SNORM: return TIF_VK_FORMAT_R8G8_SNORM;
	case TinyImageFormat_R8G8_UINT: return TIF_VK_FORMAT_R8G8_UINT;
	case TinyImageFormat_R8G8_SINT: return TIF_VK_FORMAT_R8G8_SINT;
	case TinyImageFormat_R8G8_SRGB: return TIF_VK_FORMAT_R8G8_SRGB;
	case TinyImageFormat_R8G8B8_UNORM: return TIF_VK_FORMAT_R8G8B8_UNORM;
	case TinyImageFormat_R8G8B8_SNORM: return TIF_VK_FORMAT_R8G8B8_SNORM;
	case TinyImageFormat_R8G8B8_UINT: return TIF_VK_FORMAT_R8G8B8_UINT;
	case TinyImageFormat_R8G8B8_SINT: return TIF_VK_FORMAT_R8G8B8_SINT;
	case TinyImageFormat_R8G8B8_SRGB: return TIF_VK_FORMAT_R8G8B8_SRGB;
	case TinyImageFormat_B8G8R8_UNORM: return TIF_VK_FORMAT_B8G8R8_UNORM;
	case TinyImageFormat_B8G8R8_SNORM: return TIF_VK_FORMAT_B8G8R8_SNORM;
	case TinyImageFormat_B8G8R8_UINT: return TIF_VK_FORMAT_B8G8R8_UINT;
	case TinyImageFormat_B8G8R8_SINT: return TIF_VK_FORMAT_B8G8R8_SINT;
	case TinyImageFormat_B8G8R8_SRGB: return TIF_VK_FORMAT_B8G8R8_SRGB;
	case TinyImageFormat_R8G8B8A8_UNORM: return TIF_VK_FORMAT_R8G8B8A8_UNORM;
	case TinyImageFormat_R8G8B8A8_SNORM: return TIF_VK_FORMAT_R8G8B8A8_SNORM;
	case TinyImageFormat_R8G8B8A8_UINT: return TIF_VK_FORMAT_R8G8B8A8_UINT;
	case TinyImageFormat_R8G8B8A8_SINT: return TIF_VK_FORMAT_R8G8B8A8_SINT;
	case TinyImageFormat_R8G8B8A8_SRGB: return TIF_VK_FORMAT_R8G8B8A8_SRGB;
	case TinyImageFormat_B8G8R8A8_UNORM: return TIF_VK_FORMAT_B8G8R8A8_UNORM;
	case TinyImageFormat_B8G8R8A8_SNORM: return TIF_VK_FORMAT_B8G8R8A8_SNORM;
	case TinyImageFormat_B8G8R8A8_UINT: return TIF_VK_FORMAT_B8G8R8A8_UINT;
	case TinyImageFormat_B8G8R8A8_SINT: return TIF_VK_FORMAT_B8G8R8A8_SINT;
	case TinyImageFormat_B8G8R8A8_SRGB: return TIF_VK_FORMAT_B8G8R8A8_SRGB;
	case TinyImageFormat_R16_UNORM: return TIF_VK_FORMAT_R16_UNORM;
	case TinyImageFormat_R16_SNORM: return TIF_VK_FORMAT_R16_SNORM;
	case TinyImageFormat_R16_UINT: return TIF_VK_FORMAT_R16_UINT;
	case TinyImageFormat_R16_SINT: return TIF_VK_FORMAT_R16_SINT;
	case TinyImageFormat_R16_SFLOAT: return TIF_VK_FORMAT_R16_SFLOAT;
	case TinyImageFormat_R16G16_UNORM: return TIF_VK_FORMAT_R16G16_UNORM;
	case TinyImageFormat_R16G16_SNORM: return TIF_VK_FORMAT_R16G16_SNORM;
	case TinyImageFormat_R16G16_UINT: return TIF_VK_FORMAT_R16G16_UINT;
	case TinyImageFormat_R16G16_SINT: return TIF_VK_FORMAT_R16G16_SINT;
	case TinyImageFormat_R16G16_SFLOAT: return TIF_VK_FORMAT_R16G16_SFLOAT;
	case TinyImageFormat_R16G16B16_UNORM: return TIF_VK_FORMAT_R16G16B16_UNORM;
	case TinyImageFormat_R16G16B16_SNORM: return TIF_VK_FORMAT_R16G16B16_SNORM;
	case TinyImageFormat_R16G16B16_UINT: return TIF_VK_FORMAT_R16G16B16_UINT;
	case TinyImageFormat_R16G16B16_SINT: return TIF_VK_FORMAT_R16G16B16_SINT;
	case TinyImageFormat_R16G16B16_SFLOAT: return TIF_VK_FORMAT_R16G16B16_SFLOAT;
	case TinyImageFormat_R16G16B16A16_UNORM: return TIF_VK_FORMAT_R16G16B16A16_UNORM;
	case TinyImageFormat_R16G16B16A16_SNORM: return TIF_VK_FORMAT_R16G16B16A16_SNORM;
	case TinyImageFormat_R16G16B16A16_UINT: return TIF_VK_FORMAT_R16G16B16A16_UINT;
	case TinyImageFormat_R16G16B16A16_SINT: return TIF_VK_FORMAT_R16G16B16A16_SINT;
	case TinyImageFormat_R16G16B16A16_SFLOAT: return TIF_VK_FORMAT_R16G16B16A16_SFLOAT;
	case TinyImageFormat_R32_UINT: return TIF_VK_FORMAT_R32_UINT;
	case TinyImageFormat_R32_SINT: return TIF_VK_FORMAT_R32_SINT;
	case TinyImageFormat_R32_SFLOAT: return TIF_VK_FORMAT_R32_SFLOAT;
	case TinyImageFormat_R32G32_UINT: return TIF_VK_FORMAT_R32G32_UINT;
	case TinyImageFormat_R32G32_SINT: return TIF_VK_FORMAT_R32G32_SINT;
	case TinyImageFormat_R32G32_SFLOAT: return TIF_VK_FORMAT_R32G32_SFLOAT;
	case TinyImageFormat_R32G32B32_UINT: return TIF_VK_FORMAT_R32G32B32_UINT;
	case TinyImageFormat_R32G32B32_SINT: return TIF_VK_FORMAT_R32G32B32_SINT;
	case TinyImageFormat_R32G32B32_SFLOAT: return TIF_VK_FORMAT_R32G32B32_SFLOAT;
	case TinyImageFormat_R32G32B32A32_UINT: return TIF_VK_FORMAT_R32G32B32A32_UINT;
	case TinyImageFormat_R32G32B32A32_SINT: return TIF_VK_FORMAT_R32G32B32A32_SINT;
	case TinyImageFormat_R32G32B32A32_SFLOAT: return TIF_VK_FORMAT_R32G32B32A32_SFLOAT;
	case TinyImageFormat_R64_UINT: return TIF_VK_FORMAT_R64_UINT;
	case TinyImageFormat_R64_SINT: return TIF_VK_FORMAT_R64_SINT;
	case TinyImageFormat_R64_SFLOAT: return TIF_VK_FORMAT_R64_SFLOAT;
	case TinyImageFormat_R64G64_UINT: return TIF_VK_FORMAT_R64G64_UINT;
	case TinyImageFormat_R64G64_SINT: return TIF_VK_FORMAT_R64G64_SINT;
	case TinyImageFormat_R64G64_SFLOAT: return TIF_VK_FORMAT_R64G64_SFLOAT;
	case TinyImageFormat_R64G64B64_UINT: return TIF_VK_FORMAT_R64G64B64_UINT;
	case TinyImageFormat_R64G64B64_SINT: return TIF_VK_FORMAT_R64G64B64_SINT;
	case TinyImageFormat_R64G64B64_SFLOAT: return TIF_VK_FORMAT_R64G64B64_SFLOAT;
	case TinyImageFormat_R64G64B64A64_UINT: return TIF_VK_FORMAT_R64G64B64A64_UINT;
	case TinyImageFormat_R64G64B64A64_SINT: return TIF_VK_FORMAT_R64G64B64A64_SINT;
	case TinyImageFormat_R64G64B64A64_SFLOAT: return TIF_VK_FORMAT_R64G64B64A64_SFLOAT;

	case TinyImageFormat_B10G10R10A2_UNORM: return TIF_VK_FORMAT_A2R10G10B10_UNORM_PACK32;
	case TinyImageFormat_B10G10R10A2_UINT: return TIF_VK_FORMAT_A2R10G10B10_UINT_PACK32;
	case TinyImageFormat_R10G10B10A2_UNORM: return TIF_VK_FORMAT_A2B10G10R10_UNORM_PACK32;
	case TinyImageFormat_R10G10B10A2_UINT: return TIF_VK_FORMAT_A2B10G10R10_UINT_PACK32;

	case TinyImageFormat_B10G11R11_UFLOAT: return TIF_VK_FORMAT_B10G11R11_UFLOAT_PACK32;
	case TinyImageFormat_E5B9G9R9_UFLOAT: return TIF_VK_FORMAT_E5B9G9R9_UFLOAT_PACK32;
			
	case TinyImageFormat_G16B16G16R16_422_UNORM: return TIF_VK_FORMAT_G16B16G16R16_422_UNORM;
	case TinyImageFormat_B16G16R16G16_422_UNORM: return TIF_VK_FORMAT_B16G16R16G16_422_UNORM;
	case TinyImageFormat_R12X4G12X4B12X4A12X4_UNORM_4PACK16: return TIF_VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16;
	case TinyImageFormat_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16: return TIF_VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16;
	case TinyImageFormat_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16: return TIF_VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16;
	case TinyImageFormat_R10X6G10X6B10X6A10X6_UNORM_4PACK16: return TIF_VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16;
	case TinyImageFormat_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16: return TIF_VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16;
	case TinyImageFormat_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16: return TIF_VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16;
	case TinyImageFormat_G8B8G8R8_422_UNORM: return TIF_VK_FORMAT_G8B8G8R8_422_UNORM;
	case TinyImageFormat_B8G8R8G8_422_UNORM: return TIF_VK_FORMAT_B8G8R8G8_422_UNORM;
	case TinyImageFormat_G8_B8_R8_3PLANE_420_UNORM: return TIF_VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM;
	case TinyImageFormat_G8_B8R8_2PLANE_420_UNORM: return TIF_VK_FORMAT_G8_B8R8_2PLANE_420_UNORM;
	case TinyImageFormat_G8_B8_R8_3PLANE_422_UNORM: return TIF_VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM;
	case TinyImageFormat_G8_B8R8_2PLANE_422_UNORM: return TIF_VK_FORMAT_G8_B8R8_2PLANE_422_UNORM;
	case TinyImageFormat_G8_B8_R8_3PLANE_444_UNORM: return TIF_VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM;
	case TinyImageFormat_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16: return TIF_VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16;
	case TinyImageFormat_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16: return TIF_VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16;
	case TinyImageFormat_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16: return TIF_VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16;
	case TinyImageFormat_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16: return TIF_VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16;
	case TinyImageFormat_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16: return TIF_VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16;
	case TinyImageFormat_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16: return TIF_VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16;
	case TinyImageFormat_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16: return TIF_VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16;
	case TinyImageFormat_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16: return TIF_VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16;
	case TinyImageFormat_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16: return TIF_VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16;
	case TinyImageFormat_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16: return TIF_VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16;
	case TinyImageFormat_G16_B16_R16_3PLANE_420_UNORM: return TIF_VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM;
	case TinyImageFormat_G16_B16_R16_3PLANE_422_UNORM: return TIF_VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM;
	case TinyImageFormat_G16_B16_R16_3PLANE_444_UNORM: return TIF_VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM;
	case TinyImageFormat_G16_B16R16_2PLANE_420_UNORM: return TIF_VK_FORMAT_G16_B16R16_2PLANE_420_UNORM;
	case TinyImageFormat_G16_B16R16_2PLANE_422_UNORM: return TIF_VK_FORMAT_G16_B16R16_2PLANE_422_UNORM;

	case TinyImageFormat_D16_UNORM: return TIF_VK_FORMAT_D16_UNORM;
	case TinyImageFormat_X8_D24_UNORM: return TIF_VK_FORMAT_X8_D24_UNORM_PACK32;
	case TinyImageFormat_D32_SFLOAT: return TIF_VK_FORMAT_D32_SFLOAT;
	case TinyImageFormat_S8_UINT: return TIF_VK_FORMAT_S8_UINT;
	case TinyImageFormat_D16_UNORM_S8_UINT: return TIF_VK_FORMAT_D16_UNORM_S8_UINT;
	case TinyImageFormat_D24_UNORM_S8_UINT: return TIF_VK_FORMAT_D24_UNORM_S8_UINT;
	case TinyImageFormat_D32_SFLOAT_S8_UINT: return TIF_VK_FORMAT_D32_SFLOAT_S8_UINT;
	case TinyImageFormat_DXBC1_RGB_UNORM: return TIF_VK_FORMAT_BC1_RGB_UNORM_BLOCK;
	case TinyImageFormat_DXBC1_RGB_SRGB: return TIF_VK_FORMAT_BC1_RGB_SRGB_BLOCK;
	case TinyImageFormat_DXBC1_RGBA_UNORM: return TIF_VK_FORMAT_BC1_RGBA_UNORM_BLOCK;
	case TinyImageFormat_DXBC1_RGBA_SRGB: return TIF_VK_FORMAT_BC1_RGBA_SRGB_BLOCK;
	case TinyImageFormat_DXBC2_UNORM: return TIF_VK_FORMAT_BC2_UNORM_BLOCK;
	case TinyImageFormat_DXBC2_SRGB: return TIF_VK_FORMAT_BC2_SRGB_BLOCK;
	case TinyImageFormat_DXBC3_UNORM: return TIF_VK_FORMAT_BC3_UNORM_BLOCK;
	case TinyImageFormat_DXBC3_SRGB: return TIF_VK_FORMAT_BC3_SRGB_BLOCK;
	case TinyImageFormat_DXBC4_UNORM: return TIF_VK_FORMAT_BC4_UNORM_BLOCK;
	case TinyImageFormat_DXBC4_SNORM: return TIF_VK_FORMAT_BC4_SNORM_BLOCK;
	case TinyImageFormat_DXBC5_UNORM: return TIF_VK_FORMAT_BC5_UNORM_BLOCK;
	case TinyImageFormat_DXBC5_SNORM: return TIF_VK_FORMAT_BC5_SNORM_BLOCK;
	case TinyImageFormat_DXBC6H_UFLOAT: return TIF_VK_FORMAT_BC6H_UFLOAT_BLOCK;
	case TinyImageFormat_DXBC6H_SFLOAT: return TIF_VK_FORMAT_BC6H_SFLOAT_BLOCK;
	case TinyImageFormat_DXBC7_UNORM: return TIF_VK_FORMAT_BC7_UNORM_BLOCK;
	case TinyImageFormat_DXBC7_SRGB: return TIF_VK_FORMAT_BC7_SRGB_BLOCK;
	case TinyImageFormat_PVRTC1_2BPP_UNORM: return TIF_VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG;
	case TinyImageFormat_PVRTC1_4BPP_UNORM: return TIF_VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG;
	case TinyImageFormat_PVRTC1_2BPP_SRGB: return TIF_VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG;
	case TinyImageFormat_PVRTC1_4BPP_SRGB: return TIF_VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG;
	case TinyImageFormat_ETC2_R8G8B8_UNORM: return TIF_VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK;
	case TinyImageFormat_ETC2_R8G8B8A1_UNORM: return TIF_VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK;
	case TinyImageFormat_ETC2_R8G8B8A8_UNORM: return TIF_VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK;
	case TinyImageFormat_ETC2_R8G8B8_SRGB: return TIF_VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK;
	case TinyImageFormat_ETC2_R8G8B8A1_SRGB: return TIF_VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK;
	case TinyImageFormat_ETC2_R8G8B8A8_SRGB: return TIF_VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK;
	case TinyImageFormat_ETC2_EAC_R11_UNORM: return TIF_VK_FORMAT_EAC_R11_UNORM_BLOCK;
	case TinyImageFormat_ETC2_EAC_R11G11_UNORM: return TIF_VK_FORMAT_EAC_R11G11_UNORM_BLOCK;
	case TinyImageFormat_ETC2_EAC_R11_SNORM: return TIF_VK_FORMAT_EAC_R11_SNORM_BLOCK;
	case TinyImageFormat_ETC2_EAC_R11G11_SNORM: return TIF_VK_FORMAT_EAC_R11G11_SNORM_BLOCK;
	case TinyImageFormat_ASTC_4x4_UNORM: return TIF_VK_FORMAT_ASTC_4x4_UNORM_BLOCK;
	case TinyImageFormat_ASTC_4x4_SRGB: return TIF_VK_FORMAT_ASTC_4x4_SRGB_BLOCK;
	case TinyImageFormat_ASTC_5x4_UNORM: return TIF_VK_FORMAT_ASTC_5x4_UNORM_BLOCK;
	case TinyImageFormat_ASTC_5x4_SRGB: return TIF_VK_FORMAT_ASTC_5x4_SRGB_BLOCK;
	case TinyImageFormat_ASTC_5x5_UNORM: return TIF_VK_FORMAT_ASTC_5x5_UNORM_BLOCK;
	case TinyImageFormat_ASTC_5x5_SRGB: return TIF_VK_FORMAT_ASTC_5x5_SRGB_BLOCK;
	case TinyImageFormat_ASTC_6x5_UNORM: return TIF_VK_FORMAT_ASTC_6x5_UNORM_BLOCK;
	case TinyImageFormat_ASTC_6x5_SRGB: return TIF_VK_FORMAT_ASTC_6x5_SRGB_BLOCK;
	case TinyImageFormat_ASTC_6x6_UNORM: return TIF_VK_FORMAT_ASTC_6x6_UNORM_BLOCK;
	case TinyImageFormat_ASTC_6x6_SRGB: return TIF_VK_FORMAT_ASTC_6x6_SRGB_BLOCK;
	case TinyImageFormat_ASTC_8x5_UNORM: return TIF_VK_FORMAT_ASTC_8x5_UNORM_BLOCK;
	case TinyImageFormat_ASTC_8x5_SRGB: return TIF_VK_FORMAT_ASTC_8x5_SRGB_BLOCK;
	case TinyImageFormat_ASTC_8x6_UNORM: return TIF_VK_FORMAT_ASTC_8x6_UNORM_BLOCK;
	case TinyImageFormat_ASTC_8x6_SRGB: return TIF_VK_FORMAT_ASTC_8x6_SRGB_BLOCK;
	case TinyImageFormat_ASTC_8x8_UNORM: return TIF_VK_FORMAT_ASTC_8x8_UNORM_BLOCK;
	case TinyImageFormat_ASTC_8x8_SRGB: return TIF_VK_FORMAT_ASTC_8x8_SRGB_BLOCK;
	case TinyImageFormat_ASTC_10x5_UNORM: return TIF_VK_FORMAT_ASTC_10x5_UNORM_BLOCK;
	case TinyImageFormat_ASTC_10x5_SRGB: return TIF_VK_FORMAT_ASTC_10x5_SRGB_BLOCK;
	case TinyImageFormat_ASTC_10x6_UNORM: return TIF_VK_FORMAT_ASTC_10x6_UNORM_BLOCK;
	case TinyImageFormat_ASTC_10x6_SRGB: return TIF_VK_FORMAT_ASTC_10x6_SRGB_BLOCK;
	case TinyImageFormat_ASTC_10x8_UNORM: return TIF_VK_FORMAT_ASTC_10x8_UNORM_BLOCK;
	case TinyImageFormat_ASTC_10x8_SRGB: return TIF_VK_FORMAT_ASTC_10x8_SRGB_BLOCK;
	case TinyImageFormat_ASTC_10x10_UNORM: return TIF_VK_FORMAT_ASTC_10x10_UNORM_BLOCK;
	case TinyImageFormat_ASTC_10x10_SRGB: return TIF_VK_FORMAT_ASTC_10x10_SRGB_BLOCK;
	case TinyImageFormat_ASTC_12x10_UNORM: return TIF_VK_FORMAT_ASTC_12x10_UNORM_BLOCK;
	case TinyImageFormat_ASTC_12x10_SRGB: return TIF_VK_FORMAT_ASTC_12x10_SRGB_BLOCK;
	case TinyImageFormat_ASTC_12x12_UNORM: return TIF_VK_FORMAT_ASTC_12x12_UNORM_BLOCK;
	case TinyImageFormat_ASTC_12x12_SRGB: return TIF_VK_FORMAT_ASTC_12x12_SRGB_BLOCK;
	case TinyImageFormat_PVRTC2_2BPP_UNORM: return TIF_VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG;
	case TinyImageFormat_PVRTC2_4BPP_UNORM: return TIF_VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG;
	case TinyImageFormat_PVRTC2_2BPP_SRGB: return TIF_VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG;
	case TinyImageFormat_PVRTC2_4BPP_SRGB: return TIF_VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG;

	default: return TIF_VK_FORMAT_UNDEFINED;
	}
}

#ifndef TINYIMAGEFORMAT_DXGIFORMAT
#define TINYIMAGEFORMAT_DXGIFORMAT

typedef enum TinyImageFormat_DXGI_FORMAT {

	TIF_DXGI_FORMAT_UNKNOWN = 0,
	TIF_DXGI_FORMAT_R32G32B32A32_TYPELESS = 1,
	TIF_DXGI_FORMAT_R32G32B32A32_FLOAT = 2,
	TIF_DXGI_FORMAT_R32G32B32A32_UINT = 3,
	TIF_DXGI_FORMAT_R32G32B32A32_SINT = 4,
	TIF_DXGI_FORMAT_R32G32B32_TYPELESS = 5,
	TIF_DXGI_FORMAT_R32G32B32_FLOAT = 6,
	TIF_DXGI_FORMAT_R32G32B32_UINT = 7,
	TIF_DXGI_FORMAT_R32G32B32_SINT = 8,
	TIF_DXGI_FORMAT_R16G16B16A16_TYPELESS = 9,
	TIF_DXGI_FORMAT_R16G16B16A16_FLOAT  = 10,
	TIF_DXGI_FORMAT_R16G16B16A16_UNORM = 11,
	TIF_DXGI_FORMAT_R16G16B16A16_UINT = 12,
	TIF_DXGI_FORMAT_R16G16B16A16_SNORM = 13,
	TIF_DXGI_FORMAT_R16G16B16A16_SINT = 14,
	TIF_DXGI_FORMAT_R32G32_TYPELESS = 15,
	TIF_DXGI_FORMAT_R32G32_FLOAT = 16,
	TIF_DXGI_FORMAT_R32G32_UINT = 17,
	TIF_DXGI_FORMAT_R32G32_SINT = 18,
	TIF_DXGI_FORMAT_R32G8X24_TYPELESS = 19,
	TIF_DXGI_FORMAT_D32_FLOAT_S8X24_UINT = 20,
	TIF_DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS = 21,
	TIF_DXGI_FORMAT_X32_TYPELESS_G8X24_UINT = 22,
	TIF_DXGI_FORMAT_R10G10B10A2_TYPELESS = 23,
	TIF_DXGI_FORMAT_R10G10B10A2_UNORM = 24,
	TIF_DXGI_FORMAT_R10G10B10A2_UINT = 25,
	TIF_DXGI_FORMAT_R11G11B10_FLOAT = 26,
	TIF_DXGI_FORMAT_R8G8B8A8_TYPELESS = 27,
	TIF_DXGI_FORMAT_R8G8B8A8_UNORM = 28,
	TIF_DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 29,
	TIF_DXGI_FORMAT_R8G8B8A8_UINT = 30,
	TIF_DXGI_FORMAT_R8G8B8A8_SNORM = 31,
	TIF_DXGI_FORMAT_R8G8B8A8_SINT = 32,
	TIF_DXGI_FORMAT_R16G16_TYPELESS = 33,
	TIF_DXGI_FORMAT_R16G16_FLOAT = 34,
	TIF_DXGI_FORMAT_R16G16_UNORM = 35,
	TIF_DXGI_FORMAT_R16G16_UINT = 36,
	TIF_DXGI_FORMAT_R16G16_SNORM = 37,
	TIF_DXGI_FORMAT_R16G16_SINT = 38,
	TIF_DXGI_FORMAT_R32_TYPELESS = 39,
	TIF_DXGI_FORMAT_D32_FLOAT = 40,
	TIF_DXGI_FORMAT_R32_FLOAT = 41,
	TIF_DXGI_FORMAT_R32_UINT = 42,
	TIF_DXGI_FORMAT_R32_SINT = 43,
	TIF_DXGI_FORMAT_R24G8_TYPELESS = 44,
	TIF_DXGI_FORMAT_D24_UNORM_S8_UINT = 45,
	TIF_DXGI_FORMAT_R24_UNORM_X8_TYPELESS = 46,
	TIF_DXGI_FORMAT_X24_TYPELESS_G8_UINT = 47,
	TIF_DXGI_FORMAT_R8G8_TYPELESS = 48,
	TIF_DXGI_FORMAT_R8G8_UNORM = 49,
	TIF_DXGI_FORMAT_R8G8_UINT = 50,
	TIF_DXGI_FORMAT_R8G8_SNORM = 51,
	TIF_DXGI_FORMAT_R8G8_SINT = 52,
	TIF_DXGI_FORMAT_R16_TYPELESS = 53,
	TIF_DXGI_FORMAT_R16_FLOAT = 54,
	TIF_DXGI_FORMAT_D16_UNORM = 55,
	TIF_DXGI_FORMAT_R16_UNORM = 56,
	TIF_DXGI_FORMAT_R16_UINT = 57,
	TIF_DXGI_FORMAT_R16_SNORM = 58,
	TIF_DXGI_FORMAT_R16_SINT = 59,
	TIF_DXGI_FORMAT_R8_TYPELESS = 60,
	TIF_DXGI_FORMAT_R8_UNORM = 61,
	TIF_DXGI_FORMAT_R8_UINT = 62,
	TIF_DXGI_FORMAT_R8_SNORM = 63,
	TIF_DXGI_FORMAT_R8_SINT = 64,
	TIF_DXGI_FORMAT_A8_UNORM = 65,
	TIF_DXGI_FORMAT_R1_UNORM = 66,
	TIF_DXGI_FORMAT_R9G9B9E5_SHAREDEXP = 67,
	TIF_DXGI_FORMAT_R8G8_B8G8_UNORM = 68,
	TIF_DXGI_FORMAT_G8R8_G8B8_UNORM = 69,
	TIF_DXGI_FORMAT_BC1_TYPELESS = 70,
	TIF_DXGI_FORMAT_BC1_UNORM = 71,
	TIF_DXGI_FORMAT_BC1_UNORM_SRGB = 72,
	TIF_DXGI_FORMAT_BC2_TYPELESS = 73,
	TIF_DXGI_FORMAT_BC2_UNORM = 74,
	TIF_DXGI_FORMAT_BC2_UNORM_SRGB = 75,
	TIF_DXGI_FORMAT_BC3_TYPELESS = 76,
	TIF_DXGI_FORMAT_BC3_UNORM = 77,
	TIF_DXGI_FORMAT_BC3_UNORM_SRGB = 78,
	TIF_DXGI_FORMAT_BC4_TYPELESS = 79,
	TIF_DXGI_FORMAT_BC4_UNORM = 80,
	TIF_DXGI_FORMAT_BC4_SNORM = 81,
	TIF_DXGI_FORMAT_BC5_TYPELESS = 82,
	TIF_DXGI_FORMAT_BC5_UNORM = 83,
	TIF_DXGI_FORMAT_BC5_SNORM = 84,
	TIF_DXGI_FORMAT_B5G6R5_UNORM = 85,
	TIF_DXGI_FORMAT_B5G5R5A1_UNORM = 86,
	TIF_DXGI_FORMAT_B8G8R8A8_UNORM = 87,
	TIF_DXGI_FORMAT_B8G8R8X8_UNORM = 88,
	TIF_DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM = 89,
	TIF_DXGI_FORMAT_B8G8R8A8_TYPELESS = 90,
	TIF_DXGI_FORMAT_B8G8R8A8_UNORM_SRGB = 91,
	TIF_DXGI_FORMAT_B8G8R8X8_TYPELESS = 92,
	TIF_DXGI_FORMAT_B8G8R8X8_UNORM_SRGB = 93,
	TIF_DXGI_FORMAT_BC6H_TYPELESS = 94,
	TIF_DXGI_FORMAT_BC6H_UF16 = 95,
	TIF_DXGI_FORMAT_BC6H_SF16 = 96,
	TIF_DXGI_FORMAT_BC7_TYPELESS = 97,
	TIF_DXGI_FORMAT_BC7_UNORM = 98,
	TIF_DXGI_FORMAT_BC7_UNORM_SRGB = 99,
	TIF_DXGI_FORMAT_AYUV = 100,
	TIF_DXGI_FORMAT_Y410 = 101,
	TIF_DXGI_FORMAT_Y416 = 102,
	TIF_DXGI_FORMAT_NV12 = 103,
	TIF_DXGI_FORMAT_P010 = 104,
	TIF_DXGI_FORMAT_P016 = 105,
	TIF_DXGI_FORMAT_420_OPAQUE = 106,
	TIF_DXGI_FORMAT_YUY2 = 107,
	TIF_DXGI_FORMAT_Y210 = 108,
	TIF_DXGI_FORMAT_Y216 = 109,
	TIF_DXGI_FORMAT_NV11 = 110,
	TIF_DXGI_FORMAT_AI44 = 111,
	TIF_DXGI_FORMAT_IA44 = 112,
	TIF_DXGI_FORMAT_P8 = 113,
	TIF_DXGI_FORMAT_A8P8 = 114,
	TIF_DXGI_FORMAT_B4G4R4A4_UNORM = 115,

	// ASTC Format
	TIF_DXGI_FORMAT_ASTC_4X4_TYPELESS = 133,
	TIF_DXGI_FORMAT_ASTC_4X4_UNORM = 134,
	TIF_DXGI_FORMAT_ASTC_4X4_UNORM_SRGB = 135,
	TIF_DXGI_FORMAT_ASTC_5X4_TYPELESS = 137,
	TIF_DXGI_FORMAT_ASTC_5X4_UNORM = 138,
	TIF_DXGI_FORMAT_ASTC_5X4_UNORM_SRGB = 139,
	TIF_DXGI_FORMAT_ASTC_5X5_TYPELESS = 141,
	TIF_DXGI_FORMAT_ASTC_5X5_UNORM = 142,
	TIF_DXGI_FORMAT_ASTC_5X5_UNORM_SRGB = 143,
	TIF_DXGI_FORMAT_ASTC_6X5_TYPELESS = 145,
	TIF_DXGI_FORMAT_ASTC_6X5_UNORM = 146,
	TIF_DXGI_FORMAT_ASTC_6X5_UNORM_SRGB = 147,
	TIF_DXGI_FORMAT_ASTC_6X6_TYPELESS = 149,
	TIF_DXGI_FORMAT_ASTC_6X6_UNORM = 150,
	TIF_DXGI_FORMAT_ASTC_6X6_UNORM_SRGB = 151,
	TIF_DXGI_FORMAT_ASTC_8X5_TYPELESS = 153,
	TIF_DXGI_FORMAT_ASTC_8X5_UNORM = 154,
	TIF_DXGI_FORMAT_ASTC_8X5_UNORM_SRGB = 155,
	TIF_DXGI_FORMAT_ASTC_8X6_TYPELESS = 157,
	TIF_DXGI_FORMAT_ASTC_8X6_UNORM = 158,
	TIF_DXGI_FORMAT_ASTC_8X6_UNORM_SRGB = 159,
	TIF_DXGI_FORMAT_ASTC_8X8_TYPELESS = 161,
	TIF_DXGI_FORMAT_ASTC_8X8_UNORM = 162,
	TIF_DXGI_FORMAT_ASTC_8X8_UNORM_SRGB = 163,
	TIF_DXGI_FORMAT_ASTC_10X5_TYPELESS = 165,
	TIF_DXGI_FORMAT_ASTC_10X5_UNORM = 166,
	TIF_DXGI_FORMAT_ASTC_10X5_UNORM_SRGB = 167,
	TIF_DXGI_FORMAT_ASTC_10X6_TYPELESS = 169,
	TIF_DXGI_FORMAT_ASTC_10X6_UNORM = 170,
	TIF_DXGI_FORMAT_ASTC_10X6_UNORM_SRGB = 171,
	TIF_DXGI_FORMAT_ASTC_10X8_TYPELESS = 173,
	TIF_DXGI_FORMAT_ASTC_10X8_UNORM = 174,
	TIF_DXGI_FORMAT_ASTC_10X8_UNORM_SRGB = 175,
	TIF_DXGI_FORMAT_ASTC_10X10_TYPELESS = 177,
	TIF_DXGI_FORMAT_ASTC_10X10_UNORM = 178,
	TIF_DXGI_FORMAT_ASTC_10X10_UNORM_SRGB = 179,
	TIF_DXGI_FORMAT_ASTC_12X10_TYPELESS = 181,
	TIF_DXGI_FORMAT_ASTC_12X10_UNORM = 182,
	TIF_DXGI_FORMAT_ASTC_12X10_UNORM_SRGB = 183,
	TIF_DXGI_FORMAT_ASTC_12X12_TYPELESS = 185,
	TIF_DXGI_FORMAT_ASTC_12X12_UNORM = 186,
	TIF_DXGI_FORMAT_ASTC_12X12_UNORM_SRGB = 187,

	// xbox 360 formats
	TIF_DXGI_FORMAT_R10G10B10_7E3_A2_FLOAT = 116,
	TIF_DXGI_FORMAT_R10G10B10_6E4_A2_FLOAT = 117,
	TIF_DXGI_FORMAT_D16_UNORM_S8_UINT = 118,
	TIF_DXGI_FORMAT_R16_UNORM_X8_TYPELESS = 119,
	TIF_DXGI_FORMAT_X16_TYPELESS_G8_UINT = 120,

	TIF_DXGI_FORMAT_P208 = 130,
	TIF_DXGI_FORMAT_V208 = 131,
	TIF_DXGI_FORMAT_V408 = 132,

	// XBox One formats
	TIF_DXGI_FORMAT_R10G10B10_SNORM_A2_UNORM = 189,
	TIF_DXGI_FORMAT_R4G4_UNORM = 190,

} TinyImageFormat_DXGI_FORMAT;
#endif


inline TinyImageFormat TinyImageFormat_FromDXGI_FORMAT(TinyImageFormat_DXGI_FORMAT fmt) {
	switch (fmt) {
	case TIF_DXGI_FORMAT_UNKNOWN: return TinyImageFormat_UNDEFINED;
	case TIF_DXGI_FORMAT_R32G32B32A32_FLOAT: return TinyImageFormat_R32G32B32A32_SFLOAT;
	case TIF_DXGI_FORMAT_R32G32B32A32_UINT: return TinyImageFormat_R32G32B32A32_UINT;
	case TIF_DXGI_FORMAT_R32G32B32A32_SINT: return TinyImageFormat_R32G32B32A32_SINT;
	case TIF_DXGI_FORMAT_R32G32B32_FLOAT: return TinyImageFormat_R32G32B32_SFLOAT;
	case TIF_DXGI_FORMAT_R32G32B32_UINT: return TinyImageFormat_R32G32B32_UINT;
	case TIF_DXGI_FORMAT_R32G32B32_SINT: return TinyImageFormat_R32G32B32_SINT;
	case TIF_DXGI_FORMAT_R16G16B16A16_FLOAT: return TinyImageFormat_R16G16B16A16_SFLOAT;
	case TIF_DXGI_FORMAT_R16G16B16A16_UNORM: return TinyImageFormat_R16G16B16A16_UNORM;
	case TIF_DXGI_FORMAT_R16G16B16A16_UINT: return TinyImageFormat_R16G16B16A16_UINT;
	case TIF_DXGI_FORMAT_R16G16B16A16_SNORM: return TinyImageFormat_R16G16B16A16_SNORM;
	case TIF_DXGI_FORMAT_R16G16B16A16_SINT: return TinyImageFormat_R16G16B16A16_SINT;
	case TIF_DXGI_FORMAT_R32G32_FLOAT: return TinyImageFormat_R32G32_SFLOAT;
	case TIF_DXGI_FORMAT_R32G32_UINT: return TinyImageFormat_R32G32_UINT;
	case TIF_DXGI_FORMAT_R32G32_SINT: return TinyImageFormat_R32G32_SINT;
	case TIF_DXGI_FORMAT_D32_FLOAT_S8X24_UINT: return TinyImageFormat_D32_SFLOAT_S8_UINT;
	case TIF_DXGI_FORMAT_R10G10B10A2_UNORM: return TinyImageFormat_R10G10B10A2_UNORM;
	case TIF_DXGI_FORMAT_R10G10B10A2_UINT: return TinyImageFormat_R10G10B10A2_UINT;
	case TIF_DXGI_FORMAT_R11G11B10_FLOAT: return TinyImageFormat_B10G11R11_UFLOAT; // WRONG!
	case TIF_DXGI_FORMAT_R8G8B8A8_UNORM: return TinyImageFormat_R8G8B8A8_UNORM;
	case TIF_DXGI_FORMAT_R16G16_FLOAT: return TinyImageFormat_R16G16_SFLOAT;
	case TIF_DXGI_FORMAT_R16G16_UNORM: return TinyImageFormat_R16G16_UNORM;
	case TIF_DXGI_FORMAT_R16G16_UINT: return TinyImageFormat_R16G16_UINT;
	case TIF_DXGI_FORMAT_R16G16_SNORM: return TinyImageFormat_R16G16_SNORM;
	case TIF_DXGI_FORMAT_R16G16_SINT: return TinyImageFormat_R16G16_SINT;
	case TIF_DXGI_FORMAT_D32_FLOAT: return TinyImageFormat_D32_SFLOAT;
	case TIF_DXGI_FORMAT_R32_FLOAT: return TinyImageFormat_R32_SFLOAT;
	case TIF_DXGI_FORMAT_R32_UINT: return TinyImageFormat_R32_UINT;
	case TIF_DXGI_FORMAT_R32_SINT: return TinyImageFormat_R32_SINT;
	case TIF_DXGI_FORMAT_D24_UNORM_S8_UINT: return TinyImageFormat_D24_UNORM_S8_UINT;
	case TIF_DXGI_FORMAT_X24_TYPELESS_G8_UINT: return TinyImageFormat_D24_UNORM_S8_UINT;
	case TIF_DXGI_FORMAT_R8G8_UNORM: return TinyImageFormat_R8G8_UNORM;
	case TIF_DXGI_FORMAT_R8G8_UINT: return TinyImageFormat_R8G8_UINT;
	case TIF_DXGI_FORMAT_R8G8_SNORM: return TinyImageFormat_R8G8_SNORM;
	case TIF_DXGI_FORMAT_R8G8_SINT: return TinyImageFormat_R8G8_SINT;
	case TIF_DXGI_FORMAT_R16_FLOAT: return TinyImageFormat_R16_SFLOAT;
	case TIF_DXGI_FORMAT_D16_UNORM: return TinyImageFormat_D16_UNORM;
	case TIF_DXGI_FORMAT_R16_UNORM: return TinyImageFormat_R16_UNORM;
	case TIF_DXGI_FORMAT_R16_UINT: return TinyImageFormat_R16_UINT;
	case TIF_DXGI_FORMAT_R16_SNORM: return TinyImageFormat_R16_SNORM;
	case TIF_DXGI_FORMAT_R16_SINT: return TinyImageFormat_R16_SINT;
	case TIF_DXGI_FORMAT_R8_UNORM: return TinyImageFormat_R8_UNORM;
	case TIF_DXGI_FORMAT_R8_UINT: return TinyImageFormat_R8_UINT;
	case TIF_DXGI_FORMAT_R8_SNORM: return TinyImageFormat_R8_SNORM;
	case TIF_DXGI_FORMAT_R8_SINT: return TinyImageFormat_R8_SINT;
	case TIF_DXGI_FORMAT_A8_UNORM: return TinyImageFormat_A8_UNORM;
	case TIF_DXGI_FORMAT_R9G9B9E5_SHAREDEXP: return TinyImageFormat_E5B9G9R9_UFLOAT;
	case TIF_DXGI_FORMAT_BC1_UNORM: return TinyImageFormat_DXBC1_RGBA_UNORM;
	case TIF_DXGI_FORMAT_BC1_UNORM_SRGB: return TinyImageFormat_DXBC1_RGBA_SRGB;
	case TIF_DXGI_FORMAT_BC2_UNORM: return TinyImageFormat_DXBC2_UNORM;
	case TIF_DXGI_FORMAT_BC2_UNORM_SRGB: return TinyImageFormat_DXBC2_SRGB;
	case TIF_DXGI_FORMAT_BC3_UNORM: return TinyImageFormat_DXBC3_UNORM;
	case TIF_DXGI_FORMAT_BC3_UNORM_SRGB: return TinyImageFormat_DXBC3_SRGB;
	case TIF_DXGI_FORMAT_BC4_UNORM: return TinyImageFormat_DXBC4_UNORM;
	case TIF_DXGI_FORMAT_BC4_SNORM: return TinyImageFormat_DXBC4_SNORM;
	case TIF_DXGI_FORMAT_BC5_UNORM: return TinyImageFormat_DXBC5_UNORM;
	case TIF_DXGI_FORMAT_BC5_SNORM: return TinyImageFormat_DXBC5_SNORM;
	case TIF_DXGI_FORMAT_B5G6R5_UNORM: return TinyImageFormat_R5G6B5_UNORM;
	case TIF_DXGI_FORMAT_B5G5R5A1_UNORM: return TinyImageFormat_R5G5B5A1_UNORM;
	case TIF_DXGI_FORMAT_B8G8R8A8_UNORM: return TinyImageFormat_B8G8R8A8_UNORM;
	case TIF_DXGI_FORMAT_B8G8R8X8_UNORM: return TinyImageFormat_B8G8R8X8_UNORM;
	case TIF_DXGI_FORMAT_B8G8R8A8_UNORM_SRGB: return TinyImageFormat_B8G8R8A8_SRGB;
	case TIF_DXGI_FORMAT_B8G8R8X8_UNORM_SRGB: return TinyImageFormat_B8G8R8A8_SRGB; // WRONG should be X8
	case TIF_DXGI_FORMAT_BC6H_UF16: return TinyImageFormat_DXBC6H_UFLOAT;
	case TIF_DXGI_FORMAT_BC6H_SF16: return TinyImageFormat_DXBC6H_SFLOAT;
	case TIF_DXGI_FORMAT_BC7_UNORM: return TinyImageFormat_DXBC7_UNORM;
	case TIF_DXGI_FORMAT_BC7_UNORM_SRGB: return TinyImageFormat_DXBC7_SRGB;
	case TIF_DXGI_FORMAT_B4G4R4A4_UNORM: return TinyImageFormat_B4G4R4A4_UNORM;
	case TIF_DXGI_FORMAT_R8G8B8A8_UNORM_SRGB: return TinyImageFormat_R8G8B8A8_SRGB;
	case TIF_DXGI_FORMAT_R8G8B8A8_UINT: return TinyImageFormat_R8G8B8A8_UINT;
	case TIF_DXGI_FORMAT_R8G8B8A8_SNORM: return TinyImageFormat_R8G8B8A8_SNORM;
	case TIF_DXGI_FORMAT_R8G8B8A8_SINT: return TinyImageFormat_R8G8B8A8_SINT;
	case TIF_DXGI_FORMAT_R4G4_UNORM: return TinyImageFormat_R4G4_UNORM;
	case TIF_DXGI_FORMAT_R1_UNORM: return TinyImageFormat_R1_UNORM;

	case TIF_DXGI_FORMAT_420_OPAQUE: return TinyImageFormat_G8_B8_R8_3PLANE_420_UNORM;
	case TIF_DXGI_FORMAT_AYUV: return TinyImageFormat_B8G8R8A8_UNORM;
	case TIF_DXGI_FORMAT_Y410: return TinyImageFormat_A2B10G10R10_UNORM;
	case TIF_DXGI_FORMAT_Y416: return TinyImageFormat_R16G16B16A16_UNORM;
	case TIF_DXGI_FORMAT_NV12: return TinyImageFormat_G8_B8R8_2PLANE_420_UNORM;
	case TIF_DXGI_FORMAT_P010: return TinyImageFormat_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16;
	case TIF_DXGI_FORMAT_P016: return TinyImageFormat_G16_B16R16_2PLANE_420_UNORM;
	case TIF_DXGI_FORMAT_YUY2: return TinyImageFormat_G8B8G8R8_422_UNORM;
	case TIF_DXGI_FORMAT_Y210: return TinyImageFormat_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16;	
	case TIF_DXGI_FORMAT_Y216: return TinyImageFormat_G16B16G16R16_422_UNORM;
	case TIF_DXGI_FORMAT_P208: return TinyImageFormat_G8_B8R8_2PLANE_422_UNORM;

	// ASTC
	case TIF_DXGI_FORMAT_ASTC_4X4_UNORM		   :  return  TinyImageFormat_ASTC_4x4_UNORM;	
	case TIF_DXGI_FORMAT_ASTC_4X4_UNORM_SRGB   :  return  TinyImageFormat_ASTC_4x4_SRGB;		
	case TIF_DXGI_FORMAT_ASTC_5X4_UNORM		   :  return  TinyImageFormat_ASTC_5x4_UNORM;	
	case TIF_DXGI_FORMAT_ASTC_5X4_UNORM_SRGB   :  return  TinyImageFormat_ASTC_5x4_SRGB;		
	case TIF_DXGI_FORMAT_ASTC_5X5_UNORM		   :  return  TinyImageFormat_ASTC_5x5_UNORM;	
	case TIF_DXGI_FORMAT_ASTC_5X5_UNORM_SRGB   :  return  TinyImageFormat_ASTC_5x5_SRGB;		
	case TIF_DXGI_FORMAT_ASTC_6X5_UNORM		   :  return  TinyImageFormat_ASTC_6x5_UNORM;	
	case TIF_DXGI_FORMAT_ASTC_6X5_UNORM_SRGB   :  return  TinyImageFormat_ASTC_6x5_SRGB;		
	case TIF_DXGI_FORMAT_ASTC_6X6_UNORM		   :  return  TinyImageFormat_ASTC_6x6_UNORM;	
	case TIF_DXGI_FORMAT_ASTC_6X6_UNORM_SRGB   :  return  TinyImageFormat_ASTC_6x6_SRGB;		
	case TIF_DXGI_FORMAT_ASTC_8X5_UNORM		   :  return  TinyImageFormat_ASTC_8x5_UNORM;	
	case TIF_DXGI_FORMAT_ASTC_8X5_UNORM_SRGB   :  return  TinyImageFormat_ASTC_8x5_SRGB;		
	case TIF_DXGI_FORMAT_ASTC_8X6_UNORM		   :  return  TinyImageFormat_ASTC_8x6_UNORM;	
	case TIF_DXGI_FORMAT_ASTC_8X6_UNORM_SRGB   :  return  TinyImageFormat_ASTC_8x6_SRGB;		
	case TIF_DXGI_FORMAT_ASTC_8X8_UNORM		   :  return  TinyImageFormat_ASTC_8x8_UNORM;	
	case TIF_DXGI_FORMAT_ASTC_8X8_UNORM_SRGB   :  return  TinyImageFormat_ASTC_8x8_SRGB;		
	case TIF_DXGI_FORMAT_ASTC_10X5_UNORM	   :  return  TinyImageFormat_ASTC_10x5_UNORM;	
	case TIF_DXGI_FORMAT_ASTC_10X5_UNORM_SRGB  :  return  TinyImageFormat_ASTC_10x5_SRGB;	
	case TIF_DXGI_FORMAT_ASTC_10X6_UNORM	   :  return  TinyImageFormat_ASTC_10x6_UNORM;	
	case TIF_DXGI_FORMAT_ASTC_10X6_UNORM_SRGB  :  return  TinyImageFormat_ASTC_10x6_SRGB;	
	case TIF_DXGI_FORMAT_ASTC_10X8_UNORM	   :  return  TinyImageFormat_ASTC_10x8_UNORM;	
	case TIF_DXGI_FORMAT_ASTC_10X8_UNORM_SRGB  :  return  TinyImageFormat_ASTC_10x8_SRGB;	
	case TIF_DXGI_FORMAT_ASTC_10X10_UNORM	   :  return  TinyImageFormat_ASTC_10x10_UNORM;	
	case TIF_DXGI_FORMAT_ASTC_10X10_UNORM_SRGB :  return  TinyImageFormat_ASTC_10x10_SRGB;	
	case TIF_DXGI_FORMAT_ASTC_12X10_UNORM	   :  return  TinyImageFormat_ASTC_12x10_UNORM;	
	case TIF_DXGI_FORMAT_ASTC_12X10_UNORM_SRGB :  return  TinyImageFormat_ASTC_12x10_SRGB;	
	case TIF_DXGI_FORMAT_ASTC_12X12_UNORM	   :  return  TinyImageFormat_ASTC_12x12_UNORM;	
	case TIF_DXGI_FORMAT_ASTC_12X12_UNORM_SRGB :  return  TinyImageFormat_ASTC_12x12_SRGB;	

	case TIF_DXGI_FORMAT_ASTC_4X4_TYPELESS:
	case TIF_DXGI_FORMAT_ASTC_5X4_TYPELESS:									  
	case TIF_DXGI_FORMAT_ASTC_5X5_TYPELESS:
	case TIF_DXGI_FORMAT_ASTC_6X5_TYPELESS:
	case TIF_DXGI_FORMAT_ASTC_6X6_TYPELESS:
	case TIF_DXGI_FORMAT_ASTC_8X6_TYPELESS:
	case TIF_DXGI_FORMAT_ASTC_8X5_TYPELESS:
	case TIF_DXGI_FORMAT_ASTC_8X8_TYPELESS:
	case TIF_DXGI_FORMAT_ASTC_10X5_TYPELESS:
	case TIF_DXGI_FORMAT_ASTC_10X6_TYPELESS:
	case TIF_DXGI_FORMAT_ASTC_10X8_TYPELESS:
	case TIF_DXGI_FORMAT_ASTC_10X10_TYPELESS:
	case TIF_DXGI_FORMAT_ASTC_12X10_TYPELESS:
	case TIF_DXGI_FORMAT_ASTC_12X12_TYPELESS:

	case TIF_DXGI_FORMAT_R32G32B32A32_TYPELESS:
	case TIF_DXGI_FORMAT_R32G32B32_TYPELESS:
	case TIF_DXGI_FORMAT_R16G16B16A16_TYPELESS:
	case TIF_DXGI_FORMAT_R32G32_TYPELESS:
	case TIF_DXGI_FORMAT_R32G8X24_TYPELESS:
	case TIF_DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS:
	case TIF_DXGI_FORMAT_X32_TYPELESS_G8X24_UINT:
	case TIF_DXGI_FORMAT_R10G10B10A2_TYPELESS:
	case TIF_DXGI_FORMAT_R8G8B8A8_TYPELESS:
	case TIF_DXGI_FORMAT_R16G16_TYPELESS:
	case TIF_DXGI_FORMAT_R32_TYPELESS:
	case TIF_DXGI_FORMAT_R24G8_TYPELESS:
	case TIF_DXGI_FORMAT_R24_UNORM_X8_TYPELESS:
	case TIF_DXGI_FORMAT_R8G8_TYPELESS:
	case TIF_DXGI_FORMAT_R16_TYPELESS:
	case TIF_DXGI_FORMAT_R8_TYPELESS:
	case TIF_DXGI_FORMAT_BC1_TYPELESS:
	case TIF_DXGI_FORMAT_BC2_TYPELESS:
	case TIF_DXGI_FORMAT_BC3_TYPELESS:
	case TIF_DXGI_FORMAT_BC4_TYPELESS:
	case TIF_DXGI_FORMAT_BC5_TYPELESS:
	case TIF_DXGI_FORMAT_B8G8R8A8_TYPELESS:
	case TIF_DXGI_FORMAT_B8G8R8X8_TYPELESS:
	case TIF_DXGI_FORMAT_BC6H_TYPELESS:
	case TIF_DXGI_FORMAT_BC7_TYPELESS:
	case TIF_DXGI_FORMAT_NV11:
	case TIF_DXGI_FORMAT_AI44:
	case TIF_DXGI_FORMAT_IA44:
	case TIF_DXGI_FORMAT_P8:
	case TIF_DXGI_FORMAT_A8P8:
	case TIF_DXGI_FORMAT_V208:
	case TIF_DXGI_FORMAT_V408:
	case TIF_DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM:
	case TIF_DXGI_FORMAT_R8G8_B8G8_UNORM:
	case TIF_DXGI_FORMAT_G8R8_G8B8_UNORM:
	case TIF_DXGI_FORMAT_R10G10B10_7E3_A2_FLOAT:
	case TIF_DXGI_FORMAT_R10G10B10_6E4_A2_FLOAT:
	case TIF_DXGI_FORMAT_D16_UNORM_S8_UINT:
	case TIF_DXGI_FORMAT_R16_UNORM_X8_TYPELESS:
	case TIF_DXGI_FORMAT_X16_TYPELESS_G8_UINT:
	case TIF_DXGI_FORMAT_R10G10B10_SNORM_A2_UNORM:
		return TinyImageFormat_UNDEFINED;
	}
	return TinyImageFormat_UNDEFINED;
}

inline TinyImageFormat_DXGI_FORMAT TinyImageFormat_ToDXGI_FORMAT(TinyImageFormat fmt) {
	switch (fmt) {
	case TinyImageFormat_R1_UNORM: return TIF_DXGI_FORMAT_R1_UNORM;
	case TinyImageFormat_R4G4_UNORM: return TIF_DXGI_FORMAT_R4G4_UNORM;
	case TinyImageFormat_R5G6B5_UNORM: return TIF_DXGI_FORMAT_B5G6R5_UNORM;
	case TinyImageFormat_B5G6R5_UNORM: return TIF_DXGI_FORMAT_B5G6R5_UNORM;
	case TinyImageFormat_B5G5R5A1_UNORM: return TIF_DXGI_FORMAT_B5G5R5A1_UNORM;
	case TinyImageFormat_R8_UNORM: return TIF_DXGI_FORMAT_R8_UNORM;
	case TinyImageFormat_R8_SNORM: return TIF_DXGI_FORMAT_R8_SNORM;
	case TinyImageFormat_R8_UINT: return TIF_DXGI_FORMAT_R8_UINT;
	case TinyImageFormat_R8_SINT: return TIF_DXGI_FORMAT_R8_SINT;
	case TinyImageFormat_R8G8_UNORM: return TIF_DXGI_FORMAT_R8G8_UNORM;
	case TinyImageFormat_R8G8_SNORM: return TIF_DXGI_FORMAT_R8G8_SNORM;
	case TinyImageFormat_R8G8_UINT: return TIF_DXGI_FORMAT_R8G8_UINT;
	case TinyImageFormat_R8G8_SINT: return TIF_DXGI_FORMAT_R8G8_SINT;
	case TinyImageFormat_B4G4R4A4_UNORM: return TIF_DXGI_FORMAT_B4G4R4A4_UNORM;

	case TinyImageFormat_R8G8B8A8_UNORM: return TIF_DXGI_FORMAT_R8G8B8A8_UNORM;
	case TinyImageFormat_R8G8B8A8_SNORM: return TIF_DXGI_FORMAT_R8G8B8A8_SNORM;
	case TinyImageFormat_R8G8B8A8_UINT: return TIF_DXGI_FORMAT_R8G8B8A8_UINT;
	case TinyImageFormat_R8G8B8A8_SINT: return TIF_DXGI_FORMAT_R8G8B8A8_SINT;
	case TinyImageFormat_R8G8B8A8_SRGB: return TIF_DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;

	case TinyImageFormat_B8G8R8A8_UNORM: return TIF_DXGI_FORMAT_B8G8R8A8_UNORM;
	case TinyImageFormat_B8G8R8X8_UNORM: return TIF_DXGI_FORMAT_B8G8R8X8_UNORM;
	case TinyImageFormat_B8G8R8A8_SRGB: return TIF_DXGI_FORMAT_B8G8R8A8_UNORM_SRGB;

	case TinyImageFormat_R10G10B10A2_UNORM: return TIF_DXGI_FORMAT_R10G10B10A2_UNORM;
	case TinyImageFormat_B10G10R10A2_UNORM: return TIF_DXGI_FORMAT_R10G10B10A2_UNORM;
	case TinyImageFormat_R10G10B10A2_UINT: return TIF_DXGI_FORMAT_R10G10B10A2_UINT;
	case TinyImageFormat_B10G10R10A2_UINT: return TIF_DXGI_FORMAT_R10G10B10A2_UINT;

	case TinyImageFormat_R16_UNORM: return TIF_DXGI_FORMAT_R16_UNORM;
	case TinyImageFormat_R16_SNORM: return TIF_DXGI_FORMAT_R16_SNORM;
	case TinyImageFormat_R16_UINT: return TIF_DXGI_FORMAT_R16_UINT;
	case TinyImageFormat_R16_SINT: return TIF_DXGI_FORMAT_R16_SINT;
	case TinyImageFormat_R16_SFLOAT: return TIF_DXGI_FORMAT_R16_FLOAT;
	case TinyImageFormat_R16G16_UNORM: return TIF_DXGI_FORMAT_R16G16_UNORM;
	case TinyImageFormat_R16G16_SNORM: return TIF_DXGI_FORMAT_R16G16_SNORM;
	case TinyImageFormat_R16G16_UINT: return TIF_DXGI_FORMAT_R16G16_UINT;
	case TinyImageFormat_R16G16_SINT: return TIF_DXGI_FORMAT_R16G16_SINT;
	case TinyImageFormat_R16G16_SFLOAT: return TIF_DXGI_FORMAT_R16G16_FLOAT;
	case TinyImageFormat_R16G16B16A16_UNORM: return TIF_DXGI_FORMAT_R16G16B16A16_UNORM;
	case TinyImageFormat_R16G16B16A16_SNORM: return TIF_DXGI_FORMAT_R16G16B16A16_SNORM;
	case TinyImageFormat_R16G16B16A16_UINT: return TIF_DXGI_FORMAT_R16G16B16A16_UINT;
	case TinyImageFormat_R16G16B16A16_SINT: return TIF_DXGI_FORMAT_R16G16B16A16_SINT;
	case TinyImageFormat_R16G16B16A16_SFLOAT: return TIF_DXGI_FORMAT_R16G16B16A16_FLOAT;
	case TinyImageFormat_R32_UINT: return TIF_DXGI_FORMAT_R32_UINT;
	case TinyImageFormat_R32_SINT: return TIF_DXGI_FORMAT_R32_SINT;
	case TinyImageFormat_R32_SFLOAT: return TIF_DXGI_FORMAT_R32_FLOAT;
	case TinyImageFormat_R32G32_UINT: return TIF_DXGI_FORMAT_R32G32_UINT;
	case TinyImageFormat_R32G32_SINT: return TIF_DXGI_FORMAT_R32G32_SINT;
	case TinyImageFormat_R32G32_SFLOAT: return TIF_DXGI_FORMAT_R32G32_FLOAT;
	case TinyImageFormat_R32G32B32_UINT: return TIF_DXGI_FORMAT_R32G32B32_UINT;
	case TinyImageFormat_R32G32B32_SINT: return TIF_DXGI_FORMAT_R32G32B32_SINT;
	case TinyImageFormat_R32G32B32_SFLOAT: return TIF_DXGI_FORMAT_R32G32B32_FLOAT;
	case TinyImageFormat_R32G32B32A32_UINT: return TIF_DXGI_FORMAT_R32G32B32A32_UINT;
	case TinyImageFormat_R32G32B32A32_SINT: return TIF_DXGI_FORMAT_R32G32B32A32_SINT;
	case TinyImageFormat_R32G32B32A32_SFLOAT: return TIF_DXGI_FORMAT_R32G32B32A32_FLOAT;
	case TinyImageFormat_B10G11R11_UFLOAT: return TIF_DXGI_FORMAT_R11G11B10_FLOAT;
	case TinyImageFormat_E5B9G9R9_UFLOAT: return TIF_DXGI_FORMAT_R9G9B9E5_SHAREDEXP;
	case TinyImageFormat_D16_UNORM: return TIF_DXGI_FORMAT_D16_UNORM;
	case TinyImageFormat_X8_D24_UNORM: return TIF_DXGI_FORMAT_D24_UNORM_S8_UINT;
	case TinyImageFormat_D32_SFLOAT: return TIF_DXGI_FORMAT_D32_FLOAT;
	case TinyImageFormat_D24_UNORM_S8_UINT: return TIF_DXGI_FORMAT_D24_UNORM_S8_UINT;
	case TinyImageFormat_D32_SFLOAT_S8_UINT: return TIF_DXGI_FORMAT_D32_FLOAT_S8X24_UINT;
	case TinyImageFormat_DXBC1_RGB_UNORM: return TIF_DXGI_FORMAT_BC1_UNORM;
	case TinyImageFormat_DXBC1_RGB_SRGB: return TIF_DXGI_FORMAT_BC1_UNORM_SRGB;
	case TinyImageFormat_DXBC1_RGBA_UNORM: return TIF_DXGI_FORMAT_BC1_UNORM;
	case TinyImageFormat_DXBC1_RGBA_SRGB: return TIF_DXGI_FORMAT_BC1_UNORM_SRGB;
	case TinyImageFormat_DXBC2_UNORM: return TIF_DXGI_FORMAT_BC2_UNORM;
	case TinyImageFormat_DXBC2_SRGB: return TIF_DXGI_FORMAT_BC2_UNORM_SRGB;
	case TinyImageFormat_DXBC3_UNORM: return TIF_DXGI_FORMAT_BC3_UNORM;
	case TinyImageFormat_DXBC3_SRGB: return TIF_DXGI_FORMAT_BC3_UNORM_SRGB;
	case TinyImageFormat_DXBC4_UNORM: return TIF_DXGI_FORMAT_BC4_UNORM;
	case TinyImageFormat_DXBC4_SNORM: return TIF_DXGI_FORMAT_BC4_SNORM;
	case TinyImageFormat_DXBC5_UNORM: return TIF_DXGI_FORMAT_BC5_UNORM;
	case TinyImageFormat_DXBC5_SNORM: return TIF_DXGI_FORMAT_BC5_SNORM;
	case TinyImageFormat_DXBC6H_UFLOAT: return TIF_DXGI_FORMAT_BC6H_UF16;
	case TinyImageFormat_DXBC6H_SFLOAT: return TIF_DXGI_FORMAT_BC6H_SF16;
	case TinyImageFormat_DXBC7_UNORM: return TIF_DXGI_FORMAT_BC7_UNORM;
	case TinyImageFormat_DXBC7_SRGB: return TIF_DXGI_FORMAT_BC7_UNORM_SRGB;
	case TinyImageFormat_D16_UNORM_S8_UINT: return TIF_DXGI_FORMAT_D16_UNORM_S8_UINT;
	//ASTC
	case TinyImageFormat_ASTC_4x4_UNORM:	 return TIF_DXGI_FORMAT_ASTC_4X4_UNORM;
	case TinyImageFormat_ASTC_4x4_SRGB:		 return TIF_DXGI_FORMAT_ASTC_4X4_UNORM_SRGB;
	case TinyImageFormat_ASTC_5x4_UNORM:	 return TIF_DXGI_FORMAT_ASTC_5X4_UNORM;
	case TinyImageFormat_ASTC_5x4_SRGB:		 return TIF_DXGI_FORMAT_ASTC_5X4_UNORM_SRGB;
	case TinyImageFormat_ASTC_5x5_UNORM:	 return TIF_DXGI_FORMAT_ASTC_5X5_UNORM;
	case TinyImageFormat_ASTC_5x5_SRGB:		 return TIF_DXGI_FORMAT_ASTC_5X5_UNORM_SRGB;
	case TinyImageFormat_ASTC_6x5_UNORM:	 return TIF_DXGI_FORMAT_ASTC_6X5_UNORM;
	case TinyImageFormat_ASTC_6x5_SRGB:		 return TIF_DXGI_FORMAT_ASTC_6X5_UNORM_SRGB;
	case TinyImageFormat_ASTC_6x6_UNORM:	 return TIF_DXGI_FORMAT_ASTC_6X6_UNORM;
	case TinyImageFormat_ASTC_6x6_SRGB:		 return TIF_DXGI_FORMAT_ASTC_6X6_UNORM_SRGB;
	case TinyImageFormat_ASTC_8x5_UNORM:	 return TIF_DXGI_FORMAT_ASTC_8X5_UNORM;
	case TinyImageFormat_ASTC_8x5_SRGB:		 return TIF_DXGI_FORMAT_ASTC_8X5_UNORM_SRGB;
	case TinyImageFormat_ASTC_8x6_UNORM:	 return TIF_DXGI_FORMAT_ASTC_8X6_UNORM;
	case TinyImageFormat_ASTC_8x6_SRGB:		 return TIF_DXGI_FORMAT_ASTC_8X6_UNORM_SRGB;
	case TinyImageFormat_ASTC_8x8_UNORM:	 return TIF_DXGI_FORMAT_ASTC_8X8_UNORM;
	case TinyImageFormat_ASTC_8x8_SRGB:		 return TIF_DXGI_FORMAT_ASTC_8X8_UNORM_SRGB;
	case TinyImageFormat_ASTC_10x5_UNORM:	 return TIF_DXGI_FORMAT_ASTC_10X5_UNORM;
	case TinyImageFormat_ASTC_10x5_SRGB:	 return TIF_DXGI_FORMAT_ASTC_10X5_UNORM_SRGB;
	case TinyImageFormat_ASTC_10x6_UNORM:	 return TIF_DXGI_FORMAT_ASTC_10X6_UNORM;
	case TinyImageFormat_ASTC_10x6_SRGB:	 return TIF_DXGI_FORMAT_ASTC_10X6_UNORM_SRGB;
	case TinyImageFormat_ASTC_10x8_UNORM:	 return TIF_DXGI_FORMAT_ASTC_10X8_UNORM;
	case TinyImageFormat_ASTC_10x8_SRGB:	 return TIF_DXGI_FORMAT_ASTC_10X8_UNORM_SRGB;
	case TinyImageFormat_ASTC_10x10_UNORM:	 return TIF_DXGI_FORMAT_ASTC_10X10_UNORM;
	case TinyImageFormat_ASTC_10x10_SRGB:	 return TIF_DXGI_FORMAT_ASTC_10X10_UNORM_SRGB;
	case TinyImageFormat_ASTC_12x10_UNORM:	 return TIF_DXGI_FORMAT_ASTC_12X10_UNORM;
	case TinyImageFormat_ASTC_12x10_SRGB:	 return TIF_DXGI_FORMAT_ASTC_12X10_UNORM_SRGB;
	case TinyImageFormat_ASTC_12x12_UNORM:	 return TIF_DXGI_FORMAT_ASTC_12X12_UNORM;
	case TinyImageFormat_ASTC_12x12_SRGB:	 return TIF_DXGI_FORMAT_ASTC_12X12_UNORM_SRGB;
	default: return TIF_DXGI_FORMAT_UNKNOWN;
	}
}

inline TinyImageFormat_DXGI_FORMAT TinyImageFormat_DXGI_FORMATToTypeless(TinyImageFormat_DXGI_FORMAT fmt) {
	switch (fmt) {
	case TIF_DXGI_FORMAT_R32G32B32A32_FLOAT:
	case TIF_DXGI_FORMAT_R32G32B32A32_UINT:
	case TIF_DXGI_FORMAT_R32G32B32A32_SINT: return TIF_DXGI_FORMAT_R32G32B32A32_TYPELESS;
	case TIF_DXGI_FORMAT_R32G32B32_FLOAT:
	case TIF_DXGI_FORMAT_R32G32B32_UINT:
	case TIF_DXGI_FORMAT_R32G32B32_SINT: return TIF_DXGI_FORMAT_R32G32B32_TYPELESS;

	case TIF_DXGI_FORMAT_R16G16B16A16_FLOAT:
	case TIF_DXGI_FORMAT_R16G16B16A16_UNORM:
	case TIF_DXGI_FORMAT_R16G16B16A16_UINT:
	case TIF_DXGI_FORMAT_R16G16B16A16_SNORM:
	case TIF_DXGI_FORMAT_R16G16B16A16_SINT: return TIF_DXGI_FORMAT_R16G16B16A16_TYPELESS;

	case TIF_DXGI_FORMAT_R32G32_FLOAT:
	case TIF_DXGI_FORMAT_R32G32_UINT:
	case TIF_DXGI_FORMAT_R32G32_SINT: return TIF_DXGI_FORMAT_R32G32_TYPELESS;

	case TIF_DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM:
	case TIF_DXGI_FORMAT_R10G10B10_SNORM_A2_UNORM:
	case TIF_DXGI_FORMAT_R10G10B10A2_UNORM:
	case TIF_DXGI_FORMAT_R10G10B10A2_UINT: return TIF_DXGI_FORMAT_R10G10B10A2_TYPELESS;

	case TIF_DXGI_FORMAT_R8G8B8A8_UNORM:
	case TIF_DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
	case TIF_DXGI_FORMAT_R8G8B8A8_UINT:
	case TIF_DXGI_FORMAT_R8G8B8A8_SNORM:
	case TIF_DXGI_FORMAT_R8G8B8A8_SINT: return TIF_DXGI_FORMAT_R8G8B8A8_TYPELESS;
	case TIF_DXGI_FORMAT_R16G16_FLOAT:
	case TIF_DXGI_FORMAT_R16G16_UNORM:
	case TIF_DXGI_FORMAT_R16G16_UINT:
	case TIF_DXGI_FORMAT_R16G16_SNORM:
	case TIF_DXGI_FORMAT_R16G16_SINT: return TIF_DXGI_FORMAT_R16G16_TYPELESS;

	case TIF_DXGI_FORMAT_R9G9B9E5_SHAREDEXP:
	case TIF_DXGI_FORMAT_D32_FLOAT:
	case TIF_DXGI_FORMAT_R32_FLOAT:
	case TIF_DXGI_FORMAT_R32_UINT:
	case TIF_DXGI_FORMAT_R32_SINT: return TIF_DXGI_FORMAT_R32_TYPELESS;
	case TIF_DXGI_FORMAT_R8G8_UNORM:
	case TIF_DXGI_FORMAT_R8G8_UINT:
	case TIF_DXGI_FORMAT_R8G8_SNORM:
	case TIF_DXGI_FORMAT_R8G8_SINT: return TIF_DXGI_FORMAT_R8G8_TYPELESS;
	case TIF_DXGI_FORMAT_B4G4R4A4_UNORM: // just treats a 16 raw bits
	case TIF_DXGI_FORMAT_D16_UNORM:
	case TIF_DXGI_FORMAT_R16_FLOAT:
	case TIF_DXGI_FORMAT_R16_UNORM:
	case TIF_DXGI_FORMAT_R16_UINT:
	case TIF_DXGI_FORMAT_R16_SNORM:
	case TIF_DXGI_FORMAT_R16_SINT: return TIF_DXGI_FORMAT_R16_TYPELESS;
	case TIF_DXGI_FORMAT_A8_UNORM:
	case TIF_DXGI_FORMAT_R8_UNORM:
	case TIF_DXGI_FORMAT_R8_UINT:
	case TIF_DXGI_FORMAT_R8_SNORM:
	case TIF_DXGI_FORMAT_R4G4_UNORM:
	case TIF_DXGI_FORMAT_R8_SINT: return TIF_DXGI_FORMAT_R8_TYPELESS;
	case TIF_DXGI_FORMAT_BC1_UNORM:
	case TIF_DXGI_FORMAT_BC1_UNORM_SRGB: return TIF_DXGI_FORMAT_BC1_TYPELESS;
	case TIF_DXGI_FORMAT_BC2_UNORM:
	case TIF_DXGI_FORMAT_BC2_UNORM_SRGB: return TIF_DXGI_FORMAT_BC2_TYPELESS;
	case TIF_DXGI_FORMAT_BC3_UNORM:
	case TIF_DXGI_FORMAT_BC3_UNORM_SRGB: return TIF_DXGI_FORMAT_BC3_TYPELESS;
	case TIF_DXGI_FORMAT_BC4_UNORM:
	case TIF_DXGI_FORMAT_BC4_SNORM: return TIF_DXGI_FORMAT_BC4_TYPELESS;
	case TIF_DXGI_FORMAT_BC5_UNORM:
	case TIF_DXGI_FORMAT_BC5_SNORM: return TIF_DXGI_FORMAT_BC5_TYPELESS;
	case TIF_DXGI_FORMAT_B5G6R5_UNORM:
	case TIF_DXGI_FORMAT_B5G5R5A1_UNORM: return TIF_DXGI_FORMAT_R16_TYPELESS;

	case TIF_DXGI_FORMAT_R11G11B10_FLOAT: return TIF_DXGI_FORMAT_R11G11B10_FLOAT;

	case TIF_DXGI_FORMAT_B8G8R8X8_UNORM:
	case TIF_DXGI_FORMAT_B8G8R8X8_UNORM_SRGB: return TIF_DXGI_FORMAT_B8G8R8X8_TYPELESS;

	case TIF_DXGI_FORMAT_B8G8R8A8_UNORM:
	case TIF_DXGI_FORMAT_B8G8R8A8_UNORM_SRGB: return TIF_DXGI_FORMAT_B8G8R8A8_TYPELESS;

	case TIF_DXGI_FORMAT_BC6H_UF16:
	case TIF_DXGI_FORMAT_BC6H_SF16: return TIF_DXGI_FORMAT_BC6H_TYPELESS;

	case TIF_DXGI_FORMAT_BC7_UNORM:
	case TIF_DXGI_FORMAT_BC7_UNORM_SRGB: return TIF_DXGI_FORMAT_BC7_TYPELESS;

	case TIF_DXGI_FORMAT_X32_TYPELESS_G8X24_UINT:
	case TIF_DXGI_FORMAT_D32_FLOAT_S8X24_UINT: return TIF_DXGI_FORMAT_R32G8X24_TYPELESS;
	case TIF_DXGI_FORMAT_X24_TYPELESS_G8_UINT: return TIF_DXGI_FORMAT_R24G8_TYPELESS;
	case TIF_DXGI_FORMAT_D24_UNORM_S8_UINT: return TIF_DXGI_FORMAT_R24G8_TYPELESS;

		// ASTC
	case TIF_DXGI_FORMAT_ASTC_4X4_UNORM:
	case TIF_DXGI_FORMAT_ASTC_4X4_UNORM_SRGB:
		return TIF_DXGI_FORMAT_ASTC_4X4_TYPELESS;

	case TIF_DXGI_FORMAT_ASTC_5X4_UNORM:
	case TIF_DXGI_FORMAT_ASTC_5X4_UNORM_SRGB:
		return TIF_DXGI_FORMAT_ASTC_5X4_TYPELESS;

	case TIF_DXGI_FORMAT_ASTC_5X5_UNORM:
	case TIF_DXGI_FORMAT_ASTC_5X5_UNORM_SRGB:
		return TIF_DXGI_FORMAT_ASTC_5X5_TYPELESS;

	case TIF_DXGI_FORMAT_ASTC_6X5_UNORM:
	case TIF_DXGI_FORMAT_ASTC_6X5_UNORM_SRGB:
		return TIF_DXGI_FORMAT_ASTC_6X5_TYPELESS;

	case TIF_DXGI_FORMAT_ASTC_6X6_UNORM:
	case TIF_DXGI_FORMAT_ASTC_6X6_UNORM_SRGB:
		return TIF_DXGI_FORMAT_ASTC_6X6_TYPELESS;

	case TIF_DXGI_FORMAT_ASTC_8X5_UNORM:
	case TIF_DXGI_FORMAT_ASTC_8X5_UNORM_SRGB:
		return TIF_DXGI_FORMAT_ASTC_8X5_TYPELESS;

	case TIF_DXGI_FORMAT_ASTC_8X6_UNORM:
	case TIF_DXGI_FORMAT_ASTC_8X6_UNORM_SRGB:
		return TIF_DXGI_FORMAT_ASTC_8X6_TYPELESS;

	case TIF_DXGI_FORMAT_ASTC_8X8_UNORM:
	case TIF_DXGI_FORMAT_ASTC_8X8_UNORM_SRGB:
		return TIF_DXGI_FORMAT_ASTC_8X8_TYPELESS;

	case TIF_DXGI_FORMAT_ASTC_10X5_UNORM:
	case TIF_DXGI_FORMAT_ASTC_10X5_UNORM_SRGB:
		return TIF_DXGI_FORMAT_ASTC_10X5_TYPELESS;

	case TIF_DXGI_FORMAT_ASTC_10X6_UNORM:
	case TIF_DXGI_FORMAT_ASTC_10X6_UNORM_SRGB:
		return TIF_DXGI_FORMAT_ASTC_10X6_TYPELESS;

	case TIF_DXGI_FORMAT_ASTC_10X8_UNORM:
	case TIF_DXGI_FORMAT_ASTC_10X8_UNORM_SRGB:
		return TIF_DXGI_FORMAT_ASTC_10X8_TYPELESS;

	case TIF_DXGI_FORMAT_ASTC_10X10_UNORM:
	case TIF_DXGI_FORMAT_ASTC_10X10_UNORM_SRGB:
		return TIF_DXGI_FORMAT_ASTC_10X10_TYPELESS;

	case TIF_DXGI_FORMAT_ASTC_12X10_UNORM:
	case TIF_DXGI_FORMAT_ASTC_12X10_UNORM_SRGB:
		return TIF_DXGI_FORMAT_ASTC_12X10_TYPELESS;

	case TIF_DXGI_FORMAT_ASTC_12X12_UNORM:
	case TIF_DXGI_FORMAT_ASTC_12X12_UNORM_SRGB:
		return TIF_DXGI_FORMAT_ASTC_12X12_TYPELESS;


		// typeless just return the input format
	case TIF_DXGI_FORMAT_ASTC_4X4_TYPELESS:
	case TIF_DXGI_FORMAT_ASTC_5X4_TYPELESS:
	case TIF_DXGI_FORMAT_ASTC_5X5_TYPELESS:
	case TIF_DXGI_FORMAT_ASTC_6X5_TYPELESS:
	case TIF_DXGI_FORMAT_ASTC_6X6_TYPELESS:
	case TIF_DXGI_FORMAT_ASTC_8X6_TYPELESS:
	case TIF_DXGI_FORMAT_ASTC_8X5_TYPELESS:
	case TIF_DXGI_FORMAT_ASTC_8X8_TYPELESS:
	case TIF_DXGI_FORMAT_ASTC_10X5_TYPELESS:
	case TIF_DXGI_FORMAT_ASTC_10X6_TYPELESS:
	case TIF_DXGI_FORMAT_ASTC_10X8_TYPELESS:
	case TIF_DXGI_FORMAT_ASTC_10X10_TYPELESS:
	case TIF_DXGI_FORMAT_ASTC_12X10_TYPELESS:
	case TIF_DXGI_FORMAT_ASTC_12X12_TYPELESS:
	case TIF_DXGI_FORMAT_R32G32B32A32_TYPELESS:
	case TIF_DXGI_FORMAT_R32G32B32_TYPELESS:
	case TIF_DXGI_FORMAT_R16G16B16A16_TYPELESS:
	case TIF_DXGI_FORMAT_R32G32_TYPELESS:
	case TIF_DXGI_FORMAT_R32G8X24_TYPELESS:
	case TIF_DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS:
	case TIF_DXGI_FORMAT_R10G10B10A2_TYPELESS:
	case TIF_DXGI_FORMAT_R8G8B8A8_TYPELESS:
	case TIF_DXGI_FORMAT_R16G16_TYPELESS:
	case TIF_DXGI_FORMAT_R32_TYPELESS:
	case TIF_DXGI_FORMAT_R24G8_TYPELESS:
	case TIF_DXGI_FORMAT_R24_UNORM_X8_TYPELESS:
	case TIF_DXGI_FORMAT_R8G8_TYPELESS:
	case TIF_DXGI_FORMAT_R16_TYPELESS:
	case TIF_DXGI_FORMAT_R8_TYPELESS:
	case TIF_DXGI_FORMAT_BC1_TYPELESS:
	case TIF_DXGI_FORMAT_BC2_TYPELESS:
	case TIF_DXGI_FORMAT_BC3_TYPELESS:
	case TIF_DXGI_FORMAT_BC4_TYPELESS:
	case TIF_DXGI_FORMAT_BC5_TYPELESS:
	case TIF_DXGI_FORMAT_B8G8R8A8_TYPELESS:
	case TIF_DXGI_FORMAT_B8G8R8X8_TYPELESS:
	case TIF_DXGI_FORMAT_BC6H_TYPELESS:
	case TIF_DXGI_FORMAT_BC7_TYPELESS: return fmt;

	case TIF_DXGI_FORMAT_R1_UNORM:
	case TIF_DXGI_FORMAT_R8G8_B8G8_UNORM:
	case TIF_DXGI_FORMAT_G8R8_G8B8_UNORM:
	case TIF_DXGI_FORMAT_AYUV:
	case TIF_DXGI_FORMAT_Y410:
	case TIF_DXGI_FORMAT_Y416:
	case TIF_DXGI_FORMAT_NV12:
	case TIF_DXGI_FORMAT_P010:
	case TIF_DXGI_FORMAT_P016:
	case TIF_DXGI_FORMAT_420_OPAQUE:
	case TIF_DXGI_FORMAT_YUY2:
	case TIF_DXGI_FORMAT_Y210:
	case TIF_DXGI_FORMAT_Y216:
	case TIF_DXGI_FORMAT_NV11:
	case TIF_DXGI_FORMAT_AI44:
	case TIF_DXGI_FORMAT_IA44:
	case TIF_DXGI_FORMAT_P8:
	case TIF_DXGI_FORMAT_A8P8:
	case TIF_DXGI_FORMAT_P208:
	case TIF_DXGI_FORMAT_V208:
	case TIF_DXGI_FORMAT_V408:
	case TIF_DXGI_FORMAT_R10G10B10_7E3_A2_FLOAT:
	case TIF_DXGI_FORMAT_R10G10B10_6E4_A2_FLOAT:
	case TIF_DXGI_FORMAT_D16_UNORM_S8_UINT:
	case TIF_DXGI_FORMAT_R16_UNORM_X8_TYPELESS:
	case TIF_DXGI_FORMAT_X16_TYPELESS_G8_UINT:
	case TIF_DXGI_FORMAT_UNKNOWN: return TIF_DXGI_FORMAT_UNKNOWN;
	}
	return TIF_DXGI_FORMAT_UNKNOWN;
}
#ifndef TINYIMAGEFORMAT_MTLPIXEL_FORMAT
#define TINYIMAGEFORMAT_MTLPIXEL_FORMAT

typedef enum TinyImageFormat_MTLPixelFormat {
	TIF_MTLPixelFormatInvalid = 0,
	TIF_MTLPixelFormatA8Unorm = 1,
	TIF_MTLPixelFormatR8Unorm = 10,
	TIF_MTLPixelFormatR8Unorm_sRGB = 11,
	TIF_MTLPixelFormatR8Snorm = 12,
	TIF_MTLPixelFormatR8Uint = 13,
	TIF_MTLPixelFormatR8Sint = 14,
	TIF_MTLPixelFormatR16Unorm = 20,
	TIF_MTLPixelFormatR16Snorm = 22,
	TIF_MTLPixelFormatR16Uint = 23,
	TIF_MTLPixelFormatR16Sint = 24,
	TIF_MTLPixelFormatR16Float = 25,
	TIF_MTLPixelFormatRG8Unorm = 30,
	TIF_MTLPixelFormatRG8Unorm_sRGB = 31,
	TIF_MTLPixelFormatRG8Snorm = 32,
	TIF_MTLPixelFormatRG8Uint = 33,
	TIF_MTLPixelFormatRG8Sint = 34,
	TIF_MTLPixelFormatB5G6R5Unorm = 40,
	TIF_MTLPixelFormatA1BGR5Unorm = 41,
	TIF_MTLPixelFormatABGR4Unorm = 42,
	TIF_MTLPixelFormatBGR5A1Unorm = 43,
	TIF_MTLPixelFormatR32Uint = 53,
	TIF_MTLPixelFormatR32Sint = 54,
	TIF_MTLPixelFormatR32Float = 55,
	TIF_MTLPixelFormatRG16Unorm = 60,
	TIF_MTLPixelFormatRG16Snorm = 62,
	TIF_MTLPixelFormatRG16Uint = 63,
	TIF_MTLPixelFormatRG16Sint = 64,
	TIF_MTLPixelFormatRG16Float = 65,
	TIF_MTLPixelFormatRGBA8Unorm = 70,
	TIF_MTLPixelFormatRGBA8Unorm_sRGB = 71,
	TIF_MTLPixelFormatRGBA8Snorm = 72,
	TIF_MTLPixelFormatRGBA8Uint = 73,
	TIF_MTLPixelFormatRGBA8Sint = 74,
	TIF_MTLPixelFormatBGRA8Unorm = 80,
	TIF_MTLPixelFormatBGRA8Unorm_sRGB = 81,
	TIF_MTLPixelFormatRGB10A2Unorm = 90,
	TIF_MTLPixelFormatRGB10A2Uint = 91,
	TIF_MTLPixelFormatRG11B10Float = 92,
	TIF_MTLPixelFormatRGB9E5Float = 93,
	TIF_MTLPixelFormatBGR10A2Unorm = 94,
	TIF_MTLPixelFormatBGR10_XR = 554,
	TIF_MTLPixelFormatBGR10_XR_sRGB = 555,
	TIF_MTLPixelFormatRG32Uint = 103,
	TIF_MTLPixelFormatRG32Sint = 104,
	TIF_MTLPixelFormatRG32Float = 105,
	TIF_MTLPixelFormatRGBA16Unorm = 110,
	TIF_MTLPixelFormatRGBA16Snorm = 112,
	TIF_MTLPixelFormatRGBA16Uint = 113,
	TIF_MTLPixelFormatRGBA16Sint = 114,
	TIF_MTLPixelFormatRGBA16Float = 115,
	TIF_MTLPixelFormatBGRA10_XR = 552,
	TIF_MTLPixelFormatBGRA10_XR_sRGB = 553,
	TIF_MTLPixelFormatRGBA32Uint = 123,
	TIF_MTLPixelFormatRGBA32Sint = 124,
	TIF_MTLPixelFormatRGBA32Float = 125,
	TIF_MTLPixelFormatBC1_RGBA = 130,
	TIF_MTLPixelFormatBC1_RGBA_sRGB = 131,
	TIF_MTLPixelFormatBC2_RGBA = 132,
	TIF_MTLPixelFormatBC2_RGBA_sRGB = 133,
	TIF_MTLPixelFormatBC3_RGBA = 134,
	TIF_MTLPixelFormatBC3_RGBA_sRGB = 135,
	TIF_MTLPixelFormatBC4_RUnorm = 140,
	TIF_MTLPixelFormatBC4_RSnorm = 141,
	TIF_MTLPixelFormatBC5_RGUnorm = 142,
	TIF_MTLPixelFormatBC5_RGSnorm = 143,
	TIF_MTLPixelFormatBC6H_RGBFloat = 150,
	TIF_MTLPixelFormatBC6H_RGBUfloat = 151,
	TIF_MTLPixelFormatBC7_RGBAUnorm = 152,
	TIF_MTLPixelFormatBC7_RGBAUnorm_sRGB = 153,
	TIF_MTLPixelFormatPVRTC_RGB_2BPP = 160,
	TIF_MTLPixelFormatPVRTC_RGB_2BPP_sRGB = 161,
	TIF_MTLPixelFormatPVRTC_RGB_4BPP = 162,
	TIF_MTLPixelFormatPVRTC_RGB_4BPP_sRGB = 163,
	TIF_MTLPixelFormatPVRTC_RGBA_2BPP = 164,
	TIF_MTLPixelFormatPVRTC_RGBA_2BPP_sRGB = 165,
	TIF_MTLPixelFormatPVRTC_RGBA_4BPP = 166,
	TIF_MTLPixelFormatPVRTC_RGBA_4BPP_sRGB = 167,
	TIF_MTLPixelFormatEAC_R11Unorm = 170,
	TIF_MTLPixelFormatEAC_R11Snorm = 172,
	TIF_MTLPixelFormatEAC_RG11Unorm = 174,
	TIF_MTLPixelFormatEAC_RG11Snorm = 176,
	TIF_MTLPixelFormatEAC_RGBA8 = 178,
	TIF_MTLPixelFormatEAC_RGBA8_sRGB = 179,
	TIF_MTLPixelFormatETC2_RGB8 = 180,
	TIF_MTLPixelFormatETC2_RGB8_sRGB = 181,
	TIF_MTLPixelFormatETC2_RGB8A1 = 182,
	TIF_MTLPixelFormatETC2_RGB8A1_sRGB = 183,
	TIF_MTLPixelFormatASTC_4x4_sRGB = 186,
	TIF_MTLPixelFormatASTC_5x4_sRGB = 187,
	TIF_MTLPixelFormatASTC_5x5_sRGB = 188,
	TIF_MTLPixelFormatASTC_6x5_sRGB = 189,
	TIF_MTLPixelFormatASTC_6x6_sRGB = 190,
	TIF_MTLPixelFormatASTC_8x5_sRGB = 192,
	TIF_MTLPixelFormatASTC_8x6_sRGB = 193,
	TIF_MTLPixelFormatASTC_8x8_sRGB = 194,
	TIF_MTLPixelFormatASTC_10x5_sRGB = 195,
	TIF_MTLPixelFormatASTC_10x6_sRGB = 196,
	TIF_MTLPixelFormatASTC_10x8_sRGB = 197,
	TIF_MTLPixelFormatASTC_10x10_sRGB = 198,
	TIF_MTLPixelFormatASTC_12x10_sRGB = 199,
	TIF_MTLPixelFormatASTC_12x12_sRGB = 200,
	TIF_MTLPixelFormatASTC_4x4_LDR = 204,
	TIF_MTLPixelFormatASTC_5x4_LDR = 205,
	TIF_MTLPixelFormatASTC_5x5_LDR = 206,
	TIF_MTLPixelFormatASTC_6x5_LDR = 207,
	TIF_MTLPixelFormatASTC_6x6_LDR = 208,
	TIF_MTLPixelFormatASTC_8x5_LDR = 210,
	TIF_MTLPixelFormatASTC_8x6_LDR = 211,
	TIF_MTLPixelFormatASTC_8x8_LDR = 212,
	TIF_MTLPixelFormatASTC_10x5_LDR = 213,
	TIF_MTLPixelFormatASTC_10x6_LDR = 214,
	TIF_MTLPixelFormatASTC_10x8_LDR = 215,
	TIF_MTLPixelFormatASTC_10x10_LDR = 216,
	TIF_MTLPixelFormatASTC_12x10_LDR = 217,
	TIF_MTLPixelFormatASTC_12x12_LDR = 218,
	TIF_MTLPixelFormatGBGR422 = 240,
	TIF_MTLPixelFormatBGRG422 = 241,
	TIF_MTLPixelFormatDepth16Unorm = 250,
	TIF_MTLPixelFormatDepth32Float = 252,
	TIF_MTLPixelFormatStencil8 = 253,
	TIF_MTLPixelFormatDepth24Unorm_Stencil8 = 255,
	TIF_MTLPixelFormatDepth32Float_Stencil8 = 260,
	TIF_MTLPixelFormatX32_Stencil8 = 261,
	TIF_MTLPixelFormatX24_Stencil8 = 262,
} TinyImageFormat_MTLPixelFormat;
#endif

inline TinyImageFormat_MTLPixelFormat TinyImageFormat_ToMTLPixelFormat(TinyImageFormat fmt) {
	switch (fmt) {
	case TinyImageFormat_A8_UNORM: 									return TIF_MTLPixelFormatA8Unorm;
	case TinyImageFormat_R8_UNORM: 		return TIF_MTLPixelFormatR8Unorm;
	case TinyImageFormat_R8_SNORM: 		return TIF_MTLPixelFormatR8Snorm;
	case TinyImageFormat_R8_UINT: 		return TIF_MTLPixelFormatR8Uint;
	case TinyImageFormat_R8_SINT: 		return TIF_MTLPixelFormatR8Sint;
	case TinyImageFormat_R8_SRGB: 		return TIF_MTLPixelFormatR8Unorm_sRGB;
	case TinyImageFormat_UNDEFINED: return TIF_MTLPixelFormatInvalid;
	case TinyImageFormat_R4G4B4A4_UNORM: return TIF_MTLPixelFormatABGR4Unorm;
	case TinyImageFormat_R5G6B5_UNORM: return TIF_MTLPixelFormatB5G6R5Unorm;;
	case TinyImageFormat_R5G5B5A1_UNORM: return TIF_MTLPixelFormatA1BGR5Unorm;
	case TinyImageFormat_R8G8_UNORM:		return TIF_MTLPixelFormatRG8Unorm;
	case TinyImageFormat_R8G8_SNORM:		return TIF_MTLPixelFormatRG8Snorm;
	case TinyImageFormat_R8G8_UINT:			return TIF_MTLPixelFormatRG8Uint;
	case TinyImageFormat_R8G8_SINT:			return TIF_MTLPixelFormatRG8Sint;
	case TinyImageFormat_R8G8_SRGB:			return TIF_MTLPixelFormatRG8Unorm_sRGB;
	case TinyImageFormat_R8G8B8A8_UNORM:		return TIF_MTLPixelFormatRGBA8Unorm;
	case TinyImageFormat_R8G8B8A8_SNORM:		return TIF_MTLPixelFormatRGBA8Snorm;
	case TinyImageFormat_R8G8B8A8_UINT:			return TIF_MTLPixelFormatRGBA8Uint;
	case TinyImageFormat_R8G8B8A8_SINT:			return TIF_MTLPixelFormatRGBA8Sint;
	case TinyImageFormat_R8G8B8A8_SRGB:			return TIF_MTLPixelFormatRGBA8Unorm_sRGB;
	case TinyImageFormat_B8G8R8A8_UNORM: 							return TIF_MTLPixelFormatBGRA8Unorm;
	case TinyImageFormat_B8G8R8A8_SRGB:								return TIF_MTLPixelFormatBGRA8Unorm_sRGB;
	case TinyImageFormat_B10G10R10A2_UNORM:		return TIF_MTLPixelFormatBGR10A2Unorm;
	case TinyImageFormat_R10G10B10A2_UNORM:		return TIF_MTLPixelFormatRGB10A2Unorm;
	case TinyImageFormat_R10G10B10A2_UINT:			return TIF_MTLPixelFormatRGB10A2Uint;
	case TinyImageFormat_R16_UNORM:			return TIF_MTLPixelFormatR16Unorm;
	case TinyImageFormat_R16_SNORM:			return TIF_MTLPixelFormatR16Snorm;
	case TinyImageFormat_R16_UINT:			return TIF_MTLPixelFormatR16Uint;
	case TinyImageFormat_R16_SINT:			return TIF_MTLPixelFormatR16Sint;
	case TinyImageFormat_R16_SFLOAT:		return TIF_MTLPixelFormatR16Float;
	case TinyImageFormat_R16G16_UNORM:	return TIF_MTLPixelFormatRG16Unorm;
	case TinyImageFormat_R16G16_SNORM:	return TIF_MTLPixelFormatRG16Snorm;
	case TinyImageFormat_R16G16_UINT:		return TIF_MTLPixelFormatRG16Uint;
	case TinyImageFormat_R16G16_SINT:		return TIF_MTLPixelFormatRG16Sint;
	case TinyImageFormat_R16G16_SFLOAT:	return TIF_MTLPixelFormatRG16Float;
	case TinyImageFormat_R16G16B16A16_UNORM:	return TIF_MTLPixelFormatRGBA16Unorm;
	case TinyImageFormat_R16G16B16A16_SNORM:	return TIF_MTLPixelFormatRGBA16Snorm;
	case TinyImageFormat_R16G16B16A16_UINT:		return TIF_MTLPixelFormatRGBA16Uint;
	case TinyImageFormat_R16G16B16A16_SINT:		return TIF_MTLPixelFormatRGBA16Sint;
	case TinyImageFormat_R16G16B16A16_SFLOAT:	return TIF_MTLPixelFormatRGBA16Float;
	case TinyImageFormat_R32_UINT:						return TIF_MTLPixelFormatR32Uint;
	case TinyImageFormat_R32_SINT:						return TIF_MTLPixelFormatR32Sint;
	case TinyImageFormat_R32_SFLOAT:					return TIF_MTLPixelFormatR32Float;
	case TinyImageFormat_R32G32_UINT:					return TIF_MTLPixelFormatRG32Uint;
	case TinyImageFormat_R32G32_SINT:					return TIF_MTLPixelFormatRG32Sint;
	case TinyImageFormat_R32G32_SFLOAT:				return TIF_MTLPixelFormatRG32Float;
	case TinyImageFormat_R32G32B32A32_UINT:		return TIF_MTLPixelFormatRGBA32Uint;
	case TinyImageFormat_R32G32B32A32_SINT:		return TIF_MTLPixelFormatRGBA32Sint;
	case TinyImageFormat_R32G32B32A32_SFLOAT:	return TIF_MTLPixelFormatRGBA32Float;
	case TinyImageFormat_B10G11R11_UFLOAT: return TIF_MTLPixelFormatRG11B10Float;
	case TinyImageFormat_E5B9G9R9_UFLOAT:	return TIF_MTLPixelFormatRGB9E5Float;
	case TinyImageFormat_D16_UNORM:								return TIF_MTLPixelFormatDepth16Unorm;
	case TinyImageFormat_X8_D24_UNORM:			return TIF_MTLPixelFormatDepth24Unorm_Stencil8;
	case TinyImageFormat_D32_SFLOAT:							return TIF_MTLPixelFormatDepth32Float;
	case TinyImageFormat_S8_UINT:									return TIF_MTLPixelFormatStencil8;
	case TinyImageFormat_D24_UNORM_S8_UINT:				return TIF_MTLPixelFormatDepth24Unorm_Stencil8;
	case TinyImageFormat_D32_SFLOAT_S8_UINT:			return TIF_MTLPixelFormatDepth32Float_Stencil8;
	case TinyImageFormat_DXBC1_RGB_UNORM:			return TIF_MTLPixelFormatBC1_RGBA;
	case TinyImageFormat_DXBC1_RGB_SRGB:			return TIF_MTLPixelFormatBC1_RGBA_sRGB;
	case TinyImageFormat_DXBC1_RGBA_UNORM:		return TIF_MTLPixelFormatBC1_RGBA;
	case TinyImageFormat_DXBC1_RGBA_SRGB:			return TIF_MTLPixelFormatBC1_RGBA_sRGB;
	case TinyImageFormat_DXBC2_UNORM:					return TIF_MTLPixelFormatBC2_RGBA;
	case TinyImageFormat_DXBC2_SRGB:					return TIF_MTLPixelFormatBC2_RGBA_sRGB;
	case TinyImageFormat_DXBC3_UNORM:					return TIF_MTLPixelFormatBC3_RGBA;
	case TinyImageFormat_DXBC3_SRGB:					return TIF_MTLPixelFormatBC3_RGBA_sRGB;
	case TinyImageFormat_DXBC4_UNORM:					return TIF_MTLPixelFormatBC4_RUnorm;
	case TinyImageFormat_DXBC4_SNORM:					return TIF_MTLPixelFormatBC4_RSnorm;
	case TinyImageFormat_DXBC5_UNORM:					return TIF_MTLPixelFormatBC5_RGUnorm;
	case TinyImageFormat_DXBC5_SNORM:					return TIF_MTLPixelFormatBC5_RGSnorm;
	case TinyImageFormat_DXBC6H_UFLOAT:				return TIF_MTLPixelFormatBC6H_RGBUfloat;
	case TinyImageFormat_DXBC6H_SFLOAT:				return TIF_MTLPixelFormatBC6H_RGBFloat;
	case TinyImageFormat_DXBC7_UNORM:					return TIF_MTLPixelFormatBC7_RGBAUnorm;
	case TinyImageFormat_DXBC7_SRGB:					return TIF_MTLPixelFormatBC7_RGBAUnorm_sRGB;
	case TinyImageFormat_PVRTC1_2BPP_UNORM:		return TIF_MTLPixelFormatPVRTC_RGBA_2BPP;
	case TinyImageFormat_PVRTC1_4BPP_UNORM:		return TIF_MTLPixelFormatPVRTC_RGBA_4BPP;
	case TinyImageFormat_PVRTC1_2BPP_SRGB:		return TIF_MTLPixelFormatPVRTC_RGBA_2BPP_sRGB;
	case TinyImageFormat_PVRTC1_4BPP_SRGB:		return TIF_MTLPixelFormatPVRTC_RGBA_4BPP_sRGB;
	case TinyImageFormat_ETC2_R8G8B8_UNORM:	return TIF_MTLPixelFormatETC2_RGB8;
	case TinyImageFormat_ETC2_R8G8B8A1_UNORM:return TIF_MTLPixelFormatETC2_RGB8A1;
	case TinyImageFormat_ETC2_R8G8B8A8_UNORM: return TIF_MTLPixelFormatEAC_RGBA8;
	case TinyImageFormat_ETC2_R8G8B8_SRGB:		return TIF_MTLPixelFormatETC2_RGB8_sRGB;
	case TinyImageFormat_ETC2_R8G8B8A1_SRGB:	return TIF_MTLPixelFormatETC2_RGB8A1_sRGB;
	case TinyImageFormat_ETC2_R8G8B8A8_SRGB:	return TIF_MTLPixelFormatEAC_RGBA8_sRGB;
	case TinyImageFormat_ETC2_EAC_R11_UNORM:				return TIF_MTLPixelFormatEAC_R11Unorm;
	case TinyImageFormat_ETC2_EAC_R11G11_UNORM:		return TIF_MTLPixelFormatEAC_RG11Unorm;
	case TinyImageFormat_ETC2_EAC_R11_SNORM:				return TIF_MTLPixelFormatEAC_R11Snorm;
	case TinyImageFormat_ETC2_EAC_R11G11_SNORM:		return TIF_MTLPixelFormatEAC_RG11Snorm;
	case TinyImageFormat_ASTC_4x4_UNORM:			return TIF_MTLPixelFormatASTC_4x4_LDR;
	case TinyImageFormat_ASTC_4x4_SRGB:				return TIF_MTLPixelFormatASTC_4x4_sRGB;
	case TinyImageFormat_ASTC_5x4_UNORM:			return TIF_MTLPixelFormatASTC_5x4_LDR;
	case TinyImageFormat_ASTC_5x4_SRGB:				return TIF_MTLPixelFormatASTC_5x4_sRGB;
	case TinyImageFormat_ASTC_5x5_UNORM:			return TIF_MTLPixelFormatASTC_5x5_LDR;
	case TinyImageFormat_ASTC_5x5_SRGB:				return TIF_MTLPixelFormatASTC_5x5_sRGB;
	case TinyImageFormat_ASTC_6x5_UNORM:			return TIF_MTLPixelFormatASTC_6x5_LDR;
	case TinyImageFormat_ASTC_6x5_SRGB:				return TIF_MTLPixelFormatASTC_6x5_sRGB;
	case TinyImageFormat_ASTC_6x6_UNORM:			return TIF_MTLPixelFormatASTC_6x6_LDR;
	case TinyImageFormat_ASTC_6x6_SRGB:				return TIF_MTLPixelFormatASTC_6x6_sRGB;
	case TinyImageFormat_ASTC_8x5_UNORM:			return TIF_MTLPixelFormatASTC_8x5_LDR;
	case TinyImageFormat_ASTC_8x5_SRGB:				return TIF_MTLPixelFormatASTC_8x5_sRGB;
	case TinyImageFormat_ASTC_8x6_UNORM:			return TIF_MTLPixelFormatASTC_8x6_LDR;
	case TinyImageFormat_ASTC_8x6_SRGB:				return TIF_MTLPixelFormatASTC_8x6_sRGB;
	case TinyImageFormat_ASTC_8x8_UNORM:			return TIF_MTLPixelFormatASTC_8x8_LDR;
	case TinyImageFormat_ASTC_8x8_SRGB:				return TIF_MTLPixelFormatASTC_8x8_sRGB;
	case TinyImageFormat_ASTC_10x5_UNORM:			return TIF_MTLPixelFormatASTC_10x5_LDR;
	case TinyImageFormat_ASTC_10x5_SRGB:			return TIF_MTLPixelFormatASTC_10x5_sRGB;
	case TinyImageFormat_ASTC_10x6_UNORM:			return TIF_MTLPixelFormatASTC_10x6_LDR;
	case TinyImageFormat_ASTC_10x6_SRGB:			return TIF_MTLPixelFormatASTC_10x6_sRGB;
	case TinyImageFormat_ASTC_10x8_UNORM:			return TIF_MTLPixelFormatASTC_10x8_LDR;
	case TinyImageFormat_ASTC_10x8_SRGB:			return TIF_MTLPixelFormatASTC_10x8_sRGB;
	case TinyImageFormat_ASTC_10x10_UNORM:		return TIF_MTLPixelFormatASTC_10x10_LDR;
	case TinyImageFormat_ASTC_10x10_SRGB:			return TIF_MTLPixelFormatASTC_10x10_sRGB;
	case TinyImageFormat_ASTC_12x10_UNORM:		return TIF_MTLPixelFormatASTC_12x10_LDR;
	case TinyImageFormat_ASTC_12x10_SRGB:			return TIF_MTLPixelFormatASTC_12x10_sRGB;
	case TinyImageFormat_ASTC_12x12_UNORM:		return TIF_MTLPixelFormatASTC_12x12_LDR;
	case TinyImageFormat_ASTC_12x12_SRGB:			return TIF_MTLPixelFormatASTC_12x12_sRGB;

	default: return TIF_MTLPixelFormatInvalid;
	}

	return TIF_MTLPixelFormatInvalid;
}

inline TinyImageFormat TinyImageFormat_FromMTLPixelFormat(TinyImageFormat_MTLPixelFormat fmt) {
	switch (fmt) {
	case TIF_MTLPixelFormatInvalid: return TinyImageFormat_UNDEFINED;
	case TIF_MTLPixelFormatA8Unorm: return TinyImageFormat_A8_UNORM;
	case TIF_MTLPixelFormatR8Unorm: return TinyImageFormat_R8_UNORM;
	case TIF_MTLPixelFormatR8Unorm_sRGB: return TinyImageFormat_R8_SRGB;
	case TIF_MTLPixelFormatR8Snorm: return TinyImageFormat_R8_SNORM;
	case TIF_MTLPixelFormatR8Uint: return TinyImageFormat_R8_UINT;
	case TIF_MTLPixelFormatR8Sint: return TinyImageFormat_R8_SINT;
	case TIF_MTLPixelFormatR16Unorm: return TinyImageFormat_R16_UNORM;
	case TIF_MTLPixelFormatR16Snorm: return TinyImageFormat_R16_SNORM;
	case TIF_MTLPixelFormatR16Uint: return TinyImageFormat_R16_UINT;
	case TIF_MTLPixelFormatR16Sint: return TinyImageFormat_R16_SINT;
	case TIF_MTLPixelFormatR16Float: return TinyImageFormat_R16_SFLOAT;
	case TIF_MTLPixelFormatRG8Unorm: return TinyImageFormat_R8G8B8_UNORM;
	case TIF_MTLPixelFormatRG8Unorm_sRGB: return TinyImageFormat_R8G8_SRGB;
	case TIF_MTLPixelFormatRG8Snorm: return TinyImageFormat_R8G8_SNORM;
	case TIF_MTLPixelFormatRG8Uint: return TinyImageFormat_R8G8_UINT;
	case TIF_MTLPixelFormatRG8Sint: return TinyImageFormat_R8G8_SINT;
	case TIF_MTLPixelFormatB5G6R5Unorm: return TinyImageFormat_R5G6B5_UNORM;
	case TIF_MTLPixelFormatA1BGR5Unorm: return TinyImageFormat_R5G5B5A1_UNORM;
	case TIF_MTLPixelFormatABGR4Unorm: return TinyImageFormat_R4G4B4A4_UNORM;
	case TIF_MTLPixelFormatBGR5A1Unorm: return TinyImageFormat_A1R5G5B5_UNORM;
	case TIF_MTLPixelFormatR32Uint: return TinyImageFormat_R32_UINT;
	case TIF_MTLPixelFormatR32Sint: return TinyImageFormat_R32_SINT;
	case TIF_MTLPixelFormatR32Float: return TinyImageFormat_R32_SFLOAT;
	case TIF_MTLPixelFormatRG16Unorm: return TinyImageFormat_R16G16_UNORM;
	case TIF_MTLPixelFormatRG16Snorm: return TinyImageFormat_R16G16_SNORM;
	case TIF_MTLPixelFormatRG16Uint: return TinyImageFormat_R16G16B16_UINT;
	case TIF_MTLPixelFormatRG16Sint: return TinyImageFormat_R16G16_SINT;
	case TIF_MTLPixelFormatRG16Float: return TinyImageFormat_R16G16_SFLOAT;
	case TIF_MTLPixelFormatRGBA8Unorm: return TinyImageFormat_R8G8B8A8_UNORM;
	case TIF_MTLPixelFormatRGBA8Unorm_sRGB: return TinyImageFormat_R8G8B8A8_SRGB;
	case TIF_MTLPixelFormatRGBA8Snorm: return TinyImageFormat_R8G8B8A8_SNORM;
	case TIF_MTLPixelFormatRGBA8Uint: return TinyImageFormat_R8G8B8A8_UINT;
	case TIF_MTLPixelFormatRGBA8Sint: return TinyImageFormat_R8G8B8A8_SINT;
	case TIF_MTLPixelFormatBGRA8Unorm: return TinyImageFormat_B8G8R8A8_UNORM;
	case TIF_MTLPixelFormatRGB10A2Unorm: return TinyImageFormat_R10G10B10A2_UNORM;
	case TIF_MTLPixelFormatRGB10A2Uint: return TinyImageFormat_R10G10B10A2_UNORM;
	case TIF_MTLPixelFormatRG11B10Float: return TinyImageFormat_B10G11R11_UFLOAT;
	case TIF_MTLPixelFormatRGB9E5Float: return TinyImageFormat_E5B9G9R9_UFLOAT;
	case TIF_MTLPixelFormatBGR10A2Unorm: return TinyImageFormat_B10G10R10A2_UNORM;
	case TIF_MTLPixelFormatRG32Uint: return TinyImageFormat_R32G32_UINT;
	case TIF_MTLPixelFormatRG32Sint: return TinyImageFormat_R32G32_SINT;
	case TIF_MTLPixelFormatRG32Float: return TinyImageFormat_R32G32_SFLOAT;
	case TIF_MTLPixelFormatRGBA16Unorm: return TinyImageFormat_R16G16B16A16_UNORM;
	case TIF_MTLPixelFormatRGBA16Snorm: return TinyImageFormat_R16G16B16A16_SNORM;
	case TIF_MTLPixelFormatRGBA16Uint: return TinyImageFormat_R16G16B16A16_UINT;
	case TIF_MTLPixelFormatRGBA16Sint: return TinyImageFormat_R16G16B16A16_SINT;
	case TIF_MTLPixelFormatRGBA16Float: return TinyImageFormat_R16G16B16A16_SFLOAT;
	case TIF_MTLPixelFormatRGBA32Uint: return TinyImageFormat_R32G32B32A32_UINT;
	case TIF_MTLPixelFormatRGBA32Sint: return TinyImageFormat_R32G32B32A32_SINT;
	case TIF_MTLPixelFormatRGBA32Float: return TinyImageFormat_R32G32B32A32_SFLOAT;
	case TIF_MTLPixelFormatBC1_RGBA: return TinyImageFormat_DXBC1_RGBA_SRGB;
	case TIF_MTLPixelFormatBC1_RGBA_sRGB: return TinyImageFormat_DXBC1_RGBA_SRGB;
	case TIF_MTLPixelFormatBC2_RGBA: return TinyImageFormat_DXBC2_UNORM;
	case TIF_MTLPixelFormatBC2_RGBA_sRGB: return TinyImageFormat_DXBC2_SRGB;
	case TIF_MTLPixelFormatBC3_RGBA: return TinyImageFormat_DXBC3_UNORM;
	case TIF_MTLPixelFormatBC3_RGBA_sRGB: return TinyImageFormat_DXBC2_SRGB;
	case TIF_MTLPixelFormatBC4_RUnorm: return TinyImageFormat_DXBC4_UNORM;
	case TIF_MTLPixelFormatBC4_RSnorm: return TinyImageFormat_DXBC4_SNORM;
	case TIF_MTLPixelFormatBC5_RGUnorm: return TinyImageFormat_DXBC5_UNORM;
	case TIF_MTLPixelFormatBC5_RGSnorm: return TinyImageFormat_DXBC5_SNORM;
	case TIF_MTLPixelFormatBC6H_RGBFloat: return TinyImageFormat_DXBC6H_SFLOAT;
	case TIF_MTLPixelFormatBC6H_RGBUfloat: return TinyImageFormat_DXBC6H_UFLOAT;
	case TIF_MTLPixelFormatBC7_RGBAUnorm: return TinyImageFormat_DXBC7_UNORM;
	case TIF_MTLPixelFormatBC7_RGBAUnorm_sRGB: return TinyImageFormat_DXBC7_SRGB;
	case TIF_MTLPixelFormatPVRTC_RGB_2BPP: return TinyImageFormat_PVRTC1_2BPP_UNORM;
	case TIF_MTLPixelFormatPVRTC_RGB_2BPP_sRGB: return TinyImageFormat_PVRTC1_2BPP_SRGB;
	case TIF_MTLPixelFormatPVRTC_RGB_4BPP: return TinyImageFormat_PVRTC1_4BPP_UNORM;
	case TIF_MTLPixelFormatPVRTC_RGB_4BPP_sRGB: return TinyImageFormat_PVRTC1_4BPP_SRGB;
	case TIF_MTLPixelFormatPVRTC_RGBA_2BPP: return TinyImageFormat_PVRTC1_2BPP_UNORM;
	case TIF_MTLPixelFormatPVRTC_RGBA_2BPP_sRGB: return TinyImageFormat_PVRTC1_2BPP_SRGB;
	case TIF_MTLPixelFormatPVRTC_RGBA_4BPP: return TinyImageFormat_PVRTC1_4BPP_UNORM;
	case TIF_MTLPixelFormatPVRTC_RGBA_4BPP_sRGB: return TinyImageFormat_PVRTC1_4BPP_SRGB;
	case TIF_MTLPixelFormatEAC_R11Unorm: return TinyImageFormat_ETC2_EAC_R11_UNORM;
	case TIF_MTLPixelFormatEAC_R11Snorm: return TinyImageFormat_ETC2_EAC_R11_SNORM;
	case TIF_MTLPixelFormatEAC_RG11Unorm: return TinyImageFormat_ETC2_EAC_R11G11_UNORM;
	case TIF_MTLPixelFormatEAC_RG11Snorm: return TinyImageFormat_ETC2_EAC_R11G11_SNORM;
	case TIF_MTLPixelFormatEAC_RGBA8: return TinyImageFormat_ETC2_R8G8B8A8_UNORM;
	case TIF_MTLPixelFormatEAC_RGBA8_sRGB: return TinyImageFormat_ETC2_R8G8B8A8_SRGB;
	case TIF_MTLPixelFormatETC2_RGB8: return TinyImageFormat_ETC2_R8G8B8_UNORM;
	case TIF_MTLPixelFormatETC2_RGB8_sRGB: return TinyImageFormat_ETC2_R8G8B8_SRGB;
	case TIF_MTLPixelFormatETC2_RGB8A1: return TinyImageFormat_ETC2_R8G8B8A1_UNORM;
	case TIF_MTLPixelFormatETC2_RGB8A1_sRGB: return TinyImageFormat_ETC2_R8G8B8A1_SRGB;
	case TIF_MTLPixelFormatASTC_4x4_sRGB:			return TinyImageFormat_ASTC_4x4_SRGB;
	case TIF_MTLPixelFormatASTC_5x4_sRGB:			return TinyImageFormat_ASTC_5x4_SRGB;
	case TIF_MTLPixelFormatASTC_5x5_sRGB:			return TinyImageFormat_ASTC_5x4_SRGB;
	case TIF_MTLPixelFormatASTC_6x5_sRGB:			return TinyImageFormat_ASTC_6x5_SRGB;
	case TIF_MTLPixelFormatASTC_6x6_sRGB:			return TinyImageFormat_ASTC_6x6_SRGB;
	case TIF_MTLPixelFormatASTC_8x5_sRGB:			return TinyImageFormat_ASTC_8x5_SRGB;
	case TIF_MTLPixelFormatASTC_8x6_sRGB:			return TinyImageFormat_ASTC_8x6_SRGB;
	case TIF_MTLPixelFormatASTC_8x8_sRGB:			return TinyImageFormat_ASTC_8x8_SRGB;
	case TIF_MTLPixelFormatASTC_10x5_sRGB:		return TinyImageFormat_ASTC_10x5_SRGB;
	case TIF_MTLPixelFormatASTC_10x6_sRGB:		return TinyImageFormat_ASTC_10x6_SRGB;
	case TIF_MTLPixelFormatASTC_10x8_sRGB:		return TinyImageFormat_ASTC_10x8_SRGB;
	case TIF_MTLPixelFormatASTC_10x10_sRGB: 	return TinyImageFormat_ASTC_10x10_SRGB;
	case TIF_MTLPixelFormatASTC_12x10_sRGB: 	return TinyImageFormat_ASTC_12x10_SRGB;
	case TIF_MTLPixelFormatASTC_12x12_sRGB: 	return TinyImageFormat_ASTC_12x12_SRGB;
	case TIF_MTLPixelFormatASTC_4x4_LDR: 		return TinyImageFormat_ASTC_4x4_UNORM;
	case TIF_MTLPixelFormatASTC_5x4_LDR: 		return TinyImageFormat_ASTC_5x4_UNORM;
	case TIF_MTLPixelFormatASTC_5x5_LDR: 		return TinyImageFormat_ASTC_5x4_UNORM;
	case TIF_MTLPixelFormatASTC_6x5_LDR: 		return TinyImageFormat_ASTC_6x5_UNORM;
	case TIF_MTLPixelFormatASTC_6x6_LDR: 		return TinyImageFormat_ASTC_6x6_UNORM;
	case TIF_MTLPixelFormatASTC_8x5_LDR: 		return TinyImageFormat_ASTC_8x5_UNORM;
	case TIF_MTLPixelFormatASTC_8x6_LDR: 		return TinyImageFormat_ASTC_8x6_UNORM;
	case TIF_MTLPixelFormatASTC_8x8_LDR: 		return TinyImageFormat_ASTC_8x8_UNORM;
	case TIF_MTLPixelFormatASTC_10x5_LDR:		return TinyImageFormat_ASTC_10x5_UNORM;
	case TIF_MTLPixelFormatASTC_10x6_LDR:		return TinyImageFormat_ASTC_10x6_UNORM;
	case TIF_MTLPixelFormatASTC_10x8_LDR:		return TinyImageFormat_ASTC_10x8_UNORM;
	case TIF_MTLPixelFormatASTC_10x10_LDR: 	return TinyImageFormat_ASTC_10x10_UNORM;
	case TIF_MTLPixelFormatASTC_12x10_LDR: 	return TinyImageFormat_ASTC_12x10_UNORM;
	case TIF_MTLPixelFormatASTC_12x12_LDR: 	return TinyImageFormat_ASTC_12x12_UNORM;
	case TIF_MTLPixelFormatDepth16Unorm: return TinyImageFormat_D16_UNORM;
	case TIF_MTLPixelFormatDepth32Float: return TinyImageFormat_D32_SFLOAT;
	case TIF_MTLPixelFormatStencil8: return TinyImageFormat_S8_UINT;
	case TIF_MTLPixelFormatDepth24Unorm_Stencil8: return TinyImageFormat_D24_UNORM_S8_UINT;
	case TIF_MTLPixelFormatDepth32Float_Stencil8: return TinyImageFormat_D32_SFLOAT_S8_UINT;
	case TIF_MTLPixelFormatX32_Stencil8: return TinyImageFormat_D32_SFLOAT_S8_UINT;
	case TIF_MTLPixelFormatX24_Stencil8: return TinyImageFormat_D24_UNORM_S8_UINT;

	case TIF_MTLPixelFormatBGRA8Unorm_sRGB: return TinyImageFormat_UNDEFINED;
	case TIF_MTLPixelFormatBGR10_XR: return TinyImageFormat_UNDEFINED;
	case TIF_MTLPixelFormatBGR10_XR_sRGB: return TinyImageFormat_UNDEFINED;
	case TIF_MTLPixelFormatBGRA10_XR: return TinyImageFormat_UNDEFINED;
	case TIF_MTLPixelFormatBGRA10_XR_sRGB: return TinyImageFormat_UNDEFINED;
	case TIF_MTLPixelFormatGBGR422: return TinyImageFormat_UNDEFINED;
	case TIF_MTLPixelFormatBGRG422: return TinyImageFormat_UNDEFINED;
	}
	return TinyImageFormat_UNDEFINED;
}


inline bool TinyImageFormat_MTLPixelFormatOnMac(TinyImageFormat_MTLPixelFormat fmt) {
	switch(fmt) {
	case TIF_MTLPixelFormatA8Unorm:
	case TIF_MTLPixelFormatR8Unorm:
	case TIF_MTLPixelFormatR8Snorm:
	case TIF_MTLPixelFormatR8Uint:
	case TIF_MTLPixelFormatR8Sint:
	case TIF_MTLPixelFormatR16Unorm:
	case TIF_MTLPixelFormatR16Snorm:
	case TIF_MTLPixelFormatR16Uint:
	case TIF_MTLPixelFormatR16Sint:
	case TIF_MTLPixelFormatR16Float:
	case TIF_MTLPixelFormatRG8Unorm:
	case TIF_MTLPixelFormatRG8Snorm:
	case TIF_MTLPixelFormatRG8Uint:
	case TIF_MTLPixelFormatRG8Sint:
	case TIF_MTLPixelFormatR32Uint:
	case TIF_MTLPixelFormatR32Sint:
	case TIF_MTLPixelFormatR32Float:
	case TIF_MTLPixelFormatRG16Unorm:
	case TIF_MTLPixelFormatRG16Snorm:
	case TIF_MTLPixelFormatRG16Uint:
	case TIF_MTLPixelFormatRG16Sint:
	case TIF_MTLPixelFormatRG16Float:
	case TIF_MTLPixelFormatRGBA8Unorm:
	case TIF_MTLPixelFormatRGBA8Unorm_sRGB:
	case TIF_MTLPixelFormatRGBA8Snorm:
	case TIF_MTLPixelFormatRGBA8Uint:
	case TIF_MTLPixelFormatRGBA8Sint:
	case TIF_MTLPixelFormatBGRA8Unorm:
	case TIF_MTLPixelFormatBGRA8Unorm_sRGB:
	case TIF_MTLPixelFormatRGB10A2Unorm:
	case TIF_MTLPixelFormatRGB10A2Uint:
	case TIF_MTLPixelFormatRG11B10Float:
	case TIF_MTLPixelFormatRGB9E5Float:
	case TIF_MTLPixelFormatBGR10A2Unorm:
	case TIF_MTLPixelFormatRG32Uint:
	case TIF_MTLPixelFormatRG32Sint:
	case TIF_MTLPixelFormatRG32Float:
	case TIF_MTLPixelFormatRGBA16Unorm:
	case TIF_MTLPixelFormatRGBA16Snorm:
	case TIF_MTLPixelFormatRGBA16Uint:
	case TIF_MTLPixelFormatRGBA16Sint:
	case TIF_MTLPixelFormatRGBA16Float:
	case TIF_MTLPixelFormatRGBA32Uint:
	case TIF_MTLPixelFormatRGBA32Sint:
	case TIF_MTLPixelFormatRGBA32Float:
	case TIF_MTLPixelFormatBC1_RGBA:
	case TIF_MTLPixelFormatBC1_RGBA_sRGB:
	case TIF_MTLPixelFormatBC2_RGBA:
	case TIF_MTLPixelFormatBC2_RGBA_sRGB:
	case TIF_MTLPixelFormatBC3_RGBA:
	case TIF_MTLPixelFormatBC3_RGBA_sRGB:
	case TIF_MTLPixelFormatBC4_RUnorm:
	case TIF_MTLPixelFormatBC4_RSnorm:
	case TIF_MTLPixelFormatBC5_RGUnorm:
	case TIF_MTLPixelFormatBC5_RGSnorm:
	case TIF_MTLPixelFormatBC6H_RGBFloat:
	case TIF_MTLPixelFormatBC6H_RGBUfloat:
	case TIF_MTLPixelFormatBC7_RGBAUnorm:
	case TIF_MTLPixelFormatBC7_RGBAUnorm_sRGB:
	case TIF_MTLPixelFormatGBGR422:
	case TIF_MTLPixelFormatBGRG422:
	case TIF_MTLPixelFormatDepth16Unorm:
	case TIF_MTLPixelFormatDepth32Float:
	case TIF_MTLPixelFormatStencil8:
	case TIF_MTLPixelFormatDepth24Unorm_Stencil8:
	case TIF_MTLPixelFormatDepth32Float_Stencil8:
	case TIF_MTLPixelFormatX32_Stencil8:
	case TIF_MTLPixelFormatX24_Stencil8:
		return true;

	case TIF_MTLPixelFormatBGRA10_XR:
	case TIF_MTLPixelFormatBGRA10_XR_sRGB:
	case TIF_MTLPixelFormatBGR10_XR:
	case TIF_MTLPixelFormatBGR10_XR_sRGB:
	case TIF_MTLPixelFormatB5G6R5Unorm:
	case TIF_MTLPixelFormatA1BGR5Unorm:
	case TIF_MTLPixelFormatABGR4Unorm:
	case TIF_MTLPixelFormatBGR5A1Unorm:
	case TIF_MTLPixelFormatR8Unorm_sRGB:
	case TIF_MTLPixelFormatRG8Unorm_sRGB:
	case TIF_MTLPixelFormatPVRTC_RGB_2BPP:
	case TIF_MTLPixelFormatPVRTC_RGB_2BPP_sRGB:
	case TIF_MTLPixelFormatPVRTC_RGB_4BPP:
	case TIF_MTLPixelFormatPVRTC_RGB_4BPP_sRGB:
	case TIF_MTLPixelFormatPVRTC_RGBA_2BPP:
	case TIF_MTLPixelFormatPVRTC_RGBA_2BPP_sRGB:
	case TIF_MTLPixelFormatPVRTC_RGBA_4BPP:
	case TIF_MTLPixelFormatPVRTC_RGBA_4BPP_sRGB:
	case TIF_MTLPixelFormatEAC_R11Unorm:
	case TIF_MTLPixelFormatEAC_R11Snorm:
	case TIF_MTLPixelFormatEAC_RG11Unorm:
	case TIF_MTLPixelFormatEAC_RG11Snorm:
	case TIF_MTLPixelFormatEAC_RGBA8:
	case TIF_MTLPixelFormatEAC_RGBA8_sRGB:
	case TIF_MTLPixelFormatETC2_RGB8:
	case TIF_MTLPixelFormatETC2_RGB8_sRGB:
	case TIF_MTLPixelFormatETC2_RGB8A1:
	case TIF_MTLPixelFormatETC2_RGB8A1_sRGB:
	case TIF_MTLPixelFormatASTC_4x4_sRGB:
	case TIF_MTLPixelFormatASTC_5x4_sRGB:
	case TIF_MTLPixelFormatASTC_5x5_sRGB:
	case TIF_MTLPixelFormatASTC_6x5_sRGB:
	case TIF_MTLPixelFormatASTC_6x6_sRGB:
	case TIF_MTLPixelFormatASTC_8x5_sRGB:
	case TIF_MTLPixelFormatASTC_8x6_sRGB:
	case TIF_MTLPixelFormatASTC_8x8_sRGB:
	case TIF_MTLPixelFormatASTC_10x5_sRGB:
	case TIF_MTLPixelFormatASTC_10x6_sRGB:
	case TIF_MTLPixelFormatASTC_10x8_sRGB:
	case TIF_MTLPixelFormatASTC_10x10_sRGB:
	case TIF_MTLPixelFormatASTC_12x10_sRGB:
	case TIF_MTLPixelFormatASTC_12x12_sRGB:
	case TIF_MTLPixelFormatASTC_4x4_LDR:
	case TIF_MTLPixelFormatASTC_5x4_LDR:
	case TIF_MTLPixelFormatASTC_5x5_LDR:
	case TIF_MTLPixelFormatASTC_6x5_LDR:
	case TIF_MTLPixelFormatASTC_6x6_LDR:
	case TIF_MTLPixelFormatASTC_8x5_LDR:
	case TIF_MTLPixelFormatASTC_8x6_LDR:
	case TIF_MTLPixelFormatASTC_8x8_LDR:
	case TIF_MTLPixelFormatASTC_10x5_LDR:
	case TIF_MTLPixelFormatASTC_10x6_LDR:
	case TIF_MTLPixelFormatASTC_10x8_LDR:
	case TIF_MTLPixelFormatASTC_10x10_LDR:
	case TIF_MTLPixelFormatASTC_12x10_LDR:
	case TIF_MTLPixelFormatASTC_12x12_LDR:
	case TIF_MTLPixelFormatInvalid: return false;
	}
}

	
inline bool TinyImageFormat_MTLPixelFormatOnIOS(TinyImageFormat_MTLPixelFormat fmt) {
	switch(fmt) {
	case TIF_MTLPixelFormatA8Unorm:
	case TIF_MTLPixelFormatR8Unorm:
	case TIF_MTLPixelFormatR8Snorm:
	case TIF_MTLPixelFormatR8Uint:
	case TIF_MTLPixelFormatR8Sint:
	case TIF_MTLPixelFormatR16Unorm:
	case TIF_MTLPixelFormatR16Snorm:
	case TIF_MTLPixelFormatR16Uint:
	case TIF_MTLPixelFormatR16Sint:
	case TIF_MTLPixelFormatR16Float:
	case TIF_MTLPixelFormatRG8Unorm:
	case TIF_MTLPixelFormatRG8Snorm:
	case TIF_MTLPixelFormatRG8Uint:
	case TIF_MTLPixelFormatRG8Sint:
	case TIF_MTLPixelFormatR32Uint:
	case TIF_MTLPixelFormatR32Sint:
	case TIF_MTLPixelFormatR32Float:
	case TIF_MTLPixelFormatRG16Unorm:
	case TIF_MTLPixelFormatRG16Snorm:
	case TIF_MTLPixelFormatRG16Uint:
	case TIF_MTLPixelFormatRG16Sint:
	case TIF_MTLPixelFormatRG16Float:
	case TIF_MTLPixelFormatRGBA8Unorm:
	case TIF_MTLPixelFormatRGBA8Unorm_sRGB:
	case TIF_MTLPixelFormatRGBA8Snorm:
	case TIF_MTLPixelFormatRGBA8Uint:
	case TIF_MTLPixelFormatRGBA8Sint:
	case TIF_MTLPixelFormatBGRA8Unorm:
	case TIF_MTLPixelFormatBGRA8Unorm_sRGB:
	case TIF_MTLPixelFormatRGB10A2Unorm:
	case TIF_MTLPixelFormatRGB10A2Uint:
	case TIF_MTLPixelFormatRG11B10Float:
	case TIF_MTLPixelFormatRGB9E5Float:
	case TIF_MTLPixelFormatBGR10A2Unorm:
	case TIF_MTLPixelFormatRG32Uint:
	case TIF_MTLPixelFormatRG32Sint:
	case TIF_MTLPixelFormatRG32Float:
	case TIF_MTLPixelFormatRGBA16Unorm:
	case TIF_MTLPixelFormatRGBA16Snorm:
	case TIF_MTLPixelFormatRGBA16Uint:
	case TIF_MTLPixelFormatRGBA16Sint:
	case TIF_MTLPixelFormatRGBA16Float:
	case TIF_MTLPixelFormatRGBA32Uint:
	case TIF_MTLPixelFormatRGBA32Sint:
	case TIF_MTLPixelFormatRGBA32Float:
	case TIF_MTLPixelFormatGBGR422:
	case TIF_MTLPixelFormatBGRG422:
	case TIF_MTLPixelFormatDepth32Float:
	case TIF_MTLPixelFormatStencil8:
	case TIF_MTLPixelFormatDepth32Float_Stencil8:
	case TIF_MTLPixelFormatX32_Stencil8:
	case TIF_MTLPixelFormatBGRA10_XR:
	case TIF_MTLPixelFormatBGRA10_XR_sRGB:
	case TIF_MTLPixelFormatBGR10_XR:
	case TIF_MTLPixelFormatBGR10_XR_sRGB:
	case TIF_MTLPixelFormatPVRTC_RGB_2BPP:
	case TIF_MTLPixelFormatPVRTC_RGB_2BPP_sRGB:
	case TIF_MTLPixelFormatPVRTC_RGB_4BPP:
	case TIF_MTLPixelFormatPVRTC_RGB_4BPP_sRGB:
	case TIF_MTLPixelFormatPVRTC_RGBA_2BPP:
	case TIF_MTLPixelFormatPVRTC_RGBA_2BPP_sRGB:
	case TIF_MTLPixelFormatPVRTC_RGBA_4BPP:
	case TIF_MTLPixelFormatPVRTC_RGBA_4BPP_sRGB:
	case TIF_MTLPixelFormatEAC_R11Unorm:
	case TIF_MTLPixelFormatEAC_R11Snorm:
	case TIF_MTLPixelFormatEAC_RG11Unorm:
	case TIF_MTLPixelFormatEAC_RG11Snorm:
	case TIF_MTLPixelFormatEAC_RGBA8:
	case TIF_MTLPixelFormatEAC_RGBA8_sRGB:
	case TIF_MTLPixelFormatETC2_RGB8:
	case TIF_MTLPixelFormatETC2_RGB8_sRGB:
	case TIF_MTLPixelFormatETC2_RGB8A1:
	case TIF_MTLPixelFormatETC2_RGB8A1_sRGB:
	case TIF_MTLPixelFormatASTC_4x4_sRGB:
	case TIF_MTLPixelFormatASTC_5x4_sRGB:
	case TIF_MTLPixelFormatASTC_5x5_sRGB:
	case TIF_MTLPixelFormatASTC_6x5_sRGB:
	case TIF_MTLPixelFormatASTC_6x6_sRGB:
	case TIF_MTLPixelFormatASTC_8x5_sRGB:
	case TIF_MTLPixelFormatASTC_8x6_sRGB:
	case TIF_MTLPixelFormatASTC_8x8_sRGB:
	case TIF_MTLPixelFormatASTC_10x5_sRGB:
	case TIF_MTLPixelFormatASTC_10x6_sRGB:
	case TIF_MTLPixelFormatASTC_10x8_sRGB:
	case TIF_MTLPixelFormatASTC_10x10_sRGB:
	case TIF_MTLPixelFormatASTC_12x10_sRGB:
	case TIF_MTLPixelFormatASTC_12x12_sRGB:
	case TIF_MTLPixelFormatASTC_4x4_LDR:
	case TIF_MTLPixelFormatASTC_5x4_LDR:
	case TIF_MTLPixelFormatASTC_5x5_LDR:
	case TIF_MTLPixelFormatASTC_6x5_LDR:
	case TIF_MTLPixelFormatASTC_6x6_LDR:
	case TIF_MTLPixelFormatASTC_8x5_LDR:
	case TIF_MTLPixelFormatASTC_8x6_LDR:
	case TIF_MTLPixelFormatASTC_8x8_LDR:
	case TIF_MTLPixelFormatASTC_10x5_LDR:
	case TIF_MTLPixelFormatASTC_10x6_LDR:
	case TIF_MTLPixelFormatASTC_10x8_LDR:
	case TIF_MTLPixelFormatASTC_10x10_LDR:
	case TIF_MTLPixelFormatASTC_12x10_LDR:
	case TIF_MTLPixelFormatASTC_12x12_LDR:
	case TIF_MTLPixelFormatB5G6R5Unorm:
	case TIF_MTLPixelFormatA1BGR5Unorm:
	case TIF_MTLPixelFormatABGR4Unorm:
	case TIF_MTLPixelFormatBGR5A1Unorm:
	case TIF_MTLPixelFormatR8Unorm_sRGB:
	case TIF_MTLPixelFormatRG8Unorm_sRGB:
		return true;

	case TIF_MTLPixelFormatDepth16Unorm:
	case TIF_MTLPixelFormatDepth24Unorm_Stencil8:
	case TIF_MTLPixelFormatX24_Stencil8:
	case TIF_MTLPixelFormatBC1_RGBA:
	case TIF_MTLPixelFormatBC1_RGBA_sRGB:
	case TIF_MTLPixelFormatBC2_RGBA:
	case TIF_MTLPixelFormatBC2_RGBA_sRGB:
	case TIF_MTLPixelFormatBC3_RGBA:
	case TIF_MTLPixelFormatBC3_RGBA_sRGB:
	case TIF_MTLPixelFormatBC4_RUnorm:
	case TIF_MTLPixelFormatBC4_RSnorm:
	case TIF_MTLPixelFormatBC5_RGUnorm:
	case TIF_MTLPixelFormatBC5_RGSnorm:
	case TIF_MTLPixelFormatBC6H_RGBFloat:
	case TIF_MTLPixelFormatBC6H_RGBUfloat:
	case TIF_MTLPixelFormatBC7_RGBAUnorm:
	case TIF_MTLPixelFormatBC7_RGBAUnorm_sRGB:
	case TIF_MTLPixelFormatInvalid: return false;
	}
}
	#undef TIF_CONSTEXPR

//CONFFX
#ifndef TINYIMAGEFORMAT_GLFORMAT
#define TINYIMAGEFORMAT_GLFORMAT

typedef enum TinyImageFormat_GL_FORMAT {
	TIF_GL_FORMAT_UNKNOWN = 0,
	// Types
	TIF_GL_TYPE_COMPRESSED                      = 0x0,
	TIF_GL_TYPE_BYTE                            = 0x1400,
	TIF_GL_TYPE_UNSIGNED_BYTE                   = 0x1401,
	TIF_GL_TYPE_SHORT                           = 0x1402,
	TIF_GL_TYPE_UNSIGNED_SHORT                  = 0x1403,
	TIF_GL_TYPE_INT                             = 0x1404,
	TIF_GL_TYPE_UNSIGNED_INT                    = 0x1405,
	TIF_GL_TYPE_FLOAT                           = 0x1406,
	TIF_GL_TYPE_DOUBLE                          = 0x140A,
	TIF_GL_TYPE_HALF_FLOAT                      = 0x8D61,//OES half float, was 0x140B,
	TIF_GL_TYPE_UNSIGNED_BYTE_3_3_2             = 0x8032,
	TIF_GL_TYPE_UNSIGNED_SHORT_4_4_4_4          = 0x8033,
	TIF_GL_TYPE_UNSIGNED_SHORT_5_5_5_1          = 0x8034,
	TIF_GL_TYPE_UNSIGNED_INT_8_8_8_8            = 0x8035,
	TIF_GL_TYPE_UNSIGNED_INT_10_10_10_2         = 0x8036,
	TIF_GL_TYPE_UNSIGNED_BYTE_2_3_3_REV         = 0x8362,
	TIF_GL_TYPE_UNSIGNED_SHORT_5_6_5            = 0x8363,
	TIF_GL_TYPE_UNSIGNED_SHORT_5_6_5_REV        = 0x8364,
	TIF_GL_TYPE_UNSIGNED_SHORT_4_4_4_4_REV      = 0x8365,
	TIF_GL_TYPE_UNSIGNED_SHORT_1_5_5_5_REV      = 0x8366,
	TIF_GL_TYPE_UNSIGNED_INT_8_8_8_8_REV        = 0x8367,
	TIF_GL_TYPE_UNSIGNED_INT_2_10_10_10_REV     = 0x8368,
	TIF_GL_TYPE_UNSIGNED_INT_24_8               = 0x84FA,
	TIF_GL_TYPE_UNSIGNED_INT_5_9_9_9_REV        = 0x8C3E,
	TIF_GL_TYPE_UNSIGNED_INT_10F_11F_11F_REV    = 0x8C3B,
	TIF_GL_TYPE_FLOAT_32_UNSIGNED_INT_24_8_REV  = 0x8DAD,
	// Formats
	TIF_GL_FORMAT_RED                            = 0x1903,
	TIF_GL_FORMAT_GREEN                          = 0x1904,
	TIF_GL_FORMAT_BLUE                           = 0x1905,
	TIF_GL_FORMAT_ALPHA                          = 0x1906,
	TIF_GL_FORMAT_RGB                            = 0x1907,
	TIF_GL_FORMAT_RGBA                           = 0x1908,
	TIF_GL_FORMAT_LUMINANCE                      = 0x1909,
	TIF_GL_FORMAT_LUMINANCE_ALPHA                = 0x190A,
	TIF_GL_FORMAT_ABGR                           = 0x8000,
	TIF_GL_FORMAT_INTENSITY                      = 0x8049,
	TIF_GL_FORMAT_BGR                            = 0x80E0,
	TIF_GL_FORMAT_BGRA                           = 0x80E1,
	TIF_GL_FORMAT_RG                             = 0x8227,
	TIF_GL_FORMAT_RG_INTEGER                     = 0x8228,
	TIF_GL_FORMAT_SRGB                           = 0x8C40,
	TIF_GL_FORMAT_SRGB_ALPHA                     = 0x8C42,
	TIF_GL_FORMAT_SLUMINANCE_ALPHA               = 0x8C44,
	TIF_GL_FORMAT_SLUMINANCE                     = 0x8C46,
	TIF_GL_FORMAT_RED_INTEGER                    = 0x8D94,
	TIF_GL_FORMAT_GREEN_INTEGER                  = 0x8D95,
	TIF_GL_FORMAT_BLUE_INTEGER                   = 0x8D96,
	TIF_GL_FORMAT_ALPHA_INTEGER                  = 0x8D97,
	TIF_GL_FORMAT_RGB_INTEGER                    = 0x8D98,
	TIF_GL_FORMAT_RGBA_INTEGER                   = 0x8D99,
	TIF_GL_FORMAT_BGR_INTEGER                    = 0x8D9A,
	TIF_GL_FORMAT_BGRA_INTEGER                   = 0x8D9B,
	TIF_GL_FORMAT_RED_SNORM                      = 0x8F90,
	TIF_GL_FORMAT_RG_SNORM                       = 0x8F91,
	TIF_GL_FORMAT_RGB_SNORM                      = 0x8F92,
	TIF_GL_FORMAT_RGBA_SNORM                     = 0x8F93,
	// Internal Formats
	TIF_GL_FORMAT_ALPHA4                         = 0x803B,
	TIF_GL_FORMAT_ALPHA8                         = 0x803C,
	TIF_GL_FORMAT_ALPHA12                        = 0x803D,
	TIF_GL_FORMAT_ALPHA16                        = 0x803E,
	TIF_GL_FORMAT_LUMINANCE4                     = 0x803F,
	TIF_GL_FORMAT_LUMINANCE8                     = 0x8040,
	TIF_GL_FORMAT_LUMINANCE12                    = 0x8041,
	TIF_GL_FORMAT_LUMINANCE16                    = 0x8042,
	TIF_GL_FORMAT_LUMINANCE4_ALPHA4              = 0x8043,
	TIF_GL_FORMAT_LUMINANCE6_ALPHA2              = 0x8044,
	TIF_GL_FORMAT_LUMINANCE8_ALPHA8              = 0x8045,
	TIF_GL_FORMAT_LUMINANCE12_ALPHA4             = 0x8046,
	TIF_GL_FORMAT_LUMINANCE12_ALPHA12            = 0x8047,
	TIF_GL_FORMAT_LUMINANCE16_ALPHA16            = 0x8048,
	TIF_GL_FORMAT_INTENSITY4                     = 0x804A,
	TIF_GL_FORMAT_INTENSITY8                     = 0x804B,
	TIF_GL_FORMAT_INTENSITY12                    = 0x804C,
	TIF_GL_FORMAT_INTENSITY16                    = 0x804D,
	TIF_GL_FORMAT_RGB2                           = 0x804E,
	TIF_GL_FORMAT_RGB4                           = 0x804F,
	TIF_GL_FORMAT_RGB5                           = 0x8050,
	TIF_GL_FORMAT_RGB8                           = 0x8051,
	TIF_GL_FORMAT_RGB10                          = 0x8052,
	TIF_GL_FORMAT_RGB12                          = 0x8053,
	TIF_GL_FORMAT_RGB16                          = 0x8054,
	TIF_GL_FORMAT_RGBA2                          = 0x8055,
	TIF_GL_FORMAT_RGBA4                          = 0x8056,
	TIF_GL_FORMAT_RGB5_A1                        = 0x8057,
	TIF_GL_FORMAT_RGBA8                          = 0x8058,
	TIF_GL_FORMAT_RGB10_A2                       = 0x8059,
	TIF_GL_FORMAT_RGBA12                         = 0x805A,
	TIF_GL_FORMAT_RGBA16                         = 0x805B,
	TIF_GL_FORMAT_R8                             = 0x8229,
	TIF_GL_FORMAT_R16                            = 0x822A,
	TIF_GL_FORMAT_RG8                            = 0x822B,
	TIF_GL_FORMAT_RG16                           = 0x822C,
	TIF_GL_FORMAT_R16F                           = 0x822D,
	TIF_GL_FORMAT_R32F                           = 0x822E,
	TIF_GL_FORMAT_RG16F                          = 0x822F,
	TIF_GL_FORMAT_RG32F                          = 0x8230,
	TIF_GL_FORMAT_R8I                            = 0x8231,
	TIF_GL_FORMAT_R8UI                           = 0x8232,
	TIF_GL_FORMAT_R16I                           = 0x8233,
	TIF_GL_FORMAT_R16UI                          = 0x8234,
	TIF_GL_FORMAT_R32I                           = 0x8235,
	TIF_GL_FORMAT_R32UI                          = 0x8236,
	TIF_GL_FORMAT_RG8I                           = 0x8237,
	TIF_GL_FORMAT_RG8UI                          = 0x8238,
	TIF_GL_FORMAT_RG16I                          = 0x8239,
	TIF_GL_FORMAT_RG16UI                         = 0x823A,
	TIF_GL_FORMAT_RG32I                          = 0x823B,
	TIF_GL_FORMAT_RG32UI                         = 0x823C,
	TIF_GL_FORMAT_RGBA32F                        = 0x8814,
	TIF_GL_FORMAT_RGB32F                         = 0x8815,
	TIF_GL_FORMAT_RGBA16F                        = 0x881A,
	TIF_GL_FORMAT_RGB16F                         = 0x881B,
	TIF_GL_FORMAT_R11F_G11F_B10F                 = 0x8C3A,
	TIF_GL_FORMAT_UNSIGNED_INT_10F_11F_11F_REV   = 0x8C3B,
	TIF_GL_FORMAT_RGB9_E5                        = 0x8C3D,
	TIF_GL_FORMAT_SRGB8                          = 0x8C41,
	TIF_GL_FORMAT_SRGB8_ALPHA8                   = 0x8C43,
	TIF_GL_FORMAT_SLUMINANCE8_ALPHA8             = 0x8C45,
	TIF_GL_FORMAT_SLUMINANCE8                    = 0x8C47,
	TIF_GL_FORMAT_RGB565                         = 0x8D62,
	TIF_GL_FORMAT_RGBA32UI                       = 0x8D70,
	TIF_GL_FORMAT_RGB32UI                        = 0x8D71,
	TIF_GL_FORMAT_RGBA16UI                       = 0x8D76,
	TIF_GL_FORMAT_RGB16UI                        = 0x8D77,
	TIF_GL_FORMAT_RGBA8UI                        = 0x8D7C,
	TIF_GL_FORMAT_RGB8UI                         = 0x8D7D,
	TIF_GL_FORMAT_RGBA32I                        = 0x8D82,
	TIF_GL_FORMAT_RGB32I                         = 0x8D83,
	TIF_GL_FORMAT_RGBA16I                        = 0x8D88,
	TIF_GL_FORMAT_RGB16I                         = 0x8D89,
	TIF_GL_FORMAT_RGBA8I                         = 0x8D8E,
	TIF_GL_FORMAT_RGB8I                          = 0x8D8F,
	TIF_GL_FORMAT_FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD,
	TIF_GL_FORMAT_R8_SNORM                       = 0x8F94,
	TIF_GL_FORMAT_RG8_SNORM                      = 0x8F95,
	TIF_GL_FORMAT_RGB8_SNORM                     = 0x8F96,
	TIF_GL_FORMAT_RGBA8_SNORM                    = 0x8F97,
	TIF_GL_FORMAT_R16_SNORM                      = 0x8F98,
	TIF_GL_FORMAT_RG16_SNORM                     = 0x8F99,
	TIF_GL_FORMAT_RGB16_SNORM                    = 0x8F9A,
	TIF_GL_FORMAT_RGBA16_SNORM                   = 0x8F9B,
	TIF_GL_FORMAT_ALPHA8_SNORM                   = 0x9014,
	TIF_GL_FORMAT_LUMINANCE8_SNORM               = 0x9015,
	TIF_GL_FORMAT_LUMINANCE8_ALPHA8_SNORM        = 0x9016,
	TIF_GL_FORMAT_INTENSITY8_SNORM               = 0x9017,
	TIF_GL_FORMAT_ALPHA16_SNORM                  = 0x9018,
	TIF_GL_FORMAT_LUMINANCE16_SNORM              = 0x9019,
	TIF_GL_FORMAT_LUMINANCE16_ALPHA16_SNORM      = 0x901A,
	TIF_GL_FORMAT_INTENSITY16_SNORM              = 0x901B,
	// Compressed Formats
	TIF_GL_FORMAT_RGBA_ASTC_4x4 = 0x93B0,
	TIF_GL_FORMAT_RGBA_ASTC_5x4 = 0x93B1,
	TIF_GL_FORMAT_RGBA_ASTC_5x5 = 0x93B2,
	TIF_GL_FORMAT_RGBA_ASTC_6x5 = 0x93B3,
	TIF_GL_FORMAT_RGBA_ASTC_6x6 = 0x93B4,
	TIF_GL_FORMAT_RGBA_ASTC_8x5 = 0x93B5,
	TIF_GL_FORMAT_RGBA_ASTC_8x6 = 0x93B6,
	TIF_GL_FORMAT_RGBA_ASTC_8x8 = 0x93B7,
	TIF_GL_FORMAT_RGBA_ASTC_10x5 = 0x93B8,
	TIF_GL_FORMAT_RGBA_ASTC_10x6 = 0x93B9,
	TIF_GL_FORMAT_RGBA_ASTC_10x8 = 0x93BA,
	TIF_GL_FORMAT_RGBA_ASTC_10x10 = 0x93BB,
	TIF_GL_FORMAT_RGBA_ASTC_12x10 = 0x93BC,
	TIF_GL_FORMAT_RGBA_ASTC_12x12 = 0x93BD,
	TIF_GL_FORMAT_SRGB8_ALPHA8_ASTC_4x4 = 0x93D0,
	TIF_GL_FORMAT_SRGB8_ALPHA8_ASTC_5x4 = 0x93D1,
	TIF_GL_FORMAT_SRGB8_ALPHA8_ASTC_5x5 = 0x93D2,
	TIF_GL_FORMAT_SRGB8_ALPHA8_ASTC_6x5 = 0x93D3,
	TIF_GL_FORMAT_SRGB8_ALPHA8_ASTC_6x6 = 0x93D4,
	TIF_GL_FORMAT_SRGB8_ALPHA8_ASTC_8x5 = 0x93D5,
	TIF_GL_FORMAT_SRGB8_ALPHA8_ASTC_8x6 = 0x93D6,
	TIF_GL_FORMAT_SRGB8_ALPHA8_ASTC_8x8 = 0x93D7,
	TIF_GL_FORMAT_SRGB8_ALPHA8_ASTC_10x5 = 0x93D8,
	TIF_GL_FORMAT_SRGB8_ALPHA8_ASTC_10x6 = 0x93D9,
	TIF_GL_FORMAT_SRGB8_ALPHA8_ASTC_10x8 = 0x93DA,
	TIF_GL_FORMAT_SRGB8_ALPHA8_ASTC_10x10 = 0x93DB,
	TIF_GL_FORMAT_SRGB8_ALPHA8_ASTC_12x10 = 0x93DC,
	TIF_GL_FORMAT_SRGB8_ALPHA8_ASTC_12x12 = 0x93DD,
	TIF_GL_FORMAT_RGB_S3TC_DXT1					 = 0x83F0,
	TIF_GL_FORMAT_RGBA_S3TC_DXT1                 = 0x83F1,
	TIF_GL_FORMAT_RGBA_S3TC_DXT3                 = 0x83F2,
	TIF_GL_FORMAT_RGBA_S3TC_DXT5                 = 0x83F3,
	TIF_GL_FORMAT_3DC_X_AMD                      = 0x87F9,
	TIF_GL_FORMAT_3DC_XY_AMD                     = 0x87FA,
	TIF_GL_FORMAT_ATC_RGBA_INTERPOLATED_ALPHA    = 0x87EE,
	TIF_GL_FORMAT_SRGB_PVRTC_2BPPV1              = 0x8A54,
	TIF_GL_FORMAT_SRGB_PVRTC_4BPPV1              = 0x8A55,
	TIF_GL_FORMAT_SRGB_ALPHA_PVRTC_2BPPV1        = 0x8A56,
	TIF_GL_FORMAT_SRGB_ALPHA_PVRTC_4BPPV1        = 0x8A57,
	TIF_GL_FORMAT_RGB_PVRTC_4BPPV1               = 0x8C00,
	TIF_GL_FORMAT_RGB_PVRTC_2BPPV1               = 0x8C01,
	TIF_GL_FORMAT_RGBA_PVRTC_4BPPV1              = 0x8C02,
	TIF_GL_FORMAT_RGBA_PVRTC_2BPPV1              = 0x8C03,
	TIF_GL_FORMAT_SRGB_S3TC_DXT1                 = 0x8C4C,
	TIF_GL_FORMAT_SRGB_ALPHA_S3TC_DXT1           = 0x8C4D,
	TIF_GL_FORMAT_SRGB_ALPHA_S3TC_DXT3           = 0x8C4E,
	TIF_GL_FORMAT_SRGB_ALPHA_S3TC_DXT5           = 0x8C4F,
	TIF_GL_FORMAT_LUMINANCE_LATC1                = 0x8C70,
	TIF_GL_FORMAT_SIGNED_LUMINANCE_LATC1         = 0x8C71,
	TIF_GL_FORMAT_LUMINANCE_ALPHA_LATC2          = 0x8C72,
	TIF_GL_FORMAT_SIGNED_LUMINANCE_ALPHA_LATC2   = 0x8C73,
	TIF_GL_FORMAT_ATC_RGB                        = 0x8C92,
	TIF_GL_FORMAT_ATC_RGBA_EXPLICIT_ALPHA        = 0x8C93,
	TIF_GL_FORMAT_RED_RGTC1                      = 0x8DBB,
	TIF_GL_FORMAT_SIGNED_RED_RGTC1               = 0x8DBC,
	TIF_GL_FORMAT_RED_GREEN_RGTC2                = 0x8DBD,
	TIF_GL_FORMAT_SIGNED_RED_GREEN_RGTC2         = 0x8DBE,
	TIF_GL_FORMAT_ETC1_RGB8_OES                  = 0x8D64,
	TIF_GL_FORMAT_RGBA_BPTC_UNORM                = 0x8E8C,
	TIF_GL_FORMAT_SRGB_ALPHA_BPTC_UNORM          = 0x8E8D,
	TIF_GL_FORMAT_RGB_BPTC_SIGNED_FLOAT          = 0x8E8E,
	TIF_GL_FORMAT_RGB_BPTC_UNSIGNED_FLOAT        = 0x8E8F,
	TIF_GL_FORMAT_R11_EAC                        = 0x9270,
	TIF_GL_FORMAT_SIGNED_R11_EAC                 = 0x9271,
	TIF_GL_FORMAT_RG11_EAC                       = 0x9272,
	TIF_GL_FORMAT_SIGNED_RG11_EAC                = 0x9273,
	TIF_GL_FORMAT_RGB8_ETC2                      = 0x9274,
	TIF_GL_FORMAT_SRGB8_ETC2                     = 0x9275,
	TIF_GL_FORMAT_RGB8_PUNCHTHROUGH_ALPHA1_ETC2  = 0x9276,
	TIF_GL_FORMAT_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277,
	TIF_GL_FORMAT_RGBA8_ETC2_EAC                 = 0x9278,
	TIF_GL_FORMAT_SRGB8_ALPHA8_ETC2_EAC          = 0x9279,
	TIF_GL_FORMAT_SRGB_ALPHA_PVRTC_2BPPV2        = 0x93F0,
	TIF_GL_FORMAT_SRGB_ALPHA_PVRTC_4BPPV2        = 0x93F1,
		// Depth Formats
	TIF_GL_FORMAT_DEPTH_COMPONENT				 = 0x1902,
	TIF_GL_FORMAT_DEPTH_STENCIL					 = 0x84F9,
		// Depth Internal Formats
	TIF_GL_FORMAT_STENCIL_INDEX8				 = 0x8D48,
	TIF_GL_FORMAT_DEPTH_COMPONENT16				 = 0x81A5,
	TIF_GL_FORMAT_DEPTH24_STENCIL8				 = 0x88F0,
	TIF_GL_FORMAT_DEPTH_COMPONENT32F             = 0x8CAC,

} TinyImageFormat_GL_FORMAT;
#endif

#define FT(fmt, type, intfmt, size) *glformat = TIF_GL_FORMAT_##fmt; \
                                    *gltype = TIF_GL_TYPE_##type; \
                                    *glinternalformat = TIF_GL_FORMAT_##intfmt; \
                                    *typesize = size; \
                                    return;
#define FTC(fmt, intfmt) *glformat = TIF_GL_FORMAT_##fmt; \
                                    *gltype = TIF_GL_TYPE_COMPRESSED; \
                                    *glinternalformat = TIF_GL_FORMAT_##intfmt; \
                                    *typesize = 1; \
                                    return;

inline void TinyImageFormat_ToGL_FORMAT(TinyImageFormat fmt, uint32_t *glformat, uint32_t* gltype, uint32_t* glinternalformat, uint32_t* typesize) {
	switch (fmt) 																  
	{																			  
	case TinyImageFormat_UNDEFINED: FT(UNKNOWN, UNSIGNED_SHORT_4_4_4_4, UNKNOWN, 0)

	case TinyImageFormat_R4G4_UNORM: FT(RG, UNSIGNED_SHORT_4_4_4_4, RGB4, 1)
	case TinyImageFormat_R4G4B4A4_UNORM: FT(RGBA, UNSIGNED_SHORT_4_4_4_4, RGBA4, 2)
	case TinyImageFormat_B4G4R4A4_UNORM: FT(BGRA, UNSIGNED_SHORT_4_4_4_4_REV, RGBA4, 2)
	case TinyImageFormat_R5G6B5_UNORM: FT(RGB, UNSIGNED_SHORT_5_6_5_REV, RGB565, 2)
	case TinyImageFormat_B5G6R5_UNORM: FT(BGR, UNSIGNED_SHORT_5_6_5, RGB565, 2)
	case TinyImageFormat_R5G5B5A1_UNORM: FT(RGBA, UNSIGNED_SHORT_5_5_5_1, RGB5_A1, 2)
	case TinyImageFormat_B5G5R5A1_UNORM: FT(BGRA, UNSIGNED_SHORT_5_5_5_1, RGB5_A1, 2)
	case TinyImageFormat_A1R5G5B5_UNORM: FT(RGBA, UNSIGNED_SHORT_1_5_5_5_REV, RGB5_A1, 2)
	case TinyImageFormat_R8_UNORM: FT(LUMINANCE, UNSIGNED_BYTE, R8, 1) // RED -> LUMINANCE For older api's 
	case TinyImageFormat_R8_SNORM: FT(RED, BYTE, R8_SNORM, 1)
	case TinyImageFormat_R8_UINT: FT(RED_INTEGER, UNSIGNED_BYTE, R8UI, 1)
	case TinyImageFormat_R8_SINT: FT(RED_INTEGER, BYTE, R8I, 1)
	case TinyImageFormat_R8_SRGB: FT(SLUMINANCE, UNSIGNED_BYTE, SRGB8, 1)
	case TinyImageFormat_R8G8_UNORM: FT(RG, UNSIGNED_BYTE, RG8, 1)
	case TinyImageFormat_R8G8_SNORM: FT(RG, BYTE, RG8_SNORM, 1)
	case TinyImageFormat_R8G8_UINT: FT(RG_INTEGER, UNSIGNED_BYTE, RG8UI, 1)
	case TinyImageFormat_R8G8_SINT: FT(RG_INTEGER, BYTE, RG8I, 1)
	case TinyImageFormat_R8G8_SRGB: FT(SLUMINANCE_ALPHA, UNSIGNED_BYTE, SRGB8, 1)
	case TinyImageFormat_R8G8B8_UNORM: FT(RGB, UNSIGNED_BYTE, RGB8, 1)
	case TinyImageFormat_R8G8B8_SNORM: FT(RGB, BYTE, RGB8_SNORM, 1)
	case TinyImageFormat_R8G8B8_UINT: FT(RGB_INTEGER, UNSIGNED_BYTE, RGB8UI, 1)
	case TinyImageFormat_R8G8B8_SINT: FT(RGB_INTEGER, BYTE, RGB8I, 1)
	case TinyImageFormat_R8G8B8_SRGB: FT(SRGB, UNSIGNED_BYTE, SRGB8, 1)
	case TinyImageFormat_B8G8R8_UNORM: FT(BGR, UNSIGNED_BYTE, RGB8, 1)
	case TinyImageFormat_B8G8R8_SNORM: FT(BGR, BYTE, RGB8_SNORM, 1)
	case TinyImageFormat_B8G8R8_UINT: FT(BGR_INTEGER, UNSIGNED_BYTE, RGB8UI, 1)
	case TinyImageFormat_B8G8R8_SINT: FT(BGR_INTEGER, BYTE, RGB8I, 1)
	case TinyImageFormat_B8G8R8_SRGB: FT(BGR, UNSIGNED_BYTE, SRGB8, 1)
	case TinyImageFormat_R8G8B8A8_UNORM: FT(RGBA, UNSIGNED_BYTE, RGBA8, 1)
	case TinyImageFormat_R8G8B8A8_SNORM: FT(RGBA, BYTE, RGBA8_SNORM, 1)
	case TinyImageFormat_R8G8B8A8_UINT: FT(RGBA_INTEGER, UNSIGNED_BYTE, RGBA8UI, 1)
	case TinyImageFormat_R8G8B8A8_SINT: FT(RGBA_INTEGER, BYTE, RGBA8I, 1)
	case TinyImageFormat_R8G8B8A8_SRGB: FT(SRGB_ALPHA, UNSIGNED_BYTE, SRGB8, 1)
	case TinyImageFormat_B8G8R8A8_UNORM: FT(BGRA, UNSIGNED_BYTE, RGBA8, 1)
	case TinyImageFormat_B8G8R8A8_SNORM: FT(BGRA, BYTE, RGBA8_SNORM, 1)
	case TinyImageFormat_B8G8R8A8_UINT:  FT(BGRA_INTEGER, UNSIGNED_BYTE, RGBA8UI, 1)
	case TinyImageFormat_B8G8R8A8_SINT:  FT(BGRA_INTEGER, BYTE, RGBA8I, 1)
	case TinyImageFormat_B8G8R8A8_SRGB:  FT(BGRA, UNSIGNED_BYTE, SRGB8, 1)
	case TinyImageFormat_R10G10B10A2_UNORM: FT(RGBA, UNSIGNED_INT_2_10_10_10_REV, RGB10_A2, 4)
	case TinyImageFormat_R10G10B10A2_UINT: FT(RGBA_INTEGER, UNSIGNED_INT_2_10_10_10_REV, RGB10_A2, 4)
	case TinyImageFormat_B10G10R10A2_UNORM: FT(BGRA, UNSIGNED_INT_2_10_10_10_REV, RGB10_A2, 4)
	case TinyImageFormat_B10G10R10A2_UINT: FT(BGRA_INTEGER, UNSIGNED_INT_2_10_10_10_REV, RGB10_A2, 4)
	case TinyImageFormat_R16_UNORM: FT(RED, UNSIGNED_SHORT, R16, 2)
	case TinyImageFormat_R16_SNORM: FT(RED, SHORT, R16_SNORM, 2)
	case TinyImageFormat_R16_UINT: FT(RED_INTEGER, UNSIGNED_SHORT, R16UI, 2)
	case TinyImageFormat_R16_SINT: FT(RED_INTEGER, SHORT, R16I, 2)
	case TinyImageFormat_R16_SFLOAT: FT(RED, HALF_FLOAT, R16F, 2)
	case TinyImageFormat_R16G16_UNORM: FT(RG, UNSIGNED_SHORT, RG16, 2)
	case TinyImageFormat_R16G16_SNORM: FT(RG, SHORT, RG16_SNORM, 2)
	case TinyImageFormat_R16G16_UINT: FT(RG_INTEGER, UNSIGNED_SHORT, RG16UI, 2)
	case TinyImageFormat_R16G16_SINT: FT(RG_INTEGER, SHORT, RG16I, 2)
	case TinyImageFormat_R16G16_SFLOAT: FT(RG, HALF_FLOAT, RG16F, 2)
	case TinyImageFormat_R16G16B16_UNORM: FT(RGB, UNSIGNED_SHORT, RGB16, 2)
	case TinyImageFormat_R16G16B16_SNORM: FT(RGB, SHORT, RGB16_SNORM, 2)
	case TinyImageFormat_R16G16B16_UINT: FT(RGB_INTEGER, UNSIGNED_SHORT, RGB16UI, 2)
	case TinyImageFormat_R16G16B16_SINT: FT(RGB_INTEGER, SHORT, RGB16I, 2)
	case TinyImageFormat_R16G16B16_SFLOAT: FT(RGB, HALF_FLOAT, RGB16F, 2)
	case TinyImageFormat_R16G16B16A16_UNORM: FT(RGBA, UNSIGNED_SHORT, RGBA16, 2)
	case TinyImageFormat_R16G16B16A16_SNORM: FT(RGBA, SHORT, RGBA16_SNORM, 2)
	case TinyImageFormat_R16G16B16A16_UINT: FT(RGBA_INTEGER, UNSIGNED_SHORT, RGBA16UI, 2)
	case TinyImageFormat_R16G16B16A16_SINT: FT(RGBA_INTEGER, SHORT, RGBA16I, 2)
	case TinyImageFormat_R16G16B16A16_SFLOAT: FT(RGBA, HALF_FLOAT, RGBA16F, 2)
	case TinyImageFormat_R32_UINT: FT(RED_INTEGER, UNSIGNED_INT, R32UI, 4)
	case TinyImageFormat_R32_SINT: FT(RED_INTEGER, INT, R32I, 4)
	case TinyImageFormat_R32_SFLOAT: FT(RED, FLOAT, R32F, 4)
	case TinyImageFormat_R32G32_UINT: FT(RG_INTEGER, UNSIGNED_INT, RG32UI, 4)
	case TinyImageFormat_R32G32_SINT: FT(RG_INTEGER, INT, RG32I, 4)
	case TinyImageFormat_R32G32_SFLOAT: FT(RG, FLOAT, RG32F, 4)
	case TinyImageFormat_R32G32B32_UINT: FT(RGB_INTEGER, UNSIGNED_INT, RGB32UI, 4)
	case TinyImageFormat_R32G32B32_SINT: FT(RGB_INTEGER, INT, RGB32I, 4)
	case TinyImageFormat_R32G32B32_SFLOAT: FT(RGB_INTEGER, FLOAT, RGB32F, 4)
	case TinyImageFormat_R32G32B32A32_UINT: FT(RGBA_INTEGER, UNSIGNED_INT, RGBA32UI, 4)
	case TinyImageFormat_R32G32B32A32_SINT: FT(RGBA_INTEGER, INT, RGBA32I, 4)
	case TinyImageFormat_R32G32B32A32_SFLOAT: FT(RGBA, FLOAT, RGBA32F, 4)
	case TinyImageFormat_B10G11R11_UFLOAT: FT(BGR, UNSIGNED_INT_10F_11F_11F_REV, R11F_G11F_B10F, 4)
	case TinyImageFormat_E5B9G9R9_UFLOAT: FT(BGR, UNSIGNED_INT_5_9_9_9_REV, RGB9_E5, 4);

		// Compressed Formats
	case TinyImageFormat_DXBC1_RGB_UNORM: FTC(RGB, RGB_S3TC_DXT1)
	case TinyImageFormat_DXBC1_RGB_SRGB: FTC(RGB, SRGB_S3TC_DXT1)
	case TinyImageFormat_DXBC1_RGBA_UNORM: FTC(RGBA, RGBA_S3TC_DXT1)
	case TinyImageFormat_DXBC1_RGBA_SRGB: FTC(RGBA, SRGB_ALPHA_S3TC_DXT1)
	case TinyImageFormat_DXBC2_UNORM: FTC(RGBA, RGBA_S3TC_DXT3)
	case TinyImageFormat_DXBC2_SRGB: FTC(RGBA, SRGB_ALPHA_S3TC_DXT3)
	case TinyImageFormat_DXBC3_UNORM: FTC(RGBA, RGBA_S3TC_DXT5)
	case TinyImageFormat_DXBC3_SRGB: FTC(RGBA, SRGB_ALPHA_S3TC_DXT5)
	case TinyImageFormat_DXBC4_UNORM: FTC(RED, RED_RGTC1)
	case TinyImageFormat_DXBC4_SNORM: FTC(RED, SIGNED_RED_RGTC1)
	case TinyImageFormat_DXBC5_UNORM: FTC(RG, RED_GREEN_RGTC2)
	case TinyImageFormat_DXBC5_SNORM: FTC(RG, SIGNED_RED_GREEN_RGTC2)
	case TinyImageFormat_DXBC6H_UFLOAT: FTC(RGB, RGB_BPTC_UNSIGNED_FLOAT)
	case TinyImageFormat_DXBC6H_SFLOAT: FTC(RGB, RGB_BPTC_SIGNED_FLOAT)
	case TinyImageFormat_DXBC7_UNORM: FTC(RGBA, RGBA_BPTC_UNORM)
	case TinyImageFormat_DXBC7_SRGB: FTC(RGBA, SRGB_ALPHA_BPTC_UNORM)
	case TinyImageFormat_PVRTC1_2BPP_UNORM: FTC(RGB, RGB_PVRTC_2BPPV1)
	case TinyImageFormat_PVRTC1_4BPP_UNORM: FTC(RGB, RGB_PVRTC_4BPPV1)
	case TinyImageFormat_PVRTC1_2BPP_SRGB: FTC(SRGB, SRGB_PVRTC_2BPPV1)
	case TinyImageFormat_PVRTC1_4BPP_SRGB: FTC(SRGB, SRGB_PVRTC_4BPPV1)

	case TinyImageFormat_ETC2_R8G8B8_UNORM:	FTC(RGB, RGB8_ETC2)
	case TinyImageFormat_ETC2_R8G8B8A1_UNORM: FTC(RGBA, RGB8_PUNCHTHROUGH_ALPHA1_ETC2)
	case TinyImageFormat_ETC2_R8G8B8A8_UNORM: FTC(RGBA, RGBA8_ETC2_EAC)
	case TinyImageFormat_ETC2_R8G8B8_SRGB: FTC(SRGB, SRGB8_ETC2)
	case TinyImageFormat_ETC2_R8G8B8A1_SRGB: FTC(SRGB_ALPHA, SRGB8_PUNCHTHROUGH_ALPHA1_ETC2)
	case TinyImageFormat_ETC2_R8G8B8A8_SRGB: FTC(SRGB_ALPHA, SRGB8_ALPHA8_ETC2_EAC)
	case TinyImageFormat_ETC2_EAC_R11_UNORM: FTC(RED, R11_EAC)
	case TinyImageFormat_ETC2_EAC_R11G11_UNORM: FTC(RG, RG11_EAC)
	case TinyImageFormat_ETC2_EAC_R11_SNORM: FTC(RED, SIGNED_R11_EAC)
	case TinyImageFormat_ETC2_EAC_R11G11_SNORM: FTC(RG, SIGNED_RG11_EAC)
	case TinyImageFormat_ASTC_4x4_UNORM: FTC(RGBA, RGBA_ASTC_4x4)
	case TinyImageFormat_ASTC_4x4_SRGB: FTC(SRGB_ALPHA, SRGB8_ALPHA8_ASTC_4x4)
	case TinyImageFormat_ASTC_5x4_UNORM: FTC(RGBA, RGBA_ASTC_5x4)
	case TinyImageFormat_ASTC_5x4_SRGB: FTC(SRGB_ALPHA, SRGB8_ALPHA8_ASTC_5x4)
	case TinyImageFormat_ASTC_5x5_UNORM: FTC(RGBA, RGBA_ASTC_5x5)
	case TinyImageFormat_ASTC_5x5_SRGB: FTC(SRGB_ALPHA, SRGB8_ALPHA8_ASTC_5x5)
	case TinyImageFormat_ASTC_6x5_UNORM: FTC(RGBA, RGBA_ASTC_6x5)
	case TinyImageFormat_ASTC_6x5_SRGB: FTC(SRGB_ALPHA, SRGB8_ALPHA8_ASTC_6x5)
	case TinyImageFormat_ASTC_6x6_UNORM: FTC(RGBA, RGBA_ASTC_6x6)
	case TinyImageFormat_ASTC_6x6_SRGB: FTC(SRGB_ALPHA, SRGB8_ALPHA8_ASTC_6x6)
	case TinyImageFormat_ASTC_8x5_UNORM: FTC(RGBA, RGBA_ASTC_8x5)
	case TinyImageFormat_ASTC_8x5_SRGB: FTC(SRGB_ALPHA, SRGB8_ALPHA8_ASTC_8x5)
	case TinyImageFormat_ASTC_8x6_UNORM: FTC(RGBA, RGBA_ASTC_8x6)
	case TinyImageFormat_ASTC_8x6_SRGB: FTC(SRGB_ALPHA, SRGB8_ALPHA8_ASTC_8x6)
	case TinyImageFormat_ASTC_8x8_UNORM: FTC(RGBA, RGBA_ASTC_8x8)
	case TinyImageFormat_ASTC_8x8_SRGB: FTC(SRGB_ALPHA, SRGB8_ALPHA8_ASTC_8x8)
	case TinyImageFormat_ASTC_10x5_UNORM: FTC(RGBA, RGBA_ASTC_10x5)
	case TinyImageFormat_ASTC_10x5_SRGB: FTC(SRGB_ALPHA, SRGB8_ALPHA8_ASTC_10x5)
	case TinyImageFormat_ASTC_10x6_UNORM: FTC(RGBA, RGBA_ASTC_10x6)
	case TinyImageFormat_ASTC_10x6_SRGB: FTC(SRGB_ALPHA, SRGB8_ALPHA8_ASTC_10x6)
	case TinyImageFormat_ASTC_10x8_UNORM: FTC(RGBA, RGBA_ASTC_10x8);
	case TinyImageFormat_ASTC_10x8_SRGB: FTC(SRGB_ALPHA, SRGB8_ALPHA8_ASTC_10x8)
	case TinyImageFormat_ASTC_10x10_UNORM: FTC(RGBA, RGBA_ASTC_10x10)
	case TinyImageFormat_ASTC_10x10_SRGB: FTC(SRGB_ALPHA, SRGB8_ALPHA8_ASTC_10x10)
	case TinyImageFormat_ASTC_12x10_UNORM: FTC(RGBA, RGBA_ASTC_12x10)
	case TinyImageFormat_ASTC_12x10_SRGB: FTC(SRGB_ALPHA, SRGB8_ALPHA8_ASTC_12x10)
	case TinyImageFormat_ASTC_12x12_UNORM: FTC(RGBA, RGBA_ASTC_12x12)
	case TinyImageFormat_ASTC_12x12_SRGB: FTC(SRGB_ALPHA, SRGB8_ALPHA8_ASTC_12x12)

		// Depth
	case TinyImageFormat_D32_SFLOAT: FT(DEPTH_COMPONENT, UNSIGNED_INT, DEPTH_COMPONENT32F, 4)
	case TinyImageFormat_D16_UNORM: FT(DEPTH_COMPONENT, UNSIGNED_SHORT, DEPTH_COMPONENT16, 2)
	case TinyImageFormat_S8_UINT: FT(DEPTH_COMPONENT, UNSIGNED_BYTE, STENCIL_INDEX8, 1)
	case TinyImageFormat_D24_UNORM_S8_UINT: FT(DEPTH_STENCIL, UNSIGNED_INT_24_8, DEPTH24_STENCIL8, 4)
	default: FT(UNKNOWN, UNSIGNED_SHORT_4_4_4_4, UNKNOWN, 0)
	}
}
#undef FT
#undef FTC
//CONFFX
#endif // TINYIMAGEFORMAT_APIS_H_