#pragma once

// Error Codes

enum
{
	SCE_GXM_ERROR_UNINITIALIZED = 0x805B0000,
	SCE_GXM_ERROR_ALREADY_INITIALIZED = 0x805B0001,
	SCE_GXM_ERROR_OUT_OF_MEMORY = 0x805B0002,
	SCE_GXM_ERROR_INVALID_VALUE = 0x805B0003,
	SCE_GXM_ERROR_INVALID_POINTER = 0x805B0004,
	SCE_GXM_ERROR_INVALID_ALIGNMENT = 0x805B0005,
	SCE_GXM_ERROR_NOT_WITHIN_SCENE = 0x805B0006,
	SCE_GXM_ERROR_WITHIN_SCENE = 0x805B0007,
	SCE_GXM_ERROR_NULL_PROGRAM = 0x805B0008,
	SCE_GXM_ERROR_UNSUPPORTED = 0x805B0009,
	SCE_GXM_ERROR_PATCHER_INTERNAL = 0x805B000A,
	SCE_GXM_ERROR_RESERVE_FAILED = 0x805B000B,
	SCE_GXM_ERROR_PROGRAM_IN_USE = 0x805B000C,
	SCE_GXM_ERROR_INVALID_INDEX_COUNT = 0x805B000D,
	SCE_GXM_ERROR_INVALID_POLYGON_MODE = 0x805B000E,
	SCE_GXM_ERROR_INVALID_SAMPLER_RESULT_TYPE_PRECISION = 0x805B000F,
	SCE_GXM_ERROR_INVALID_SAMPLER_RESULT_TYPE_COMPONENT_COUNT = 0x805B0010,
	SCE_GXM_ERROR_UNIFORM_BUFFER_NOT_RESERVED = 0x805B0011,
	SCE_GXM_ERROR_INVALID_AUXILIARY_SURFACE = 0x805B0013,
	SCE_GXM_ERROR_INVALID_PRECOMPUTED_DRAW = 0x805B0014,
	SCE_GXM_ERROR_INVALID_PRECOMPUTED_VERTEX_STATE = 0x805B0015,
	SCE_GXM_ERROR_INVALID_PRECOMPUTED_FRAGMENT_STATE = 0x805B0016,
	SCE_GXM_ERROR_DRIVER = 0x805B0017,
};

using SceGxmDisplayQueueCallback = void(vm::cptr<void> callbackData);

struct SceGxmInitializeParams
{
	le_t<u32> flags;
	le_t<u32> displayQueueMaxPendingCount;
	vm::lptr<SceGxmDisplayQueueCallback> displayQueueCallback;
	le_t<u32> displayQueueCallbackDataSize;
	le_t<s32> parameterBufferSize;
};

enum SceGxmMemoryAttribFlags : u32
{
	SCE_GXM_MEMORY_ATTRIB_READ = 1,
	SCE_GXM_MEMORY_ATTRIB_WRITE = 2,
};

enum SceGxmAttributeFormat : u8
{
	SCE_GXM_ATTRIBUTE_FORMAT_U8,
	SCE_GXM_ATTRIBUTE_FORMAT_S8,
	SCE_GXM_ATTRIBUTE_FORMAT_U16,
	SCE_GXM_ATTRIBUTE_FORMAT_S16,
	SCE_GXM_ATTRIBUTE_FORMAT_U8N,
	SCE_GXM_ATTRIBUTE_FORMAT_S8N,
	SCE_GXM_ATTRIBUTE_FORMAT_U16N,
	SCE_GXM_ATTRIBUTE_FORMAT_S16N,
	SCE_GXM_ATTRIBUTE_FORMAT_F16,
	SCE_GXM_ATTRIBUTE_FORMAT_F32
};

enum SceGxmDepthStencilFormat : u32
{
	SCE_GXM_DEPTH_STENCIL_FORMAT_DF32 = 0x00044000u,
	SCE_GXM_DEPTH_STENCIL_FORMAT_S8 = 0x00022000u,
	SCE_GXM_DEPTH_STENCIL_FORMAT_DF32_S8 = 0x00066000u,
	SCE_GXM_DEPTH_STENCIL_FORMAT_S8D24 = 0x01266000u,
	SCE_GXM_DEPTH_STENCIL_FORMAT_D16 = 0x02444000u
};

enum SceGxmPrimitiveType : u32
{
	SCE_GXM_PRIMITIVE_TRIANGLES = 0x00000000u,
	SCE_GXM_PRIMITIVE_LINES = 0x04000000u,
	SCE_GXM_PRIMITIVE_POINTS = 0x08000000u,
	SCE_GXM_PRIMITIVE_TRIANGLE_STRIP = 0x0c000000u,
	SCE_GXM_PRIMITIVE_TRIANGLE_FAN = 0x10000000u,
	SCE_GXM_PRIMITIVE_TRIANGLE_EDGES = 0x14000000u
};

enum SceGxmEdgeEnableFlags : u32
{
	SCE_GXM_EDGE_ENABLE_01 = 0x00000100u,
	SCE_GXM_EDGE_ENABLE_12 = 0x00000200u,
	SCE_GXM_EDGE_ENABLE_20 = 0x00000400u
};

enum SceGxmRegionClipMode : u32
{
	SCE_GXM_REGION_CLIP_NONE = 0x00000000u,
	SCE_GXM_REGION_CLIP_ALL = 0x40000000u,
	SCE_GXM_REGION_CLIP_OUTSIDE = 0x80000000u,
	SCE_GXM_REGION_CLIP_INSIDE = 0xc0000000u
};

enum SceGxmDepthFunc : u32
{
	SCE_GXM_DEPTH_FUNC_NEVER = 0x00000000u,
	SCE_GXM_DEPTH_FUNC_LESS = 0x00400000u,
	SCE_GXM_DEPTH_FUNC_EQUAL = 0x00800000u,
	SCE_GXM_DEPTH_FUNC_LESS_EQUAL = 0x00c00000u,
	SCE_GXM_DEPTH_FUNC_GREATER = 0x01000000u,
	SCE_GXM_DEPTH_FUNC_NOT_EQUAL = 0x01400000u,
	SCE_GXM_DEPTH_FUNC_GREATER_EQUAL = 0x01800000u,
	SCE_GXM_DEPTH_FUNC_ALWAYS = 0x01c00000u
};

enum SceGxmStencilFunc : u32
{
	SCE_GXM_STENCIL_FUNC_NEVER = 0x00000000u,
	SCE_GXM_STENCIL_FUNC_LESS = 0x02000000u,
	SCE_GXM_STENCIL_FUNC_EQUAL = 0x04000000u,
	SCE_GXM_STENCIL_FUNC_LESS_EQUAL = 0x06000000u,
	SCE_GXM_STENCIL_FUNC_GREATER = 0x08000000u,
	SCE_GXM_STENCIL_FUNC_NOT_EQUAL = 0x0a000000u,
	SCE_GXM_STENCIL_FUNC_GREATER_EQUAL = 0x0c000000u,
	SCE_GXM_STENCIL_FUNC_ALWAYS = 0x0e000000u
};

enum SceGxmStencilOp : u32
{
	SCE_GXM_STENCIL_OP_KEEP = 0x00000000u,
	SCE_GXM_STENCIL_OP_ZERO = 0x00000001u,
	SCE_GXM_STENCIL_OP_REPLACE = 0x00000002u,
	SCE_GXM_STENCIL_OP_INCR = 0x00000003u,
	SCE_GXM_STENCIL_OP_DECR = 0x00000004u,
	SCE_GXM_STENCIL_OP_INVERT = 0x00000005u,
	SCE_GXM_STENCIL_OP_INCR_WRAP = 0x00000006u,
	SCE_GXM_STENCIL_OP_DECR_WRAP = 0x00000007u
};

enum SceGxmCullMode : u32
{
	SCE_GXM_CULL_NONE = 0x00000000u,
	SCE_GXM_CULL_CW = 0x00000001u,
	SCE_GXM_CULL_CCW = 0x00000002u
};

enum SceGxmPolygonMode : u32
{
	SCE_GXM_POLYGON_MODE_TRIANGLE_FILL = 0x00000000u,
	SCE_GXM_POLYGON_MODE_LINE = 0x00008000u,
	SCE_GXM_POLYGON_MODE_POINT_10UV = 0x00010000u,
	SCE_GXM_POLYGON_MODE_POINT = 0x00018000u,
	SCE_GXM_POLYGON_MODE_POINT_01UV = 0x00020000u,
	SCE_GXM_POLYGON_MODE_TRIANGLE_LINE = 0x00028000u,
	SCE_GXM_POLYGON_MODE_TRIANGLE_POINT = 0x00030000u
};

enum SceGxmColorSwizzle4Mode : u32
{
	SCE_GXM_COLOR_SWIZZLE4_ABGR = 0x00000000u,
	SCE_GXM_COLOR_SWIZZLE4_ARGB = 0x00100000u,
	SCE_GXM_COLOR_SWIZZLE4_RGBA = 0x00200000u,
	SCE_GXM_COLOR_SWIZZLE4_BGRA = 0x00300000u
};

enum SceGxmColorSwizzle3Mode : u32
{
	SCE_GXM_COLOR_SWIZZLE3_BGR = 0x00000000u,
	SCE_GXM_COLOR_SWIZZLE3_RGB = 0x00100000u
};

enum SceGxmColorSwizzle2Mode : u32
{
	SCE_GXM_COLOR_SWIZZLE2_GR = 0x00000000u,
	SCE_GXM_COLOR_SWIZZLE2_RG = 0x00100000u,
	SCE_GXM_COLOR_SWIZZLE2_RA = 0x00200000u,
	SCE_GXM_COLOR_SWIZZLE2_AR = 0x00300000u
};

enum SceGxmColorSwizzle1Mode : u32
{
	SCE_GXM_COLOR_SWIZZLE1_R = 0x00000000u,
	SCE_GXM_COLOR_SWIZZLE1_G = 0x00100000u,
	SCE_GXM_COLOR_SWIZZLE1_A = 0x00100000u
};

enum SceGxmColorBaseFormat : u32
{
	SCE_GXM_COLOR_BASE_FORMAT_U8U8U8U8 = 0x00000000u,
	SCE_GXM_COLOR_BASE_FORMAT_U8U8U8 = 0x10000000u,
	SCE_GXM_COLOR_BASE_FORMAT_U5U6U5 = 0x30000000u,
	SCE_GXM_COLOR_BASE_FORMAT_U1U5U5U5 = 0x40000000u,
	SCE_GXM_COLOR_BASE_FORMAT_U4U4U4U4 = 0x50000000u,
	SCE_GXM_COLOR_BASE_FORMAT_U8U3U3U2 = 0x60000000u,
	SCE_GXM_COLOR_BASE_FORMAT_F16 = 0xf0000000u,
	SCE_GXM_COLOR_BASE_FORMAT_F16F16 = 0x00800000u,
	SCE_GXM_COLOR_BASE_FORMAT_F32 = 0x10800000u,
	SCE_GXM_COLOR_BASE_FORMAT_S16 = 0x20800000u,
	SCE_GXM_COLOR_BASE_FORMAT_S16S16 = 0x30800000u,
	SCE_GXM_COLOR_BASE_FORMAT_U16 = 0x40800000u,
	SCE_GXM_COLOR_BASE_FORMAT_U16U16 = 0x50800000u,
	SCE_GXM_COLOR_BASE_FORMAT_U2U10U10U10 = 0x60800000u,
	SCE_GXM_COLOR_BASE_FORMAT_U8 = 0x80800000u,
	SCE_GXM_COLOR_BASE_FORMAT_S8 = 0x90800000u,
	SCE_GXM_COLOR_BASE_FORMAT_S5S5U6 = 0xa0800000u,
	SCE_GXM_COLOR_BASE_FORMAT_U8U8 = 0xb0800000u,
	SCE_GXM_COLOR_BASE_FORMAT_S8S8 = 0xc0800000u,
	SCE_GXM_COLOR_BASE_FORMAT_U8S8S8U8 = 0xd0800000u,
	SCE_GXM_COLOR_BASE_FORMAT_S8S8S8S8 = 0xe0800000u,
	SCE_GXM_COLOR_BASE_FORMAT_F16F16F16F16 = 0x01000000u,
	SCE_GXM_COLOR_BASE_FORMAT_F32F32 = 0x11000000u,
	SCE_GXM_COLOR_BASE_FORMAT_F11F11F10 = 0x21000000u,
	SCE_GXM_COLOR_BASE_FORMAT_SE5M9M9M9 = 0x31000000u,
	SCE_GXM_COLOR_BASE_FORMAT_U2F10F10F10 = 0x41000000u
};

enum SceGxmColorFormat : u32
{
	// Supported formats

	SCE_GXM_COLOR_FORMAT_U8U8U8U8_ABGR = SCE_GXM_COLOR_BASE_FORMAT_U8U8U8U8 | SCE_GXM_COLOR_SWIZZLE4_ABGR,
	SCE_GXM_COLOR_FORMAT_U8U8U8U8_ARGB = SCE_GXM_COLOR_BASE_FORMAT_U8U8U8U8 | SCE_GXM_COLOR_SWIZZLE4_ARGB,
	SCE_GXM_COLOR_FORMAT_U8U8U8U8_RGBA = SCE_GXM_COLOR_BASE_FORMAT_U8U8U8U8 | SCE_GXM_COLOR_SWIZZLE4_RGBA,
	SCE_GXM_COLOR_FORMAT_U8U8U8U8_BGRA = SCE_GXM_COLOR_BASE_FORMAT_U8U8U8U8 | SCE_GXM_COLOR_SWIZZLE4_BGRA,

	SCE_GXM_COLOR_FORMAT_U8U8U8_BGR = SCE_GXM_COLOR_BASE_FORMAT_U8U8U8 | SCE_GXM_COLOR_SWIZZLE3_BGR,
	SCE_GXM_COLOR_FORMAT_U8U8U8_RGB = SCE_GXM_COLOR_BASE_FORMAT_U8U8U8 | SCE_GXM_COLOR_SWIZZLE3_RGB,

	SCE_GXM_COLOR_FORMAT_U5U6U5_BGR = SCE_GXM_COLOR_BASE_FORMAT_U5U6U5 | SCE_GXM_COLOR_SWIZZLE3_BGR,
	SCE_GXM_COLOR_FORMAT_U5U6U5_RGB = SCE_GXM_COLOR_BASE_FORMAT_U5U6U5 | SCE_GXM_COLOR_SWIZZLE3_RGB,

	SCE_GXM_COLOR_FORMAT_U1U5U5U5_ABGR = SCE_GXM_COLOR_BASE_FORMAT_U1U5U5U5 | SCE_GXM_COLOR_SWIZZLE4_ABGR,
	SCE_GXM_COLOR_FORMAT_U1U5U5U5_ARGB = SCE_GXM_COLOR_BASE_FORMAT_U1U5U5U5 | SCE_GXM_COLOR_SWIZZLE4_ARGB,
	SCE_GXM_COLOR_FORMAT_U5U5U5U1_RGBA = SCE_GXM_COLOR_BASE_FORMAT_U1U5U5U5 | SCE_GXM_COLOR_SWIZZLE4_RGBA,
	SCE_GXM_COLOR_FORMAT_U5U5U5U1_BGRA = SCE_GXM_COLOR_BASE_FORMAT_U1U5U5U5 | SCE_GXM_COLOR_SWIZZLE4_BGRA,

	SCE_GXM_COLOR_FORMAT_U4U4U4U4_ABGR = SCE_GXM_COLOR_BASE_FORMAT_U4U4U4U4 | SCE_GXM_COLOR_SWIZZLE4_ABGR,
	SCE_GXM_COLOR_FORMAT_U4U4U4U4_ARGB = SCE_GXM_COLOR_BASE_FORMAT_U4U4U4U4 | SCE_GXM_COLOR_SWIZZLE4_ARGB,
	SCE_GXM_COLOR_FORMAT_U4U4U4U4_RGBA = SCE_GXM_COLOR_BASE_FORMAT_U4U4U4U4 | SCE_GXM_COLOR_SWIZZLE4_RGBA,
	SCE_GXM_COLOR_FORMAT_U4U4U4U4_BGRA = SCE_GXM_COLOR_BASE_FORMAT_U4U4U4U4 | SCE_GXM_COLOR_SWIZZLE4_BGRA,

	SCE_GXM_COLOR_FORMAT_U8U3U3U2_ARGB = SCE_GXM_COLOR_BASE_FORMAT_U8U3U3U2,

	SCE_GXM_COLOR_FORMAT_F16_R = SCE_GXM_COLOR_BASE_FORMAT_F16 | SCE_GXM_COLOR_SWIZZLE1_R,
	SCE_GXM_COLOR_FORMAT_F16_G = SCE_GXM_COLOR_BASE_FORMAT_F16 | SCE_GXM_COLOR_SWIZZLE1_G,

	SCE_GXM_COLOR_FORMAT_F16F16_GR = SCE_GXM_COLOR_BASE_FORMAT_F16F16 | SCE_GXM_COLOR_SWIZZLE2_GR,
	SCE_GXM_COLOR_FORMAT_F16F16_RG = SCE_GXM_COLOR_BASE_FORMAT_F16F16 | SCE_GXM_COLOR_SWIZZLE2_RG,

	SCE_GXM_COLOR_FORMAT_F32_R = SCE_GXM_COLOR_BASE_FORMAT_F32 | SCE_GXM_COLOR_SWIZZLE1_R,

	SCE_GXM_COLOR_FORMAT_S16_R = SCE_GXM_COLOR_BASE_FORMAT_S16 | SCE_GXM_COLOR_SWIZZLE1_R,
	SCE_GXM_COLOR_FORMAT_S16_G = SCE_GXM_COLOR_BASE_FORMAT_S16 | SCE_GXM_COLOR_SWIZZLE1_G,

	SCE_GXM_COLOR_FORMAT_S16S16_GR = SCE_GXM_COLOR_BASE_FORMAT_S16S16 | SCE_GXM_COLOR_SWIZZLE2_GR,
	SCE_GXM_COLOR_FORMAT_S16S16_RG = SCE_GXM_COLOR_BASE_FORMAT_S16S16 | SCE_GXM_COLOR_SWIZZLE2_RG,

	SCE_GXM_COLOR_FORMAT_U16_R = SCE_GXM_COLOR_BASE_FORMAT_U16 | SCE_GXM_COLOR_SWIZZLE1_R,
	SCE_GXM_COLOR_FORMAT_U16_G = SCE_GXM_COLOR_BASE_FORMAT_U16 | SCE_GXM_COLOR_SWIZZLE1_G,

	SCE_GXM_COLOR_FORMAT_U16U16_GR = SCE_GXM_COLOR_BASE_FORMAT_U16U16 | SCE_GXM_COLOR_SWIZZLE2_GR,
	SCE_GXM_COLOR_FORMAT_U16U16_RG = SCE_GXM_COLOR_BASE_FORMAT_U16U16 | SCE_GXM_COLOR_SWIZZLE2_RG,

	SCE_GXM_COLOR_FORMAT_U2U10U10U10_ABGR = SCE_GXM_COLOR_BASE_FORMAT_U2U10U10U10 | SCE_GXM_COLOR_SWIZZLE4_ABGR,
	SCE_GXM_COLOR_FORMAT_U2U10U10U10_ARGB = SCE_GXM_COLOR_BASE_FORMAT_U2U10U10U10 | SCE_GXM_COLOR_SWIZZLE4_ARGB,
	SCE_GXM_COLOR_FORMAT_U10U10U10U2_RGBA = SCE_GXM_COLOR_BASE_FORMAT_U2U10U10U10 | SCE_GXM_COLOR_SWIZZLE4_RGBA,
	SCE_GXM_COLOR_FORMAT_U10U10U10U2_BGRA = SCE_GXM_COLOR_BASE_FORMAT_U2U10U10U10 | SCE_GXM_COLOR_SWIZZLE4_BGRA,

	SCE_GXM_COLOR_FORMAT_U8_R = SCE_GXM_COLOR_BASE_FORMAT_U8 | SCE_GXM_COLOR_SWIZZLE1_R,
	SCE_GXM_COLOR_FORMAT_U8_A = SCE_GXM_COLOR_BASE_FORMAT_U8 | SCE_GXM_COLOR_SWIZZLE1_A,

	SCE_GXM_COLOR_FORMAT_S8_R = SCE_GXM_COLOR_BASE_FORMAT_S8 | SCE_GXM_COLOR_SWIZZLE1_R,
	SCE_GXM_COLOR_FORMAT_S8_A = SCE_GXM_COLOR_BASE_FORMAT_S8 | SCE_GXM_COLOR_SWIZZLE1_A,

	SCE_GXM_COLOR_FORMAT_U6S5S5_BGR = SCE_GXM_COLOR_BASE_FORMAT_S5S5U6 | SCE_GXM_COLOR_SWIZZLE3_BGR,
	SCE_GXM_COLOR_FORMAT_S5S5U6_RGB = SCE_GXM_COLOR_BASE_FORMAT_S5S5U6 | SCE_GXM_COLOR_SWIZZLE3_RGB,

	SCE_GXM_COLOR_FORMAT_U8U8_GR = SCE_GXM_COLOR_BASE_FORMAT_U8U8 | SCE_GXM_COLOR_SWIZZLE2_GR,
	SCE_GXM_COLOR_FORMAT_U8U8_RG = SCE_GXM_COLOR_BASE_FORMAT_U8U8 | SCE_GXM_COLOR_SWIZZLE2_RG,
	SCE_GXM_COLOR_FORMAT_U8U8_RA = SCE_GXM_COLOR_BASE_FORMAT_U8U8 | SCE_GXM_COLOR_SWIZZLE2_RA,
	SCE_GXM_COLOR_FORMAT_U8U8_AR = SCE_GXM_COLOR_BASE_FORMAT_U8U8 | SCE_GXM_COLOR_SWIZZLE2_AR,

	SCE_GXM_COLOR_FORMAT_S8S8_GR = SCE_GXM_COLOR_BASE_FORMAT_S8S8 | SCE_GXM_COLOR_SWIZZLE2_GR,
	SCE_GXM_COLOR_FORMAT_S8S8_RG = SCE_GXM_COLOR_BASE_FORMAT_S8S8 | SCE_GXM_COLOR_SWIZZLE2_RG,
	SCE_GXM_COLOR_FORMAT_S8S8_RA = SCE_GXM_COLOR_BASE_FORMAT_S8S8 | SCE_GXM_COLOR_SWIZZLE2_RA,
	SCE_GXM_COLOR_FORMAT_S8S8_AR = SCE_GXM_COLOR_BASE_FORMAT_S8S8 | SCE_GXM_COLOR_SWIZZLE2_AR,

	SCE_GXM_COLOR_FORMAT_U8S8S8U8_ABGR = SCE_GXM_COLOR_BASE_FORMAT_U8S8S8U8 | SCE_GXM_COLOR_SWIZZLE4_ABGR,
	SCE_GXM_COLOR_FORMAT_U8U8S8S8_ARGB = SCE_GXM_COLOR_BASE_FORMAT_U8S8S8U8 | SCE_GXM_COLOR_SWIZZLE4_ARGB,
	SCE_GXM_COLOR_FORMAT_U8S8S8U8_RGBA = SCE_GXM_COLOR_BASE_FORMAT_U8S8S8U8 | SCE_GXM_COLOR_SWIZZLE4_RGBA,
	SCE_GXM_COLOR_FORMAT_S8S8U8U8_BGRA = SCE_GXM_COLOR_BASE_FORMAT_U8S8S8U8 | SCE_GXM_COLOR_SWIZZLE4_BGRA,

	SCE_GXM_COLOR_FORMAT_S8S8S8S8_ABGR = SCE_GXM_COLOR_BASE_FORMAT_S8S8S8S8 | SCE_GXM_COLOR_SWIZZLE4_ABGR,
	SCE_GXM_COLOR_FORMAT_S8S8S8S8_ARGB = SCE_GXM_COLOR_BASE_FORMAT_S8S8S8S8 | SCE_GXM_COLOR_SWIZZLE4_ARGB,
	SCE_GXM_COLOR_FORMAT_S8S8S8S8_RGBA = SCE_GXM_COLOR_BASE_FORMAT_S8S8S8S8 | SCE_GXM_COLOR_SWIZZLE4_RGBA,
	SCE_GXM_COLOR_FORMAT_S8S8S8S8_BGRA = SCE_GXM_COLOR_BASE_FORMAT_S8S8S8S8 | SCE_GXM_COLOR_SWIZZLE4_BGRA,

	SCE_GXM_COLOR_FORMAT_F16F16F16F16_ABGR = SCE_GXM_COLOR_BASE_FORMAT_F16F16F16F16 | SCE_GXM_COLOR_SWIZZLE4_ABGR,
	SCE_GXM_COLOR_FORMAT_F16F16F16F16_ARGB = SCE_GXM_COLOR_BASE_FORMAT_F16F16F16F16 | SCE_GXM_COLOR_SWIZZLE4_ARGB,
	SCE_GXM_COLOR_FORMAT_F16F16F16F16_RGBA = SCE_GXM_COLOR_BASE_FORMAT_F16F16F16F16 | SCE_GXM_COLOR_SWIZZLE4_RGBA,
	SCE_GXM_COLOR_FORMAT_F16F16F16F16_BGRA = SCE_GXM_COLOR_BASE_FORMAT_F16F16F16F16 | SCE_GXM_COLOR_SWIZZLE4_BGRA,

	SCE_GXM_COLOR_FORMAT_F32F32_GR = SCE_GXM_COLOR_BASE_FORMAT_F32F32 | SCE_GXM_COLOR_SWIZZLE2_GR,
	SCE_GXM_COLOR_FORMAT_F32F32_RG = SCE_GXM_COLOR_BASE_FORMAT_F32F32 | SCE_GXM_COLOR_SWIZZLE2_RG,

	SCE_GXM_COLOR_FORMAT_F10F11F11_BGR = SCE_GXM_COLOR_BASE_FORMAT_F11F11F10 | SCE_GXM_COLOR_SWIZZLE3_BGR,
	SCE_GXM_COLOR_FORMAT_F11F11F10_RGB = SCE_GXM_COLOR_BASE_FORMAT_F11F11F10 | SCE_GXM_COLOR_SWIZZLE3_RGB,

	SCE_GXM_COLOR_FORMAT_SE5M9M9M9_BGR = SCE_GXM_COLOR_BASE_FORMAT_SE5M9M9M9 | SCE_GXM_COLOR_SWIZZLE3_BGR,
	SCE_GXM_COLOR_FORMAT_SE5M9M9M9_RGB = SCE_GXM_COLOR_BASE_FORMAT_SE5M9M9M9 | SCE_GXM_COLOR_SWIZZLE3_RGB,

	SCE_GXM_COLOR_FORMAT_U2F10F10F10_ABGR = SCE_GXM_COLOR_BASE_FORMAT_U2F10F10F10 | SCE_GXM_COLOR_SWIZZLE4_ABGR,
	SCE_GXM_COLOR_FORMAT_U2F10F10F10_ARGB = SCE_GXM_COLOR_BASE_FORMAT_U2F10F10F10 | SCE_GXM_COLOR_SWIZZLE4_ARGB,
	SCE_GXM_COLOR_FORMAT_F10F10F10U2_RGBA = SCE_GXM_COLOR_BASE_FORMAT_U2F10F10F10 | SCE_GXM_COLOR_SWIZZLE4_RGBA,
	SCE_GXM_COLOR_FORMAT_F10F10F10U2_BGRA = SCE_GXM_COLOR_BASE_FORMAT_U2F10F10F10 | SCE_GXM_COLOR_SWIZZLE4_BGRA,

	// Legacy formats

	SCE_GXM_COLOR_FORMAT_A8B8G8R8 = SCE_GXM_COLOR_FORMAT_U8U8U8U8_ABGR,
	SCE_GXM_COLOR_FORMAT_A8R8G8B8 = SCE_GXM_COLOR_FORMAT_U8U8U8U8_ARGB,
	SCE_GXM_COLOR_FORMAT_R5G6B5 = SCE_GXM_COLOR_FORMAT_U5U6U5_RGB,
	SCE_GXM_COLOR_FORMAT_A1R5G5B5 = SCE_GXM_COLOR_FORMAT_U1U5U5U5_ARGB,
	SCE_GXM_COLOR_FORMAT_A4R4G4B4 = SCE_GXM_COLOR_FORMAT_U4U4U4U4_ARGB,
	SCE_GXM_COLOR_FORMAT_A8 = SCE_GXM_COLOR_FORMAT_U8_A
};

enum SceGxmColorSurfaceType : u32
{
	SCE_GXM_COLOR_SURFACE_LINEAR = 0x00000000u,
	SCE_GXM_COLOR_SURFACE_TILED = 0x04000000u,
	SCE_GXM_COLOR_SURFACE_SWIZZLED = 0x08000000u
};

enum SceGxmColorSurfaceGammaMode : u32
{
	SCE_GXM_COLOR_SURFACE_GAMMA_NONE = 0x00000000u,
	SCE_GXM_COLOR_SURFACE_GAMMA_R = 0x00001000u,
	SCE_GXM_COLOR_SURFACE_GAMMA_GR = 0x00003000u,
	SCE_GXM_COLOR_SURFACE_GAMMA_BGR = 0x00001000u
};

enum SceGxmColorSurfaceDitherMode : u32
{
	SCE_GXM_COLOR_SURFACE_DITHER_DISABLED = 0x00000000u,
	SCE_GXM_COLOR_SURFACE_DITHER_ENABLED = 0x00000008u
};

enum SceGxmDepthStencilSurfaceType : u32
{
	SCE_GXM_DEPTH_STENCIL_SURFACE_LINEAR = 0x00000000u,
	SCE_GXM_DEPTH_STENCIL_SURFACE_TILED = 0x00011000u
};

enum SceGxmOutputRegisterFormat : s32
{
	SCE_GXM_OUTPUT_REGISTER_FORMAT_DECLARED,
	SCE_GXM_OUTPUT_REGISTER_FORMAT_UCHAR4,
	SCE_GXM_OUTPUT_REGISTER_FORMAT_CHAR4,
	SCE_GXM_OUTPUT_REGISTER_FORMAT_USHORT2,
	SCE_GXM_OUTPUT_REGISTER_FORMAT_SHORT2,
	SCE_GXM_OUTPUT_REGISTER_FORMAT_HALF4,
	SCE_GXM_OUTPUT_REGISTER_FORMAT_HALF2,
	SCE_GXM_OUTPUT_REGISTER_FORMAT_FLOAT2,
	SCE_GXM_OUTPUT_REGISTER_FORMAT_FLOAT
};

enum SceGxmMultisampleMode : u16
{
	SCE_GXM_MULTISAMPLE_NONE,
	SCE_GXM_MULTISAMPLE_2X,
	SCE_GXM_MULTISAMPLE_4X
};

enum SceGxmTextureSwizzle4Mode : u32
{
	SCE_GXM_TEXTURE_SWIZZLE4_ABGR = 0x00000000u,
	SCE_GXM_TEXTURE_SWIZZLE4_ARGB = 0x00001000u,
	SCE_GXM_TEXTURE_SWIZZLE4_RGBA = 0x00002000u,
	SCE_GXM_TEXTURE_SWIZZLE4_BGRA = 0x00003000u,
	SCE_GXM_TEXTURE_SWIZZLE4_1BGR = 0x00004000u,
	SCE_GXM_TEXTURE_SWIZZLE4_1RGB = 0x00005000u,
	SCE_GXM_TEXTURE_SWIZZLE4_RGB1 = 0x00006000u,
	SCE_GXM_TEXTURE_SWIZZLE4_BGR1 = 0x00007000u
};

enum SceGxmTextureSwizzle3Mode : u32
{
	SCE_GXM_TEXTURE_SWIZZLE3_BGR = 0x00000000u,
	SCE_GXM_TEXTURE_SWIZZLE3_RGB = 0x00001000u
};

enum SceGxmTextureSwizzle2Mode : u32
{
	SCE_GXM_TEXTURE_SWIZZLE2_GR = 0x00000000u,
	SCE_GXM_TEXTURE_SWIZZLE2_00GR = 0x00001000u,
	SCE_GXM_TEXTURE_SWIZZLE2_GRRR = 0x00002000u,
	SCE_GXM_TEXTURE_SWIZZLE2_RGGG = 0x00003000u,
	SCE_GXM_TEXTURE_SWIZZLE2_GRGR = 0x00004000u,
	SCE_GXM_TEXTURE_SWIZZLE2_00RG = 0x00005000u
};

enum SceGxmTextureSwizzle2ModeAlt : u32
{
	SCE_GXM_TEXTURE_SWIZZLE2_SD = 0x00000000u,
	SCE_GXM_TEXTURE_SWIZZLE2_DS = 0x00001000u
};

enum SceGxmTextureSwizzle1Mode : u32
{
	SCE_GXM_TEXTURE_SWIZZLE1_R = 0x00000000u,
	SCE_GXM_TEXTURE_SWIZZLE1_000R = 0x00001000u,
	SCE_GXM_TEXTURE_SWIZZLE1_111R = 0x00002000u,
	SCE_GXM_TEXTURE_SWIZZLE1_RRRR = 0x00003000u,
	SCE_GXM_TEXTURE_SWIZZLE1_0RRR = 0x00004000u,
	SCE_GXM_TEXTURE_SWIZZLE1_1RRR = 0x00005000u,
	SCE_GXM_TEXTURE_SWIZZLE1_R000 = 0x00006000u,
	SCE_GXM_TEXTURE_SWIZZLE1_R111 = 0x00007000u
};

enum SceGxmTextureSwizzleYUV422Mode : u32
{
	SCE_GXM_TEXTURE_SWIZZLE_YUYV_CSC0 = 0x00000000u,
	SCE_GXM_TEXTURE_SWIZZLE_YVYU_CSC0 = 0x00001000u,
	SCE_GXM_TEXTURE_SWIZZLE_UYVY_CSC0 = 0x00002000u,
	SCE_GXM_TEXTURE_SWIZZLE_VYUY_CSC0 = 0x00003000u,
	SCE_GXM_TEXTURE_SWIZZLE_YUYV_CSC1 = 0x00004000u,
	SCE_GXM_TEXTURE_SWIZZLE_YVYU_CSC1 = 0x00005000u,
	SCE_GXM_TEXTURE_SWIZZLE_UYVY_CSC1 = 0x00006000u,
	SCE_GXM_TEXTURE_SWIZZLE_VYUY_CSC1 = 0x00007000u
};

enum SceGxmTextureSwizzleYUV420Mode : u32
{
	SCE_GXM_TEXTURE_SWIZZLE_YUV_CSC0 = 0x00000000u,
	SCE_GXM_TEXTURE_SWIZZLE_YVU_CSC0 = 0x00001000u,
	SCE_GXM_TEXTURE_SWIZZLE_YUV_CSC1 = 0x00002000u,
	SCE_GXM_TEXTURE_SWIZZLE_YVU_CSC1 = 0x00003000u
};

enum SceGxmTextureBaseFormat : u32
{
	SCE_GXM_TEXTURE_BASE_FORMAT_U8 = 0x00000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_S8 = 0x01000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_U4U4U4U4 = 0x02000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_U8U3U3U2 = 0x03000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_U1U5U5U5 = 0x04000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_U5U6U5 = 0x05000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_S5S5U6 = 0x06000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_U8U8 = 0x07000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_S8S8 = 0x08000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_U16 = 0x09000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_S16 = 0x0a000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_F16 = 0x0b000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_U8U8U8U8 = 0x0c000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_S8S8S8S8 = 0x0d000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_U2U10U10U10 = 0x0e000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_U16U16 = 0x0f000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_S16S16 = 0x10000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_F16F16 = 0x11000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_F32 = 0x12000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_F32M = 0x13000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_X8S8S8U8 = 0x14000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_X8U24 = 0x15000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_U32 = 0x17000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_S32 = 0x18000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_SE5M9M9M9 = 0x19000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_F11F11F10 = 0x1a000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_F16F16F16F16 = 0x1b000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_U16U16U16U16 = 0x1c000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_S16S16S16S16 = 0x1d000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_F32F32 = 0x1e000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_U32U32 = 0x1f000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_PVRT2BPP = 0x80000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_PVRT4BPP = 0x81000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_PVRTII2BPP = 0x82000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_PVRTII4BPP = 0x83000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_UBC1 = 0x85000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_UBC2 = 0x86000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_UBC3 = 0x87000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_YUV420P2 = 0x90000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_YUV420P3 = 0x91000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_YUV422 = 0x92000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_P4 = 0x94000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_P8 = 0x95000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_U8U8U8 = 0x98000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_S8S8S8 = 0x99000000u,
	SCE_GXM_TEXTURE_BASE_FORMAT_U2F10F10F10 = 0x9a000000u
};

enum SceGxmTextureFormat : u32
{
	// Supported formats

	SCE_GXM_TEXTURE_FORMAT_U8_000R = SCE_GXM_TEXTURE_BASE_FORMAT_U8 | SCE_GXM_TEXTURE_SWIZZLE1_000R,
	SCE_GXM_TEXTURE_FORMAT_U8_111R = SCE_GXM_TEXTURE_BASE_FORMAT_U8 | SCE_GXM_TEXTURE_SWIZZLE1_111R,
	SCE_GXM_TEXTURE_FORMAT_U8_RRRR = SCE_GXM_TEXTURE_BASE_FORMAT_U8 | SCE_GXM_TEXTURE_SWIZZLE1_RRRR,
	SCE_GXM_TEXTURE_FORMAT_U8_0RRR = SCE_GXM_TEXTURE_BASE_FORMAT_U8 | SCE_GXM_TEXTURE_SWIZZLE1_0RRR,
	SCE_GXM_TEXTURE_FORMAT_U8_1RRR = SCE_GXM_TEXTURE_BASE_FORMAT_U8 | SCE_GXM_TEXTURE_SWIZZLE1_1RRR,
	SCE_GXM_TEXTURE_FORMAT_U8_R000 = SCE_GXM_TEXTURE_BASE_FORMAT_U8 | SCE_GXM_TEXTURE_SWIZZLE1_R000,
	SCE_GXM_TEXTURE_FORMAT_U8_R111 = SCE_GXM_TEXTURE_BASE_FORMAT_U8 | SCE_GXM_TEXTURE_SWIZZLE1_R111,
	SCE_GXM_TEXTURE_FORMAT_U8_R = SCE_GXM_TEXTURE_BASE_FORMAT_U8 | SCE_GXM_TEXTURE_SWIZZLE1_R,

	SCE_GXM_TEXTURE_FORMAT_S8_000R = SCE_GXM_TEXTURE_BASE_FORMAT_S8 | SCE_GXM_TEXTURE_SWIZZLE1_000R,
	SCE_GXM_TEXTURE_FORMAT_S8_111R = SCE_GXM_TEXTURE_BASE_FORMAT_S8 | SCE_GXM_TEXTURE_SWIZZLE1_111R,
	SCE_GXM_TEXTURE_FORMAT_S8_RRRR = SCE_GXM_TEXTURE_BASE_FORMAT_S8 | SCE_GXM_TEXTURE_SWIZZLE1_RRRR,
	SCE_GXM_TEXTURE_FORMAT_S8_0RRR = SCE_GXM_TEXTURE_BASE_FORMAT_S8 | SCE_GXM_TEXTURE_SWIZZLE1_0RRR,
	SCE_GXM_TEXTURE_FORMAT_S8_1RRR = SCE_GXM_TEXTURE_BASE_FORMAT_S8 | SCE_GXM_TEXTURE_SWIZZLE1_1RRR,
	SCE_GXM_TEXTURE_FORMAT_S8_R000 = SCE_GXM_TEXTURE_BASE_FORMAT_S8 | SCE_GXM_TEXTURE_SWIZZLE1_R000,
	SCE_GXM_TEXTURE_FORMAT_S8_R111 = SCE_GXM_TEXTURE_BASE_FORMAT_S8 | SCE_GXM_TEXTURE_SWIZZLE1_R111,
	SCE_GXM_TEXTURE_FORMAT_S8_R = SCE_GXM_TEXTURE_BASE_FORMAT_S8 | SCE_GXM_TEXTURE_SWIZZLE1_R,

	SCE_GXM_TEXTURE_FORMAT_U4U4U4U4_ABGR = SCE_GXM_TEXTURE_BASE_FORMAT_U4U4U4U4 | SCE_GXM_TEXTURE_SWIZZLE4_ABGR,
	SCE_GXM_TEXTURE_FORMAT_U4U4U4U4_ARGB = SCE_GXM_TEXTURE_BASE_FORMAT_U4U4U4U4 | SCE_GXM_TEXTURE_SWIZZLE4_ARGB,
	SCE_GXM_TEXTURE_FORMAT_U4U4U4U4_RGBA = SCE_GXM_TEXTURE_BASE_FORMAT_U4U4U4U4 | SCE_GXM_TEXTURE_SWIZZLE4_RGBA,
	SCE_GXM_TEXTURE_FORMAT_U4U4U4U4_BGRA = SCE_GXM_TEXTURE_BASE_FORMAT_U4U4U4U4 | SCE_GXM_TEXTURE_SWIZZLE4_BGRA,
	SCE_GXM_TEXTURE_FORMAT_X4U4U4U4_1BGR = SCE_GXM_TEXTURE_BASE_FORMAT_U4U4U4U4 | SCE_GXM_TEXTURE_SWIZZLE4_1BGR,
	SCE_GXM_TEXTURE_FORMAT_X4U4U4U4_1RGB = SCE_GXM_TEXTURE_BASE_FORMAT_U4U4U4U4 | SCE_GXM_TEXTURE_SWIZZLE4_1RGB,
	SCE_GXM_TEXTURE_FORMAT_U4U4U4X4_RGB1 = SCE_GXM_TEXTURE_BASE_FORMAT_U4U4U4U4 | SCE_GXM_TEXTURE_SWIZZLE4_RGB1,
	SCE_GXM_TEXTURE_FORMAT_U4U4U4X4_BGR1 = SCE_GXM_TEXTURE_BASE_FORMAT_U4U4U4U4 | SCE_GXM_TEXTURE_SWIZZLE4_BGR1,

	SCE_GXM_TEXTURE_FORMAT_U8U3U3U2_ARGB = SCE_GXM_TEXTURE_BASE_FORMAT_U8U3U3U2,

	SCE_GXM_TEXTURE_FORMAT_U1U5U5U5_ABGR = SCE_GXM_TEXTURE_BASE_FORMAT_U1U5U5U5 | SCE_GXM_TEXTURE_SWIZZLE4_ABGR,
	SCE_GXM_TEXTURE_FORMAT_U1U5U5U5_ARGB = SCE_GXM_TEXTURE_BASE_FORMAT_U1U5U5U5 | SCE_GXM_TEXTURE_SWIZZLE4_ARGB,
	SCE_GXM_TEXTURE_FORMAT_U5U5U5U1_RGBA = SCE_GXM_TEXTURE_BASE_FORMAT_U1U5U5U5 | SCE_GXM_TEXTURE_SWIZZLE4_RGBA,
	SCE_GXM_TEXTURE_FORMAT_U5U5U5U1_BGRA = SCE_GXM_TEXTURE_BASE_FORMAT_U1U5U5U5 | SCE_GXM_TEXTURE_SWIZZLE4_BGRA,
	SCE_GXM_TEXTURE_FORMAT_X1U5U5U5_1BGR = SCE_GXM_TEXTURE_BASE_FORMAT_U1U5U5U5 | SCE_GXM_TEXTURE_SWIZZLE4_1BGR,
	SCE_GXM_TEXTURE_FORMAT_X1U5U5U5_1RGB = SCE_GXM_TEXTURE_BASE_FORMAT_U1U5U5U5 | SCE_GXM_TEXTURE_SWIZZLE4_1RGB,
	SCE_GXM_TEXTURE_FORMAT_U5U5U5X1_RGB1 = SCE_GXM_TEXTURE_BASE_FORMAT_U1U5U5U5 | SCE_GXM_TEXTURE_SWIZZLE4_RGB1,
	SCE_GXM_TEXTURE_FORMAT_U5U5U5X1_BGR1 = SCE_GXM_TEXTURE_BASE_FORMAT_U1U5U5U5 | SCE_GXM_TEXTURE_SWIZZLE4_BGR1,

	SCE_GXM_TEXTURE_FORMAT_U5U6U5_BGR = SCE_GXM_TEXTURE_BASE_FORMAT_U5U6U5 | SCE_GXM_TEXTURE_SWIZZLE3_BGR,
	SCE_GXM_TEXTURE_FORMAT_U5U6U5_RGB = SCE_GXM_TEXTURE_BASE_FORMAT_U5U6U5 | SCE_GXM_TEXTURE_SWIZZLE3_RGB,

	SCE_GXM_TEXTURE_FORMAT_U6S5S5_BGR = SCE_GXM_TEXTURE_BASE_FORMAT_S5S5U6 | SCE_GXM_TEXTURE_SWIZZLE3_BGR,
	SCE_GXM_TEXTURE_FORMAT_S5S5U6_RGB = SCE_GXM_TEXTURE_BASE_FORMAT_S5S5U6 | SCE_GXM_TEXTURE_SWIZZLE3_RGB,

	SCE_GXM_TEXTURE_FORMAT_U8U8_00GR = SCE_GXM_TEXTURE_BASE_FORMAT_U8U8 | SCE_GXM_TEXTURE_SWIZZLE2_00GR,
	SCE_GXM_TEXTURE_FORMAT_U8U8_GRRR = SCE_GXM_TEXTURE_BASE_FORMAT_U8U8 | SCE_GXM_TEXTURE_SWIZZLE2_GRRR,
	SCE_GXM_TEXTURE_FORMAT_U8U8_RGGG = SCE_GXM_TEXTURE_BASE_FORMAT_U8U8 | SCE_GXM_TEXTURE_SWIZZLE2_RGGG,
	SCE_GXM_TEXTURE_FORMAT_U8U8_GRGR = SCE_GXM_TEXTURE_BASE_FORMAT_U8U8 | SCE_GXM_TEXTURE_SWIZZLE2_GRGR,
	SCE_GXM_TEXTURE_FORMAT_U8U8_00RG = SCE_GXM_TEXTURE_BASE_FORMAT_U8U8 | SCE_GXM_TEXTURE_SWIZZLE2_00RG,
	SCE_GXM_TEXTURE_FORMAT_U8U8_GR = SCE_GXM_TEXTURE_BASE_FORMAT_U8U8 | SCE_GXM_TEXTURE_SWIZZLE2_GR,

	SCE_GXM_TEXTURE_FORMAT_S8S8_00GR = SCE_GXM_TEXTURE_BASE_FORMAT_S8S8 | SCE_GXM_TEXTURE_SWIZZLE2_00GR,
	SCE_GXM_TEXTURE_FORMAT_S8S8_GRRR = SCE_GXM_TEXTURE_BASE_FORMAT_S8S8 | SCE_GXM_TEXTURE_SWIZZLE2_GRRR,
	SCE_GXM_TEXTURE_FORMAT_S8S8_RGGG = SCE_GXM_TEXTURE_BASE_FORMAT_S8S8 | SCE_GXM_TEXTURE_SWIZZLE2_RGGG,
	SCE_GXM_TEXTURE_FORMAT_S8S8_GRGR = SCE_GXM_TEXTURE_BASE_FORMAT_S8S8 | SCE_GXM_TEXTURE_SWIZZLE2_GRGR,
	SCE_GXM_TEXTURE_FORMAT_S8S8_00RG = SCE_GXM_TEXTURE_BASE_FORMAT_S8S8 | SCE_GXM_TEXTURE_SWIZZLE2_00RG,
	SCE_GXM_TEXTURE_FORMAT_S8S8_GR = SCE_GXM_TEXTURE_BASE_FORMAT_S8S8 | SCE_GXM_TEXTURE_SWIZZLE2_GR,

	SCE_GXM_TEXTURE_FORMAT_U16_000R = SCE_GXM_TEXTURE_BASE_FORMAT_U16 | SCE_GXM_TEXTURE_SWIZZLE1_000R,
	SCE_GXM_TEXTURE_FORMAT_U16_111R = SCE_GXM_TEXTURE_BASE_FORMAT_U16 | SCE_GXM_TEXTURE_SWIZZLE1_111R,
	SCE_GXM_TEXTURE_FORMAT_U16_RRRR = SCE_GXM_TEXTURE_BASE_FORMAT_U16 | SCE_GXM_TEXTURE_SWIZZLE1_RRRR,
	SCE_GXM_TEXTURE_FORMAT_U16_0RRR = SCE_GXM_TEXTURE_BASE_FORMAT_U16 | SCE_GXM_TEXTURE_SWIZZLE1_0RRR,
	SCE_GXM_TEXTURE_FORMAT_U16_1RRR = SCE_GXM_TEXTURE_BASE_FORMAT_U16 | SCE_GXM_TEXTURE_SWIZZLE1_1RRR,
	SCE_GXM_TEXTURE_FORMAT_U16_R000 = SCE_GXM_TEXTURE_BASE_FORMAT_U16 | SCE_GXM_TEXTURE_SWIZZLE1_R000,
	SCE_GXM_TEXTURE_FORMAT_U16_R111 = SCE_GXM_TEXTURE_BASE_FORMAT_U16 | SCE_GXM_TEXTURE_SWIZZLE1_R111,
	SCE_GXM_TEXTURE_FORMAT_U16_R = SCE_GXM_TEXTURE_BASE_FORMAT_U16 | SCE_GXM_TEXTURE_SWIZZLE1_R,

	SCE_GXM_TEXTURE_FORMAT_S16_000R = SCE_GXM_TEXTURE_BASE_FORMAT_S16 | SCE_GXM_TEXTURE_SWIZZLE1_000R,
	SCE_GXM_TEXTURE_FORMAT_S16_111R = SCE_GXM_TEXTURE_BASE_FORMAT_S16 | SCE_GXM_TEXTURE_SWIZZLE1_111R,
	SCE_GXM_TEXTURE_FORMAT_S16_RRRR = SCE_GXM_TEXTURE_BASE_FORMAT_S16 | SCE_GXM_TEXTURE_SWIZZLE1_RRRR,
	SCE_GXM_TEXTURE_FORMAT_S16_0RRR = SCE_GXM_TEXTURE_BASE_FORMAT_S16 | SCE_GXM_TEXTURE_SWIZZLE1_0RRR,
	SCE_GXM_TEXTURE_FORMAT_S16_1RRR = SCE_GXM_TEXTURE_BASE_FORMAT_S16 | SCE_GXM_TEXTURE_SWIZZLE1_1RRR,
	SCE_GXM_TEXTURE_FORMAT_S16_R000 = SCE_GXM_TEXTURE_BASE_FORMAT_S16 | SCE_GXM_TEXTURE_SWIZZLE1_R000,
	SCE_GXM_TEXTURE_FORMAT_S16_R111 = SCE_GXM_TEXTURE_BASE_FORMAT_S16 | SCE_GXM_TEXTURE_SWIZZLE1_R111,
	SCE_GXM_TEXTURE_FORMAT_S16_R = SCE_GXM_TEXTURE_BASE_FORMAT_S16 | SCE_GXM_TEXTURE_SWIZZLE1_R,

	SCE_GXM_TEXTURE_FORMAT_F16_000R = SCE_GXM_TEXTURE_BASE_FORMAT_F16 | SCE_GXM_TEXTURE_SWIZZLE1_000R,
	SCE_GXM_TEXTURE_FORMAT_F16_111R = SCE_GXM_TEXTURE_BASE_FORMAT_F16 | SCE_GXM_TEXTURE_SWIZZLE1_111R,
	SCE_GXM_TEXTURE_FORMAT_F16_RRRR = SCE_GXM_TEXTURE_BASE_FORMAT_F16 | SCE_GXM_TEXTURE_SWIZZLE1_RRRR,
	SCE_GXM_TEXTURE_FORMAT_F16_0RRR = SCE_GXM_TEXTURE_BASE_FORMAT_F16 | SCE_GXM_TEXTURE_SWIZZLE1_0RRR,
	SCE_GXM_TEXTURE_FORMAT_F16_1RRR = SCE_GXM_TEXTURE_BASE_FORMAT_F16 | SCE_GXM_TEXTURE_SWIZZLE1_1RRR,
	SCE_GXM_TEXTURE_FORMAT_F16_R000 = SCE_GXM_TEXTURE_BASE_FORMAT_F16 | SCE_GXM_TEXTURE_SWIZZLE1_R000,
	SCE_GXM_TEXTURE_FORMAT_F16_R111 = SCE_GXM_TEXTURE_BASE_FORMAT_F16 | SCE_GXM_TEXTURE_SWIZZLE1_R111,
	SCE_GXM_TEXTURE_FORMAT_F16_R = SCE_GXM_TEXTURE_BASE_FORMAT_F16 | SCE_GXM_TEXTURE_SWIZZLE1_R,

	SCE_GXM_TEXTURE_FORMAT_U8U8U8U8_ABGR = SCE_GXM_TEXTURE_BASE_FORMAT_U8U8U8U8 | SCE_GXM_TEXTURE_SWIZZLE4_ABGR,
	SCE_GXM_TEXTURE_FORMAT_U8U8U8U8_ARGB = SCE_GXM_TEXTURE_BASE_FORMAT_U8U8U8U8 | SCE_GXM_TEXTURE_SWIZZLE4_ARGB,
	SCE_GXM_TEXTURE_FORMAT_U8U8U8U8_RGBA = SCE_GXM_TEXTURE_BASE_FORMAT_U8U8U8U8 | SCE_GXM_TEXTURE_SWIZZLE4_RGBA,
	SCE_GXM_TEXTURE_FORMAT_U8U8U8U8_BGRA = SCE_GXM_TEXTURE_BASE_FORMAT_U8U8U8U8 | SCE_GXM_TEXTURE_SWIZZLE4_BGRA,
	SCE_GXM_TEXTURE_FORMAT_X8U8U8U8_1BGR = SCE_GXM_TEXTURE_BASE_FORMAT_U8U8U8U8 | SCE_GXM_TEXTURE_SWIZZLE4_1BGR,
	SCE_GXM_TEXTURE_FORMAT_X8U8U8U8_1RGB = SCE_GXM_TEXTURE_BASE_FORMAT_U8U8U8U8 | SCE_GXM_TEXTURE_SWIZZLE4_1RGB,
	SCE_GXM_TEXTURE_FORMAT_U8U8U8X8_RGB1 = SCE_GXM_TEXTURE_BASE_FORMAT_U8U8U8U8 | SCE_GXM_TEXTURE_SWIZZLE4_RGB1,
	SCE_GXM_TEXTURE_FORMAT_U8U8U8X8_BGR1 = SCE_GXM_TEXTURE_BASE_FORMAT_U8U8U8U8 | SCE_GXM_TEXTURE_SWIZZLE4_BGR1,

	SCE_GXM_TEXTURE_FORMAT_S8S8S8S8_ABGR = SCE_GXM_TEXTURE_BASE_FORMAT_S8S8S8S8 | SCE_GXM_TEXTURE_SWIZZLE4_ABGR,
	SCE_GXM_TEXTURE_FORMAT_S8S8S8S8_ARGB = SCE_GXM_TEXTURE_BASE_FORMAT_S8S8S8S8 | SCE_GXM_TEXTURE_SWIZZLE4_ARGB,
	SCE_GXM_TEXTURE_FORMAT_S8S8S8S8_RGBA = SCE_GXM_TEXTURE_BASE_FORMAT_S8S8S8S8 | SCE_GXM_TEXTURE_SWIZZLE4_RGBA,
	SCE_GXM_TEXTURE_FORMAT_S8S8S8S8_BGRA = SCE_GXM_TEXTURE_BASE_FORMAT_S8S8S8S8 | SCE_GXM_TEXTURE_SWIZZLE4_BGRA,
	SCE_GXM_TEXTURE_FORMAT_X8S8S8S8_1BGR = SCE_GXM_TEXTURE_BASE_FORMAT_S8S8S8S8 | SCE_GXM_TEXTURE_SWIZZLE4_1BGR,
	SCE_GXM_TEXTURE_FORMAT_X8S8S8S8_1RGB = SCE_GXM_TEXTURE_BASE_FORMAT_S8S8S8S8 | SCE_GXM_TEXTURE_SWIZZLE4_1RGB,
	SCE_GXM_TEXTURE_FORMAT_S8S8S8X8_RGB1 = SCE_GXM_TEXTURE_BASE_FORMAT_S8S8S8S8 | SCE_GXM_TEXTURE_SWIZZLE4_RGB1,
	SCE_GXM_TEXTURE_FORMAT_S8S8S8X8_BGR1 = SCE_GXM_TEXTURE_BASE_FORMAT_S8S8S8S8 | SCE_GXM_TEXTURE_SWIZZLE4_BGR1,

	SCE_GXM_TEXTURE_FORMAT_U2U10U10U10_ABGR = SCE_GXM_TEXTURE_BASE_FORMAT_U2U10U10U10 | SCE_GXM_TEXTURE_SWIZZLE4_ABGR,
	SCE_GXM_TEXTURE_FORMAT_U2U10U10U10_ARGB = SCE_GXM_TEXTURE_BASE_FORMAT_U2U10U10U10 | SCE_GXM_TEXTURE_SWIZZLE4_ARGB,
	SCE_GXM_TEXTURE_FORMAT_U10U10U10U2_RGBA = SCE_GXM_TEXTURE_BASE_FORMAT_U2U10U10U10 | SCE_GXM_TEXTURE_SWIZZLE4_RGBA,
	SCE_GXM_TEXTURE_FORMAT_U10U10U10U2_BGRA = SCE_GXM_TEXTURE_BASE_FORMAT_U2U10U10U10 | SCE_GXM_TEXTURE_SWIZZLE4_BGRA,
	SCE_GXM_TEXTURE_FORMAT_X2U10U10U10_1BGR = SCE_GXM_TEXTURE_BASE_FORMAT_U2U10U10U10 | SCE_GXM_TEXTURE_SWIZZLE4_1BGR,
	SCE_GXM_TEXTURE_FORMAT_X2U10U10U10_1RGB = SCE_GXM_TEXTURE_BASE_FORMAT_U2U10U10U10 | SCE_GXM_TEXTURE_SWIZZLE4_1RGB,
	SCE_GXM_TEXTURE_FORMAT_U10U10U10X2_RGB1 = SCE_GXM_TEXTURE_BASE_FORMAT_U2U10U10U10 | SCE_GXM_TEXTURE_SWIZZLE4_RGB1,
	SCE_GXM_TEXTURE_FORMAT_U10U10U10X2_BGR1 = SCE_GXM_TEXTURE_BASE_FORMAT_U2U10U10U10 | SCE_GXM_TEXTURE_SWIZZLE4_BGR1,

	SCE_GXM_TEXTURE_FORMAT_U16U16_00GR = SCE_GXM_TEXTURE_BASE_FORMAT_U16U16 | SCE_GXM_TEXTURE_SWIZZLE2_00GR,
	SCE_GXM_TEXTURE_FORMAT_U16U16_GRRR = SCE_GXM_TEXTURE_BASE_FORMAT_U16U16 | SCE_GXM_TEXTURE_SWIZZLE2_GRRR,
	SCE_GXM_TEXTURE_FORMAT_U16U16_RGGG = SCE_GXM_TEXTURE_BASE_FORMAT_U16U16 | SCE_GXM_TEXTURE_SWIZZLE2_RGGG,
	SCE_GXM_TEXTURE_FORMAT_U16U16_GRGR = SCE_GXM_TEXTURE_BASE_FORMAT_U16U16 | SCE_GXM_TEXTURE_SWIZZLE2_GRGR,
	SCE_GXM_TEXTURE_FORMAT_U16U16_00RG = SCE_GXM_TEXTURE_BASE_FORMAT_U16U16 | SCE_GXM_TEXTURE_SWIZZLE2_00RG,
	SCE_GXM_TEXTURE_FORMAT_U16U16_GR = SCE_GXM_TEXTURE_BASE_FORMAT_U16U16 | SCE_GXM_TEXTURE_SWIZZLE2_GR,

	SCE_GXM_TEXTURE_FORMAT_S16S16_00GR = SCE_GXM_TEXTURE_BASE_FORMAT_S16S16 | SCE_GXM_TEXTURE_SWIZZLE2_00GR,
	SCE_GXM_TEXTURE_FORMAT_S16S16_GRRR = SCE_GXM_TEXTURE_BASE_FORMAT_S16S16 | SCE_GXM_TEXTURE_SWIZZLE2_GRRR,
	SCE_GXM_TEXTURE_FORMAT_S16S16_RGGG = SCE_GXM_TEXTURE_BASE_FORMAT_S16S16 | SCE_GXM_TEXTURE_SWIZZLE2_RGGG,
	SCE_GXM_TEXTURE_FORMAT_S16S16_GRGR = SCE_GXM_TEXTURE_BASE_FORMAT_S16S16 | SCE_GXM_TEXTURE_SWIZZLE2_GRGR,
	SCE_GXM_TEXTURE_FORMAT_S16S16_00RG = SCE_GXM_TEXTURE_BASE_FORMAT_S16S16 | SCE_GXM_TEXTURE_SWIZZLE2_00RG,
	SCE_GXM_TEXTURE_FORMAT_S16S16_GR = SCE_GXM_TEXTURE_BASE_FORMAT_S16S16 | SCE_GXM_TEXTURE_SWIZZLE2_GR,

	SCE_GXM_TEXTURE_FORMAT_F16F16_00GR = SCE_GXM_TEXTURE_BASE_FORMAT_F16F16 | SCE_GXM_TEXTURE_SWIZZLE2_00GR,
	SCE_GXM_TEXTURE_FORMAT_F16F16_GRRR = SCE_GXM_TEXTURE_BASE_FORMAT_F16F16 | SCE_GXM_TEXTURE_SWIZZLE2_GRRR,
	SCE_GXM_TEXTURE_FORMAT_F16F16_RGGG = SCE_GXM_TEXTURE_BASE_FORMAT_F16F16 | SCE_GXM_TEXTURE_SWIZZLE2_RGGG,
	SCE_GXM_TEXTURE_FORMAT_F16F16_GRGR = SCE_GXM_TEXTURE_BASE_FORMAT_F16F16 | SCE_GXM_TEXTURE_SWIZZLE2_GRGR,
	SCE_GXM_TEXTURE_FORMAT_F16F16_00RG = SCE_GXM_TEXTURE_BASE_FORMAT_F16F16 | SCE_GXM_TEXTURE_SWIZZLE2_00RG,
	SCE_GXM_TEXTURE_FORMAT_F16F16_GR = SCE_GXM_TEXTURE_BASE_FORMAT_F16F16 | SCE_GXM_TEXTURE_SWIZZLE2_GR,

	SCE_GXM_TEXTURE_FORMAT_F32_000R = SCE_GXM_TEXTURE_BASE_FORMAT_F32 | SCE_GXM_TEXTURE_SWIZZLE1_000R,
	SCE_GXM_TEXTURE_FORMAT_F32_111R = SCE_GXM_TEXTURE_BASE_FORMAT_F32 | SCE_GXM_TEXTURE_SWIZZLE1_111R,
	SCE_GXM_TEXTURE_FORMAT_F32_RRRR = SCE_GXM_TEXTURE_BASE_FORMAT_F32 | SCE_GXM_TEXTURE_SWIZZLE1_RRRR,
	SCE_GXM_TEXTURE_FORMAT_F32_0RRR = SCE_GXM_TEXTURE_BASE_FORMAT_F32 | SCE_GXM_TEXTURE_SWIZZLE1_0RRR,
	SCE_GXM_TEXTURE_FORMAT_F32_1RRR = SCE_GXM_TEXTURE_BASE_FORMAT_F32 | SCE_GXM_TEXTURE_SWIZZLE1_1RRR,
	SCE_GXM_TEXTURE_FORMAT_F32_R000 = SCE_GXM_TEXTURE_BASE_FORMAT_F32 | SCE_GXM_TEXTURE_SWIZZLE1_R000,
	SCE_GXM_TEXTURE_FORMAT_F32_R111 = SCE_GXM_TEXTURE_BASE_FORMAT_F32 | SCE_GXM_TEXTURE_SWIZZLE1_R111,
	SCE_GXM_TEXTURE_FORMAT_F32_R = SCE_GXM_TEXTURE_BASE_FORMAT_F32 | SCE_GXM_TEXTURE_SWIZZLE1_R,

	SCE_GXM_TEXTURE_FORMAT_F32M_000R = SCE_GXM_TEXTURE_BASE_FORMAT_F32M | SCE_GXM_TEXTURE_SWIZZLE1_000R,
	SCE_GXM_TEXTURE_FORMAT_F32M_111R = SCE_GXM_TEXTURE_BASE_FORMAT_F32M | SCE_GXM_TEXTURE_SWIZZLE1_111R,
	SCE_GXM_TEXTURE_FORMAT_F32M_RRRR = SCE_GXM_TEXTURE_BASE_FORMAT_F32M | SCE_GXM_TEXTURE_SWIZZLE1_RRRR,
	SCE_GXM_TEXTURE_FORMAT_F32M_0RRR = SCE_GXM_TEXTURE_BASE_FORMAT_F32M | SCE_GXM_TEXTURE_SWIZZLE1_0RRR,
	SCE_GXM_TEXTURE_FORMAT_F32M_1RRR = SCE_GXM_TEXTURE_BASE_FORMAT_F32M | SCE_GXM_TEXTURE_SWIZZLE1_1RRR,
	SCE_GXM_TEXTURE_FORMAT_F32M_R000 = SCE_GXM_TEXTURE_BASE_FORMAT_F32M | SCE_GXM_TEXTURE_SWIZZLE1_R000,
	SCE_GXM_TEXTURE_FORMAT_F32M_R111 = SCE_GXM_TEXTURE_BASE_FORMAT_F32M | SCE_GXM_TEXTURE_SWIZZLE1_R111,
	SCE_GXM_TEXTURE_FORMAT_F32M_R = SCE_GXM_TEXTURE_BASE_FORMAT_F32M | SCE_GXM_TEXTURE_SWIZZLE1_R,

	SCE_GXM_TEXTURE_FORMAT_X8S8S8U8_1BGR = SCE_GXM_TEXTURE_BASE_FORMAT_X8S8S8U8 | SCE_GXM_TEXTURE_SWIZZLE3_BGR,
	SCE_GXM_TEXTURE_FORMAT_X8U8S8S8_1RGB = SCE_GXM_TEXTURE_BASE_FORMAT_X8S8S8U8 | SCE_GXM_TEXTURE_SWIZZLE3_RGB,

	SCE_GXM_TEXTURE_FORMAT_X8U24_SD = SCE_GXM_TEXTURE_BASE_FORMAT_X8U24 | SCE_GXM_TEXTURE_SWIZZLE2_SD,
	SCE_GXM_TEXTURE_FORMAT_U24X8_DS = SCE_GXM_TEXTURE_BASE_FORMAT_X8U24 | SCE_GXM_TEXTURE_SWIZZLE2_DS,

	SCE_GXM_TEXTURE_FORMAT_U32_000R = SCE_GXM_TEXTURE_BASE_FORMAT_U32 | SCE_GXM_TEXTURE_SWIZZLE1_000R,
	SCE_GXM_TEXTURE_FORMAT_U32_111R = SCE_GXM_TEXTURE_BASE_FORMAT_U32 | SCE_GXM_TEXTURE_SWIZZLE1_111R,
	SCE_GXM_TEXTURE_FORMAT_U32_RRRR = SCE_GXM_TEXTURE_BASE_FORMAT_U32 | SCE_GXM_TEXTURE_SWIZZLE1_RRRR,
	SCE_GXM_TEXTURE_FORMAT_U32_0RRR = SCE_GXM_TEXTURE_BASE_FORMAT_U32 | SCE_GXM_TEXTURE_SWIZZLE1_0RRR,
	SCE_GXM_TEXTURE_FORMAT_U32_1RRR = SCE_GXM_TEXTURE_BASE_FORMAT_U32 | SCE_GXM_TEXTURE_SWIZZLE1_1RRR,
	SCE_GXM_TEXTURE_FORMAT_U32_R000 = SCE_GXM_TEXTURE_BASE_FORMAT_U32 | SCE_GXM_TEXTURE_SWIZZLE1_R000,
	SCE_GXM_TEXTURE_FORMAT_U32_R111 = SCE_GXM_TEXTURE_BASE_FORMAT_U32 | SCE_GXM_TEXTURE_SWIZZLE1_R111,
	SCE_GXM_TEXTURE_FORMAT_U32_R = SCE_GXM_TEXTURE_BASE_FORMAT_U32 | SCE_GXM_TEXTURE_SWIZZLE1_R,

	SCE_GXM_TEXTURE_FORMAT_S32_000R = SCE_GXM_TEXTURE_BASE_FORMAT_S32 | SCE_GXM_TEXTURE_SWIZZLE1_000R,
	SCE_GXM_TEXTURE_FORMAT_S32_111R = SCE_GXM_TEXTURE_BASE_FORMAT_S32 | SCE_GXM_TEXTURE_SWIZZLE1_111R,
	SCE_GXM_TEXTURE_FORMAT_S32_RRRR = SCE_GXM_TEXTURE_BASE_FORMAT_S32 | SCE_GXM_TEXTURE_SWIZZLE1_RRRR,
	SCE_GXM_TEXTURE_FORMAT_S32_0RRR = SCE_GXM_TEXTURE_BASE_FORMAT_S32 | SCE_GXM_TEXTURE_SWIZZLE1_0RRR,
	SCE_GXM_TEXTURE_FORMAT_S32_1RRR = SCE_GXM_TEXTURE_BASE_FORMAT_S32 | SCE_GXM_TEXTURE_SWIZZLE1_1RRR,
	SCE_GXM_TEXTURE_FORMAT_S32_R000 = SCE_GXM_TEXTURE_BASE_FORMAT_S32 | SCE_GXM_TEXTURE_SWIZZLE1_R000,
	SCE_GXM_TEXTURE_FORMAT_S32_R111 = SCE_GXM_TEXTURE_BASE_FORMAT_S32 | SCE_GXM_TEXTURE_SWIZZLE1_R111,
	SCE_GXM_TEXTURE_FORMAT_S32_R = SCE_GXM_TEXTURE_BASE_FORMAT_S32 | SCE_GXM_TEXTURE_SWIZZLE1_R,

	SCE_GXM_TEXTURE_FORMAT_SE5M9M9M9_BGR = SCE_GXM_TEXTURE_BASE_FORMAT_SE5M9M9M9 | SCE_GXM_TEXTURE_SWIZZLE3_BGR,
	SCE_GXM_TEXTURE_FORMAT_SE5M9M9M9_RGB = SCE_GXM_TEXTURE_BASE_FORMAT_SE5M9M9M9 | SCE_GXM_TEXTURE_SWIZZLE3_RGB,

	SCE_GXM_TEXTURE_FORMAT_F10F11F11_BGR = SCE_GXM_TEXTURE_BASE_FORMAT_F11F11F10 | SCE_GXM_TEXTURE_SWIZZLE3_BGR,
	SCE_GXM_TEXTURE_FORMAT_F11F11F10_RGB = SCE_GXM_TEXTURE_BASE_FORMAT_F11F11F10 | SCE_GXM_TEXTURE_SWIZZLE3_RGB,

	SCE_GXM_TEXTURE_FORMAT_F16F16F16F16_ABGR = SCE_GXM_TEXTURE_BASE_FORMAT_F16F16F16F16 | SCE_GXM_TEXTURE_SWIZZLE4_ABGR,
	SCE_GXM_TEXTURE_FORMAT_F16F16F16F16_ARGB = SCE_GXM_TEXTURE_BASE_FORMAT_F16F16F16F16 | SCE_GXM_TEXTURE_SWIZZLE4_ARGB,
	SCE_GXM_TEXTURE_FORMAT_F16F16F16F16_RGBA = SCE_GXM_TEXTURE_BASE_FORMAT_F16F16F16F16 | SCE_GXM_TEXTURE_SWIZZLE4_RGBA,
	SCE_GXM_TEXTURE_FORMAT_F16F16F16F16_BGRA = SCE_GXM_TEXTURE_BASE_FORMAT_F16F16F16F16 | SCE_GXM_TEXTURE_SWIZZLE4_BGRA,
	SCE_GXM_TEXTURE_FORMAT_X16F16F16F16_1BGR = SCE_GXM_TEXTURE_BASE_FORMAT_F16F16F16F16 | SCE_GXM_TEXTURE_SWIZZLE4_1BGR,
	SCE_GXM_TEXTURE_FORMAT_X16F16F16F16_1RGB = SCE_GXM_TEXTURE_BASE_FORMAT_F16F16F16F16 | SCE_GXM_TEXTURE_SWIZZLE4_1RGB,
	SCE_GXM_TEXTURE_FORMAT_F16F16F16X16_RGB1 = SCE_GXM_TEXTURE_BASE_FORMAT_F16F16F16F16 | SCE_GXM_TEXTURE_SWIZZLE4_RGB1,
	SCE_GXM_TEXTURE_FORMAT_F16F16F16X16_BGR1 = SCE_GXM_TEXTURE_BASE_FORMAT_F16F16F16F16 | SCE_GXM_TEXTURE_SWIZZLE4_BGR1,

	SCE_GXM_TEXTURE_FORMAT_U16U16U16U16_ABGR = SCE_GXM_TEXTURE_BASE_FORMAT_U16U16U16U16 | SCE_GXM_TEXTURE_SWIZZLE4_ABGR,
	SCE_GXM_TEXTURE_FORMAT_U16U16U16U16_ARGB = SCE_GXM_TEXTURE_BASE_FORMAT_U16U16U16U16 | SCE_GXM_TEXTURE_SWIZZLE4_ARGB,
	SCE_GXM_TEXTURE_FORMAT_U16U16U16U16_RGBA = SCE_GXM_TEXTURE_BASE_FORMAT_U16U16U16U16 | SCE_GXM_TEXTURE_SWIZZLE4_RGBA,
	SCE_GXM_TEXTURE_FORMAT_U16U16U16U16_BGRA = SCE_GXM_TEXTURE_BASE_FORMAT_U16U16U16U16 | SCE_GXM_TEXTURE_SWIZZLE4_BGRA,
	SCE_GXM_TEXTURE_FORMAT_X16U16U16U16_1BGR = SCE_GXM_TEXTURE_BASE_FORMAT_U16U16U16U16 | SCE_GXM_TEXTURE_SWIZZLE4_1BGR,
	SCE_GXM_TEXTURE_FORMAT_X16U16U16U16_1RGB = SCE_GXM_TEXTURE_BASE_FORMAT_U16U16U16U16 | SCE_GXM_TEXTURE_SWIZZLE4_1RGB,
	SCE_GXM_TEXTURE_FORMAT_U16U16U16X16_RGB1 = SCE_GXM_TEXTURE_BASE_FORMAT_U16U16U16U16 | SCE_GXM_TEXTURE_SWIZZLE4_RGB1,
	SCE_GXM_TEXTURE_FORMAT_U16U16U16X16_BGR1 = SCE_GXM_TEXTURE_BASE_FORMAT_U16U16U16U16 | SCE_GXM_TEXTURE_SWIZZLE4_BGR1,

	SCE_GXM_TEXTURE_FORMAT_S16S16S16S16_ABGR = SCE_GXM_TEXTURE_BASE_FORMAT_S16S16S16S16 | SCE_GXM_TEXTURE_SWIZZLE4_ABGR,
	SCE_GXM_TEXTURE_FORMAT_S16S16S16S16_ARGB = SCE_GXM_TEXTURE_BASE_FORMAT_S16S16S16S16 | SCE_GXM_TEXTURE_SWIZZLE4_ARGB,
	SCE_GXM_TEXTURE_FORMAT_S16S16S16S16_RGBA = SCE_GXM_TEXTURE_BASE_FORMAT_S16S16S16S16 | SCE_GXM_TEXTURE_SWIZZLE4_RGBA,
	SCE_GXM_TEXTURE_FORMAT_S16S16S16S16_BGRA = SCE_GXM_TEXTURE_BASE_FORMAT_S16S16S16S16 | SCE_GXM_TEXTURE_SWIZZLE4_BGRA,
	SCE_GXM_TEXTURE_FORMAT_X16S16S16S16_1BGR = SCE_GXM_TEXTURE_BASE_FORMAT_S16S16S16S16 | SCE_GXM_TEXTURE_SWIZZLE4_1BGR,
	SCE_GXM_TEXTURE_FORMAT_X16S16S16S16_1RGB = SCE_GXM_TEXTURE_BASE_FORMAT_S16S16S16S16 | SCE_GXM_TEXTURE_SWIZZLE4_1RGB,
	SCE_GXM_TEXTURE_FORMAT_S16S16S16X16_RGB1 = SCE_GXM_TEXTURE_BASE_FORMAT_S16S16S16S16 | SCE_GXM_TEXTURE_SWIZZLE4_RGB1,
	SCE_GXM_TEXTURE_FORMAT_S16S16S16X16_BGR1 = SCE_GXM_TEXTURE_BASE_FORMAT_S16S16S16S16 | SCE_GXM_TEXTURE_SWIZZLE4_BGR1,

	SCE_GXM_TEXTURE_FORMAT_F32F32_00GR = SCE_GXM_TEXTURE_BASE_FORMAT_F32F32 | SCE_GXM_TEXTURE_SWIZZLE2_00GR,
	SCE_GXM_TEXTURE_FORMAT_F32F32_GRRR = SCE_GXM_TEXTURE_BASE_FORMAT_F32F32 | SCE_GXM_TEXTURE_SWIZZLE2_GRRR,
	SCE_GXM_TEXTURE_FORMAT_F32F32_RGGG = SCE_GXM_TEXTURE_BASE_FORMAT_F32F32 | SCE_GXM_TEXTURE_SWIZZLE2_RGGG,
	SCE_GXM_TEXTURE_FORMAT_F32F32_GRGR = SCE_GXM_TEXTURE_BASE_FORMAT_F32F32 | SCE_GXM_TEXTURE_SWIZZLE2_GRGR,
	SCE_GXM_TEXTURE_FORMAT_F32F32_00RG = SCE_GXM_TEXTURE_BASE_FORMAT_F32F32 | SCE_GXM_TEXTURE_SWIZZLE2_00RG,
	SCE_GXM_TEXTURE_FORMAT_F32F32_GR = SCE_GXM_TEXTURE_BASE_FORMAT_F32F32 | SCE_GXM_TEXTURE_SWIZZLE2_GR,

	SCE_GXM_TEXTURE_FORMAT_U32U32_00GR = SCE_GXM_TEXTURE_BASE_FORMAT_U32U32 | SCE_GXM_TEXTURE_SWIZZLE2_00GR,
	SCE_GXM_TEXTURE_FORMAT_U32U32_GRRR = SCE_GXM_TEXTURE_BASE_FORMAT_U32U32 | SCE_GXM_TEXTURE_SWIZZLE2_GRRR,
	SCE_GXM_TEXTURE_FORMAT_U32U32_RGGG = SCE_GXM_TEXTURE_BASE_FORMAT_U32U32 | SCE_GXM_TEXTURE_SWIZZLE2_RGGG,
	SCE_GXM_TEXTURE_FORMAT_U32U32_GRGR = SCE_GXM_TEXTURE_BASE_FORMAT_U32U32 | SCE_GXM_TEXTURE_SWIZZLE2_GRGR,
	SCE_GXM_TEXTURE_FORMAT_U32U32_00RG = SCE_GXM_TEXTURE_BASE_FORMAT_U32U32 | SCE_GXM_TEXTURE_SWIZZLE2_00RG,
	SCE_GXM_TEXTURE_FORMAT_U32U32_GR = SCE_GXM_TEXTURE_BASE_FORMAT_U32U32 | SCE_GXM_TEXTURE_SWIZZLE2_GR,

	SCE_GXM_TEXTURE_FORMAT_PVRT2BPP_ABGR = SCE_GXM_TEXTURE_BASE_FORMAT_PVRT2BPP | SCE_GXM_TEXTURE_SWIZZLE4_ABGR,
	SCE_GXM_TEXTURE_FORMAT_PVRT2BPP_1BGR = SCE_GXM_TEXTURE_BASE_FORMAT_PVRT2BPP | SCE_GXM_TEXTURE_SWIZZLE4_1BGR,

	SCE_GXM_TEXTURE_FORMAT_PVRT4BPP_ABGR = SCE_GXM_TEXTURE_BASE_FORMAT_PVRT4BPP | SCE_GXM_TEXTURE_SWIZZLE4_ABGR,
	SCE_GXM_TEXTURE_FORMAT_PVRT4BPP_1BGR = SCE_GXM_TEXTURE_BASE_FORMAT_PVRT4BPP | SCE_GXM_TEXTURE_SWIZZLE4_1BGR,

	SCE_GXM_TEXTURE_FORMAT_PVRTII2BPP_ABGR = SCE_GXM_TEXTURE_BASE_FORMAT_PVRTII2BPP | SCE_GXM_TEXTURE_SWIZZLE4_ABGR,
	SCE_GXM_TEXTURE_FORMAT_PVRTII2BPP_1BGR = SCE_GXM_TEXTURE_BASE_FORMAT_PVRTII2BPP | SCE_GXM_TEXTURE_SWIZZLE4_1BGR,

	SCE_GXM_TEXTURE_FORMAT_PVRTII4BPP_ABGR = SCE_GXM_TEXTURE_BASE_FORMAT_PVRTII4BPP | SCE_GXM_TEXTURE_SWIZZLE4_ABGR,
	SCE_GXM_TEXTURE_FORMAT_PVRTII4BPP_1BGR = SCE_GXM_TEXTURE_BASE_FORMAT_PVRTII4BPP | SCE_GXM_TEXTURE_SWIZZLE4_1BGR,

	SCE_GXM_TEXTURE_FORMAT_UBC1_ABGR = SCE_GXM_TEXTURE_BASE_FORMAT_UBC1 | SCE_GXM_TEXTURE_SWIZZLE4_ABGR,

	SCE_GXM_TEXTURE_FORMAT_UBC2_ABGR = SCE_GXM_TEXTURE_BASE_FORMAT_UBC2 | SCE_GXM_TEXTURE_SWIZZLE4_ABGR,

	SCE_GXM_TEXTURE_FORMAT_UBC3_ABGR = SCE_GXM_TEXTURE_BASE_FORMAT_UBC3 | SCE_GXM_TEXTURE_SWIZZLE4_ABGR,

	SCE_GXM_TEXTURE_FORMAT_YUV420P2_CSC0 = SCE_GXM_TEXTURE_BASE_FORMAT_YUV420P2 | SCE_GXM_TEXTURE_SWIZZLE_YUV_CSC0,
	SCE_GXM_TEXTURE_FORMAT_YVU420P2_CSC0 = SCE_GXM_TEXTURE_BASE_FORMAT_YUV420P2 | SCE_GXM_TEXTURE_SWIZZLE_YVU_CSC0,
	SCE_GXM_TEXTURE_FORMAT_YUV420P2_CSC1 = SCE_GXM_TEXTURE_BASE_FORMAT_YUV420P2 | SCE_GXM_TEXTURE_SWIZZLE_YUV_CSC1,
	SCE_GXM_TEXTURE_FORMAT_YVU420P2_CSC1 = SCE_GXM_TEXTURE_BASE_FORMAT_YUV420P2 | SCE_GXM_TEXTURE_SWIZZLE_YVU_CSC1,

	SCE_GXM_TEXTURE_FORMAT_YUV420P3_CSC0 = SCE_GXM_TEXTURE_BASE_FORMAT_YUV420P3 | SCE_GXM_TEXTURE_SWIZZLE_YUV_CSC0,
	SCE_GXM_TEXTURE_FORMAT_YVU420P3_CSC0 = SCE_GXM_TEXTURE_BASE_FORMAT_YUV420P3 | SCE_GXM_TEXTURE_SWIZZLE_YVU_CSC0,
	SCE_GXM_TEXTURE_FORMAT_YUV420P3_CSC1 = SCE_GXM_TEXTURE_BASE_FORMAT_YUV420P3 | SCE_GXM_TEXTURE_SWIZZLE_YUV_CSC1,
	SCE_GXM_TEXTURE_FORMAT_YVU420P3_CSC1 = SCE_GXM_TEXTURE_BASE_FORMAT_YUV420P3 | SCE_GXM_TEXTURE_SWIZZLE_YVU_CSC1,

	SCE_GXM_TEXTURE_FORMAT_YUYV422_CSC0 = SCE_GXM_TEXTURE_BASE_FORMAT_YUV422 | SCE_GXM_TEXTURE_SWIZZLE_YUYV_CSC0,
	SCE_GXM_TEXTURE_FORMAT_YVYU422_CSC0 = SCE_GXM_TEXTURE_BASE_FORMAT_YUV422 | SCE_GXM_TEXTURE_SWIZZLE_YVYU_CSC0,
	SCE_GXM_TEXTURE_FORMAT_UYVY422_CSC0 = SCE_GXM_TEXTURE_BASE_FORMAT_YUV422 | SCE_GXM_TEXTURE_SWIZZLE_UYVY_CSC0,
	SCE_GXM_TEXTURE_FORMAT_VYUY422_CSC0 = SCE_GXM_TEXTURE_BASE_FORMAT_YUV422 | SCE_GXM_TEXTURE_SWIZZLE_VYUY_CSC0,
	SCE_GXM_TEXTURE_FORMAT_YUYV422_CSC1 = SCE_GXM_TEXTURE_BASE_FORMAT_YUV422 | SCE_GXM_TEXTURE_SWIZZLE_YUYV_CSC1,
	SCE_GXM_TEXTURE_FORMAT_YVYU422_CSC1 = SCE_GXM_TEXTURE_BASE_FORMAT_YUV422 | SCE_GXM_TEXTURE_SWIZZLE_YVYU_CSC1,
	SCE_GXM_TEXTURE_FORMAT_UYVY422_CSC1 = SCE_GXM_TEXTURE_BASE_FORMAT_YUV422 | SCE_GXM_TEXTURE_SWIZZLE_UYVY_CSC1,
	SCE_GXM_TEXTURE_FORMAT_VYUY422_CSC1 = SCE_GXM_TEXTURE_BASE_FORMAT_YUV422 | SCE_GXM_TEXTURE_SWIZZLE_VYUY_CSC1,

	SCE_GXM_TEXTURE_FORMAT_P4_ABGR = SCE_GXM_TEXTURE_BASE_FORMAT_P4 | SCE_GXM_TEXTURE_SWIZZLE4_ABGR,
	SCE_GXM_TEXTURE_FORMAT_P4_ARGB = SCE_GXM_TEXTURE_BASE_FORMAT_P4 | SCE_GXM_TEXTURE_SWIZZLE4_ARGB,
	SCE_GXM_TEXTURE_FORMAT_P4_RGBA = SCE_GXM_TEXTURE_BASE_FORMAT_P4 | SCE_GXM_TEXTURE_SWIZZLE4_RGBA,
	SCE_GXM_TEXTURE_FORMAT_P4_BGRA = SCE_GXM_TEXTURE_BASE_FORMAT_P4 | SCE_GXM_TEXTURE_SWIZZLE4_BGRA,
	SCE_GXM_TEXTURE_FORMAT_P4_1BGR = SCE_GXM_TEXTURE_BASE_FORMAT_P4 | SCE_GXM_TEXTURE_SWIZZLE4_1BGR,
	SCE_GXM_TEXTURE_FORMAT_P4_1RGB = SCE_GXM_TEXTURE_BASE_FORMAT_P4 | SCE_GXM_TEXTURE_SWIZZLE4_1RGB,
	SCE_GXM_TEXTURE_FORMAT_P4_RGB1 = SCE_GXM_TEXTURE_BASE_FORMAT_P4 | SCE_GXM_TEXTURE_SWIZZLE4_RGB1,
	SCE_GXM_TEXTURE_FORMAT_P4_BGR1 = SCE_GXM_TEXTURE_BASE_FORMAT_P4 | SCE_GXM_TEXTURE_SWIZZLE4_BGR1,

	SCE_GXM_TEXTURE_FORMAT_P8_ABGR = SCE_GXM_TEXTURE_BASE_FORMAT_P8 | SCE_GXM_TEXTURE_SWIZZLE4_ABGR,
	SCE_GXM_TEXTURE_FORMAT_P8_ARGB = SCE_GXM_TEXTURE_BASE_FORMAT_P8 | SCE_GXM_TEXTURE_SWIZZLE4_ARGB,
	SCE_GXM_TEXTURE_FORMAT_P8_RGBA = SCE_GXM_TEXTURE_BASE_FORMAT_P8 | SCE_GXM_TEXTURE_SWIZZLE4_RGBA,
	SCE_GXM_TEXTURE_FORMAT_P8_BGRA = SCE_GXM_TEXTURE_BASE_FORMAT_P8 | SCE_GXM_TEXTURE_SWIZZLE4_BGRA,
	SCE_GXM_TEXTURE_FORMAT_P8_1BGR = SCE_GXM_TEXTURE_BASE_FORMAT_P8 | SCE_GXM_TEXTURE_SWIZZLE4_1BGR,
	SCE_GXM_TEXTURE_FORMAT_P8_1RGB = SCE_GXM_TEXTURE_BASE_FORMAT_P8 | SCE_GXM_TEXTURE_SWIZZLE4_1RGB,
	SCE_GXM_TEXTURE_FORMAT_P8_RGB1 = SCE_GXM_TEXTURE_BASE_FORMAT_P8 | SCE_GXM_TEXTURE_SWIZZLE4_RGB1,
	SCE_GXM_TEXTURE_FORMAT_P8_BGR1 = SCE_GXM_TEXTURE_BASE_FORMAT_P8 | SCE_GXM_TEXTURE_SWIZZLE4_BGR1,

	SCE_GXM_TEXTURE_FORMAT_U8U8U8_BGR = SCE_GXM_TEXTURE_BASE_FORMAT_U8U8U8 | SCE_GXM_TEXTURE_SWIZZLE3_BGR,
	SCE_GXM_TEXTURE_FORMAT_U8U8U8_RGB = SCE_GXM_TEXTURE_BASE_FORMAT_U8U8U8 | SCE_GXM_TEXTURE_SWIZZLE3_RGB,

	SCE_GXM_TEXTURE_FORMAT_S8S8S8_BGR = SCE_GXM_TEXTURE_BASE_FORMAT_S8S8S8 | SCE_GXM_TEXTURE_SWIZZLE3_BGR,
	SCE_GXM_TEXTURE_FORMAT_S8S8S8_RGB = SCE_GXM_TEXTURE_BASE_FORMAT_S8S8S8 | SCE_GXM_TEXTURE_SWIZZLE3_RGB,

	SCE_GXM_TEXTURE_FORMAT_U2F10F10F10_ABGR = SCE_GXM_TEXTURE_BASE_FORMAT_U2F10F10F10 | SCE_GXM_TEXTURE_SWIZZLE4_ABGR,
	SCE_GXM_TEXTURE_FORMAT_U2F10F10F10_ARGB = SCE_GXM_TEXTURE_BASE_FORMAT_U2F10F10F10 | SCE_GXM_TEXTURE_SWIZZLE4_ARGB,
	SCE_GXM_TEXTURE_FORMAT_F10F10F10U2_RGBA = SCE_GXM_TEXTURE_BASE_FORMAT_U2F10F10F10 | SCE_GXM_TEXTURE_SWIZZLE4_RGBA,
	SCE_GXM_TEXTURE_FORMAT_F10F10F10U2_BGRA = SCE_GXM_TEXTURE_BASE_FORMAT_U2F10F10F10 | SCE_GXM_TEXTURE_SWIZZLE4_BGRA,
	SCE_GXM_TEXTURE_FORMAT_X2F10F10F10_1BGR = SCE_GXM_TEXTURE_BASE_FORMAT_U2F10F10F10 | SCE_GXM_TEXTURE_SWIZZLE4_1BGR,
	SCE_GXM_TEXTURE_FORMAT_X2F10F10F10_1RGB = SCE_GXM_TEXTURE_BASE_FORMAT_U2F10F10F10 | SCE_GXM_TEXTURE_SWIZZLE4_1RGB,
	SCE_GXM_TEXTURE_FORMAT_F10F10F10X2_RGB1 = SCE_GXM_TEXTURE_BASE_FORMAT_U2F10F10F10 | SCE_GXM_TEXTURE_SWIZZLE4_RGB1,
	SCE_GXM_TEXTURE_FORMAT_F10F10F10X2_BGR1 = SCE_GXM_TEXTURE_BASE_FORMAT_U2F10F10F10 | SCE_GXM_TEXTURE_SWIZZLE4_BGR1,

	// Legacy formats

	SCE_GXM_TEXTURE_FORMAT_L8 = SCE_GXM_TEXTURE_FORMAT_U8_1RRR,
	SCE_GXM_TEXTURE_FORMAT_A8 = SCE_GXM_TEXTURE_FORMAT_U8_R000,
	SCE_GXM_TEXTURE_FORMAT_R8 = SCE_GXM_TEXTURE_FORMAT_U8_000R,
	SCE_GXM_TEXTURE_FORMAT_A4R4G4B4 = SCE_GXM_TEXTURE_FORMAT_U4U4U4U4_ARGB,
	SCE_GXM_TEXTURE_FORMAT_A1R5G5B5 = SCE_GXM_TEXTURE_FORMAT_U1U5U5U5_ARGB,
	SCE_GXM_TEXTURE_FORMAT_R5G6B5 = SCE_GXM_TEXTURE_FORMAT_U5U6U5_RGB,
	SCE_GXM_TEXTURE_FORMAT_A8L8 = SCE_GXM_TEXTURE_FORMAT_U8U8_GRRR,
	SCE_GXM_TEXTURE_FORMAT_L8A8 = SCE_GXM_TEXTURE_FORMAT_U8U8_RGGG,
	SCE_GXM_TEXTURE_FORMAT_G8R8 = SCE_GXM_TEXTURE_FORMAT_U8U8_00GR,
	SCE_GXM_TEXTURE_FORMAT_L16 = SCE_GXM_TEXTURE_FORMAT_U16_1RRR,
	SCE_GXM_TEXTURE_FORMAT_A16 = SCE_GXM_TEXTURE_FORMAT_U16_R000,
	SCE_GXM_TEXTURE_FORMAT_R16 = SCE_GXM_TEXTURE_FORMAT_U16_000R,
	SCE_GXM_TEXTURE_FORMAT_D16 = SCE_GXM_TEXTURE_FORMAT_U16_R,
	SCE_GXM_TEXTURE_FORMAT_LF16 = SCE_GXM_TEXTURE_FORMAT_F16_1RRR,
	SCE_GXM_TEXTURE_FORMAT_AF16 = SCE_GXM_TEXTURE_FORMAT_F16_R000,
	SCE_GXM_TEXTURE_FORMAT_RF16 = SCE_GXM_TEXTURE_FORMAT_F16_000R,
	SCE_GXM_TEXTURE_FORMAT_A8R8G8B8 = SCE_GXM_TEXTURE_FORMAT_U8U8U8U8_ARGB,
	SCE_GXM_TEXTURE_FORMAT_A8B8G8R8 = SCE_GXM_TEXTURE_FORMAT_U8U8U8U8_ABGR,
	SCE_GXM_TEXTURE_FORMAT_AF16LF16 = SCE_GXM_TEXTURE_FORMAT_F16F16_GRRR,
	SCE_GXM_TEXTURE_FORMAT_LF16AF16 = SCE_GXM_TEXTURE_FORMAT_F16F16_RGGG,
	SCE_GXM_TEXTURE_FORMAT_GF16RF16 = SCE_GXM_TEXTURE_FORMAT_F16F16_00GR,
	SCE_GXM_TEXTURE_FORMAT_LF32M = SCE_GXM_TEXTURE_FORMAT_F32M_1RRR,
	SCE_GXM_TEXTURE_FORMAT_AF32M = SCE_GXM_TEXTURE_FORMAT_F32M_R000,
	SCE_GXM_TEXTURE_FORMAT_RF32M = SCE_GXM_TEXTURE_FORMAT_F32M_000R,
	SCE_GXM_TEXTURE_FORMAT_DF32M = SCE_GXM_TEXTURE_FORMAT_F32M_R,
	SCE_GXM_TEXTURE_FORMAT_VYUY = SCE_GXM_TEXTURE_FORMAT_VYUY422_CSC0,
	SCE_GXM_TEXTURE_FORMAT_YVYU = SCE_GXM_TEXTURE_FORMAT_YVYU422_CSC0,
	SCE_GXM_TEXTURE_FORMAT_UBC1 = SCE_GXM_TEXTURE_FORMAT_UBC1_ABGR,
	SCE_GXM_TEXTURE_FORMAT_UBC2 = SCE_GXM_TEXTURE_FORMAT_UBC2_ABGR,
	SCE_GXM_TEXTURE_FORMAT_UBC3 = SCE_GXM_TEXTURE_FORMAT_UBC3_ABGR,
	SCE_GXM_TEXTURE_FORMAT_PVRT2BPP = SCE_GXM_TEXTURE_FORMAT_PVRT2BPP_ABGR,
	SCE_GXM_TEXTURE_FORMAT_PVRT4BPP = SCE_GXM_TEXTURE_FORMAT_PVRT4BPP_ABGR,
	SCE_GXM_TEXTURE_FORMAT_PVRTII2BPP = SCE_GXM_TEXTURE_FORMAT_PVRTII2BPP_ABGR,
	SCE_GXM_TEXTURE_FORMAT_PVRTII4BPP = SCE_GXM_TEXTURE_FORMAT_PVRTII4BPP_ABGR
};

enum SceGxmTextureAnisoMode : u32
{
	SCE_GXM_TEXTURE_ANISO_DISABLED = 0x00000000u,
	SCE_GXM_TEXTURE_ANISO_ENABLED = 0x00004000u
};

enum SceGxmTextureType : u32
{
	SCE_GXM_TEXTURE_SWIZZLED = 0x00000000u,
	SCE_GXM_TEXTURE_CUBE = 0x40000000u,
	SCE_GXM_TEXTURE_LINEAR = 0x60000000u,
	SCE_GXM_TEXTURE_TILED = 0x80000000u,
	SCE_GXM_TEXTURE_LINEAR_STRIDED = 0xc0000000u
};

enum SceGxmTextureFilter : u32
{
	SCE_GXM_TEXTURE_FILTER_POINT = 0x00000000u,
	SCE_GXM_TEXTURE_FILTER_LINEAR = 0x00000001u,
	SCE_GXM_TEXTURE_FILTER_ANISO_LINEAR = 0x00000002u,
	SCE_GXM_TEXTURE_FILTER_ANISO_POINT = 0x00000003u
};

enum SceGxmTextureMipFilter : u32
{
	SCE_GXM_TEXTURE_MIP_FILTER_DISABLED = 0x00000000u,
	SCE_GXM_TEXTURE_MIP_FILTER_ENABLED = 0x00000200u
};

enum SceGxmTextureAddrMode : u32
{
	SCE_GXM_TEXTURE_ADDR_REPEAT = 0x00000000u,
	SCE_GXM_TEXTURE_ADDR_MIRROR = 0x00000001u,
	SCE_GXM_TEXTURE_ADDR_CLAMP = 0x00000002u,
	SCE_GXM_TEXTURE_ADDR_MIRROR_CLAMP = 0x00000003u,
	SCE_GXM_TEXTURE_ADDR_REPEAT_IGNORE_BORDER = 0x00000004u,
	SCE_GXM_TEXTURE_ADDR_CLAMP_FULL_BORDER = 0x00000005u,
	SCE_GXM_TEXTURE_ADDR_CLAMP_IGNORE_BORDER = 0x00000006u,
	SCE_GXM_TEXTURE_ADDR_CLAMP_HALF_BORDER = 0x00000007u
};

enum SceGxmTextureGammaMode : u32
{
	SCE_GXM_TEXTURE_GAMMA_NONE = 0x00000000u,
	SCE_GXM_TEXTURE_GAMMA_R = 0x08000000u,
	SCE_GXM_TEXTURE_GAMMA_GR = 0x18000000u,
	SCE_GXM_TEXTURE_GAMMA_BGR = 0x08000000u
};

enum SceGxmIndexFormat : u32
{
	SCE_GXM_INDEX_FORMAT_U16 = 0x00000000u,
	SCE_GXM_INDEX_FORMAT_U32 = 0x01000000u
};

enum SceGxmIndexSource : u16
{
	SCE_GXM_INDEX_SOURCE_INDEX_16BIT = 0x00000000u,
	SCE_GXM_INDEX_SOURCE_INDEX_32BIT = 0x00000001u,
	SCE_GXM_INDEX_SOURCE_INSTANCE_16BIT = 0x00000002u,
	SCE_GXM_INDEX_SOURCE_INSTANCE_32BIT = 0x00000003u
};

enum SceGxmFragmentProgramMode : u32
{
	SCE_GXM_FRAGMENT_PROGRAM_DISABLED = 0x00200000u,
	SCE_GXM_FRAGMENT_PROGRAM_ENABLED = 0x00000000u
};

enum SceGxmDepthWriteMode : u32
{
	SCE_GXM_DEPTH_WRITE_DISABLED = 0x00100000u,
	SCE_GXM_DEPTH_WRITE_ENABLED = 0x00000000u
};

enum SceGxmLineFillLastPixelMode : u32
{
	SCE_GXM_LINE_FILL_LAST_PIXEL_DISABLED = 0x00000000u,
	SCE_GXM_LINE_FILL_LAST_PIXEL_ENABLED = 0x00080000u
};

enum SceGxmTwoSidedMode : u32
{
	SCE_GXM_TWO_SIDED_DISABLED = 0x00000000u,
	SCE_GXM_TWO_SIDED_ENABLED = 0x00000800u
};

enum SceGxmWClampMode : u32
{
	SCE_GXM_WCLAMP_MODE_DISABLED = 0x00000000u,
	SCE_GXM_WCLAMP_MODE_ENABLED = 0x00008000u
};

enum SceGxmViewportMode : u32
{
	SCE_GXM_VIEWPORT_DISABLED = 0x00010000u,
	SCE_GXM_VIEWPORT_ENABLED = 0x00000000u
};

enum SceGxmWBufferMode : u32
{
	SCE_GXM_WBUFFER_DISABLED = 0x00000000u,
	SCE_GXM_WBUFFER_ENABLED = 0x00004000u
};

enum SceGxmDepthStencilForceLoadMode : u32
{
	SCE_GXM_DEPTH_STENCIL_FORCE_LOAD_DISABLED = 0x00000000u,
	SCE_GXM_DEPTH_STENCIL_FORCE_LOAD_ENABLED = 0x00000002u
};

enum SceGxmDepthStencilForceStoreMode : u32
{
	SCE_GXM_DEPTH_STENCIL_FORCE_STORE_DISABLED = 0x00000000u,
	SCE_GXM_DEPTH_STENCIL_FORCE_STORE_ENABLED = 0x00000004u
};

enum SceGxmSceneFlags : u32
{
	SCE_GXM_SCENE_FRAGMENT_SET_DEPENDENCY = 0x00000001u,
	SCE_GXM_SCENE_VERTEX_WAIT_FOR_DEPENDENCY = 0x00000002u
};

enum SceGxmMidSceneFlags : u32
{
	SCE_GXM_MIDSCENE_PRESERVE_DEFAULT_UNIFORM_BUFFERS = 0x00000001u
};

enum SceGxmColorSurfaceScaleMode : u32
{
	SCE_GXM_COLOR_SURFACE_SCALE_NONE = 0x00000000u,
	SCE_GXM_COLOR_SURFACE_SCALE_MSAA_DOWNSCALE = 0x00000001u
};

enum SceGxmOutputRegisterSize : u32
{
	SCE_GXM_OUTPUT_REGISTER_SIZE_32BIT = 0x00000000u,
	SCE_GXM_OUTPUT_REGISTER_SIZE_64BIT = 0x00000001u
};

enum SceGxmVisibilityTestMode : u32
{
	SCE_GXM_VISIBILITY_TEST_DISABLED = 0x00000000u,
	SCE_GXM_VISIBILITY_TEST_ENABLED = 0x00004000u
};

enum SceGxmVisibilityTestOp : u32
{
	SCE_GXM_VISIBILITY_TEST_OP_INCREMENT = 0x00000000u,
	SCE_GXM_VISIBILITY_TEST_OP_SET = 0x00040000u
};

enum SceGxmBlendFunc : u8
{
	SCE_GXM_BLEND_FUNC_NONE,
	SCE_GXM_BLEND_FUNC_ADD,
	SCE_GXM_BLEND_FUNC_SUBTRACT,
	SCE_GXM_BLEND_FUNC_REVERSE_SUBTRACT
};

enum SceGxmBlendFactor : u8
{
	SCE_GXM_BLEND_FACTOR_ZERO,
	SCE_GXM_BLEND_FACTOR_ONE,
	SCE_GXM_BLEND_FACTOR_SRC_COLOR,
	SCE_GXM_BLEND_FACTOR_ONE_MINUS_SRC_COLOR,
	SCE_GXM_BLEND_FACTOR_SRC_ALPHA,
	SCE_GXM_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA,
	SCE_GXM_BLEND_FACTOR_DST_COLOR,
	SCE_GXM_BLEND_FACTOR_ONE_MINUS_DST_COLOR,
	SCE_GXM_BLEND_FACTOR_DST_ALPHA,
	SCE_GXM_BLEND_FACTOR_ONE_MINUS_DST_ALPHA,
	SCE_GXM_BLEND_FACTOR_SRC_ALPHA_SATURATE,
	SCE_GXM_BLEND_FACTOR_DST_ALPHA_SATURATE
};

enum SceGxmColorMask : u8
{
	SCE_GXM_COLOR_MASK_NONE = 0,
	SCE_GXM_COLOR_MASK_A = (1 << 0),
	SCE_GXM_COLOR_MASK_R = (1 << 1),
	SCE_GXM_COLOR_MASK_G = (1 << 2),
	SCE_GXM_COLOR_MASK_B = (1 << 3),
	SCE_GXM_COLOR_MASK_ALL = (SCE_GXM_COLOR_MASK_A | SCE_GXM_COLOR_MASK_B | SCE_GXM_COLOR_MASK_G | SCE_GXM_COLOR_MASK_R)
};

struct SceGxmBlendInfo
{
	u8 colorMask; // SceGxmColorMask
	u8 colorFunc : 4; // SceGxmBlendFunc
	u8 alphaFunc : 4; // SceGxmBlendFunc
	u8 colorSrc : 4; // SceGxmBlendFactor
	u8 colorDst : 4; // SceGxmBlendFactor
	u8 alphaSrc : 4; // SceGxmBlendFactor
	u8 alphaDst : 4; // SceGxmBlendFactor
};

struct SceGxmRenderTarget;

struct SceGxmSyncObject;

struct SceGxmVertexAttribute
{
	le_t<u16> streamIndex;
	le_t<u16> offset;
	u8 format; // SceGxmAttributeFormat
	u8 componentCount;
	le_t<u16> regIndex;
};

struct SceGxmVertexStream
{
	le_t<u16> stride;
	le_t<u16> indexSource;
};

struct SceGxmTexture
{
	le_t<u32> controlWords[4];
};

struct SceGxmColorSurface
{
	le_t<u32> pbeSidebandWord;
	le_t<u32> pbeEmitWords[6];
	le_t<u32> outputRegisterSize;
	SceGxmTexture backgroundTex;
};

struct SceGxmDepthStencilSurface
{
	le_t<u32> zlsControl;
	vm::lptr<void> depthData;
	vm::lptr<void> stencilData;
	le_t<float> backgroundDepth;
	le_t<u32> backgroundControl;
};

struct SceGxmAuxiliarySurface
{
	le_t<u32> colorFormat; // SceGxmColorFormat
	le_t<u32> type; // SceGxmColorSurfaceType
	le_t<u32> width;
	le_t<u32> height;
	le_t<u32> stride;
	vm::lptr<void> data;
};

struct SceGxmNotification
{
	vm::lptr<volatile u32> address;
	le_t<u32> value;
};

struct SceGxmValidRegion
{
	le_t<u32> xMin;
	le_t<u32> yMin;
	le_t<u32> xMax;
	le_t<u32> yMax;
};

struct SceGxmContext;

enum
{
	SCE_GXM_MINIMUM_CONTEXT_HOST_MEM_SIZE = 2048,
	SCE_GXM_DEFAULT_VDM_RING_BUFFER_SIZE = (128 * 1024),
	SCE_GXM_DEFAULT_VERTEX_RING_BUFFER_SIZE = (2 * 1024 * 1024),
	SCE_GXM_DEFAULT_FRAGMENT_RING_BUFFER_SIZE = (512 * 1024),
	SCE_GXM_DEFAULT_FRAGMENT_USSE_RING_BUFFER_SIZE = (16 * 1024),
};

struct SceGxmContextParams
{
	vm::lptr<void> hostMem;
	le_t<u32> hostMemSize;
	vm::lptr<void> vdmRingBufferMem;
	le_t<u32> vdmRingBufferMemSize;
	vm::lptr<void> vertexRingBufferMem;
	le_t<u32> vertexRingBufferMemSize;
	vm::lptr<void> fragmentRingBufferMem;
	le_t<u32> fragmentRingBufferMemSize;
	vm::lptr<void> fragmentUsseRingBufferMem;
	le_t<u32> fragmentUsseRingBufferMemSize;
	le_t<u32> fragmentUsseRingBufferOffset;
};

struct SceGxmVertexProgram;

struct SceGxmFragmentProgram;

enum
{
	SCE_GXM_PRECOMPUTED_VERTEX_STATE_WORD_COUNT = 7,
	SCE_GXM_PRECOMPUTED_FRAGMENT_STATE_WORD_COUNT = 9,
	SCE_GXM_PRECOMPUTED_DRAW_WORD_COUNT = 11,
};

struct SceGxmPrecomputedVertexState
{
	le_t<u32> data[SCE_GXM_PRECOMPUTED_VERTEX_STATE_WORD_COUNT];
};

struct SceGxmPrecomputedFragmentState
{
	le_t<u32> data[SCE_GXM_PRECOMPUTED_FRAGMENT_STATE_WORD_COUNT];
};

struct SceGxmPrecomputedDraw
{
	le_t<u32> data[SCE_GXM_PRECOMPUTED_DRAW_WORD_COUNT];
};

enum : u32
{
	SCE_GXM_MAX_VERTEX_ATTRIBUTES = 16,
	SCE_GXM_MAX_VERTEX_STREAMS = 4,
	SCE_GXM_MAX_TEXTURE_UNITS = 16,
	SCE_GXM_MAX_UNIFORM_BUFFERS = 8,
	SCE_GXM_MAX_AUXILIARY_SURFACES = 3,
};

struct SceGxmProgram;

struct SceGxmProgramParameter;

enum SceGxmProgramType : s32
{
	SCE_GXM_VERTEX_PROGRAM,
	SCE_GXM_FRAGMENT_PROGRAM
};

enum SceGxmParameterCategory : s32
{
	SCE_GXM_PARAMETER_CATEGORY_ATTRIBUTE,
	SCE_GXM_PARAMETER_CATEGORY_UNIFORM,
	SCE_GXM_PARAMETER_CATEGORY_SAMPLER,
	SCE_GXM_PARAMETER_CATEGORY_AUXILIARY_SURFACE,
	SCE_GXM_PARAMETER_CATEGORY_UNIFORM_BUFFER
};

enum SceGxmParameterType : s32
{
	SCE_GXM_PARAMETER_TYPE_F32,
	SCE_GXM_PARAMETER_TYPE_F16,
	SCE_GXM_PARAMETER_TYPE_C10,
	SCE_GXM_PARAMETER_TYPE_U32,
	SCE_GXM_PARAMETER_TYPE_S32,
	SCE_GXM_PARAMETER_TYPE_U16,
	SCE_GXM_PARAMETER_TYPE_S16,
	SCE_GXM_PARAMETER_TYPE_U8,
	SCE_GXM_PARAMETER_TYPE_S8,
	SCE_GXM_PARAMETER_TYPE_AGGREGATE
};

enum SceGxmParameterSemantic : s32
{
	SCE_GXM_PARAMETER_SEMANTIC_NONE,
	SCE_GXM_PARAMETER_SEMANTIC_ATTR,
	SCE_GXM_PARAMETER_SEMANTIC_BCOL,
	SCE_GXM_PARAMETER_SEMANTIC_BINORMAL,
	SCE_GXM_PARAMETER_SEMANTIC_BLENDINDICES,
	SCE_GXM_PARAMETER_SEMANTIC_BLENDWEIGHT,
	SCE_GXM_PARAMETER_SEMANTIC_COLOR,
	SCE_GXM_PARAMETER_SEMANTIC_DIFFUSE,
	SCE_GXM_PARAMETER_SEMANTIC_FOGCOORD,
	SCE_GXM_PARAMETER_SEMANTIC_NORMAL,
	SCE_GXM_PARAMETER_SEMANTIC_POINTSIZE,
	SCE_GXM_PARAMETER_SEMANTIC_POSITION,
	SCE_GXM_PARAMETER_SEMANTIC_SPECULAR,
	SCE_GXM_PARAMETER_SEMANTIC_TANGENT,
	SCE_GXM_PARAMETER_SEMANTIC_TEXCOORD
};

struct SceGxmShaderPatcher;

struct SceGxmRegisteredProgram;

using SceGxmShaderPatcherHostAllocCallback = vm::ptr<void>(vm::ptr<void> userData, u32 size);
using SceGxmShaderPatcherHostFreeCallback = void(vm::ptr<void> userData, vm::ptr<void> mem);
using SceGxmShaderPatcherBufferAllocCallback = vm::ptr<void>(vm::ptr<void> userData, u32 size);
using SceGxmShaderPatcherBufferFreeCallback = void(vm::ptr<void> userData, vm::ptr<void> mem);
using SceGxmShaderPatcherUsseAllocCallback = vm::ptr<void>(vm::ptr<void> userData, u32 size, vm::ptr<u32> usseOffset);
using SceGxmShaderPatcherUsseFreeCallback = void(vm::ptr<void> userData, vm::ptr<void> mem);

struct SceGxmShaderPatcherParams
{
	vm::lptr<void> userData;
	vm::lptr<SceGxmShaderPatcherHostAllocCallback> hostAllocCallback;
	vm::lptr<SceGxmShaderPatcherHostFreeCallback> hostFreeCallback;
	vm::lptr<SceGxmShaderPatcherBufferAllocCallback> bufferAllocCallback;
	vm::lptr<SceGxmShaderPatcherBufferFreeCallback> bufferFreeCallback;
	vm::lptr<void> bufferMem;
	le_t<u32> bufferMemSize;
	vm::lptr<SceGxmShaderPatcherUsseAllocCallback> vertexUsseAllocCallback;
	vm::lptr<SceGxmShaderPatcherUsseFreeCallback> vertexUsseFreeCallback;
	vm::lptr<void> vertexUsseMem;
	le_t<u32> vertexUsseMemSize;
	le_t<u32> vertexUsseOffset;
	vm::lptr<SceGxmShaderPatcherUsseAllocCallback> fragmentUsseAllocCallback;
	vm::lptr<SceGxmShaderPatcherUsseFreeCallback> fragmentUsseFreeCallback;
	vm::lptr<void> fragmentUsseMem;
	le_t<u32> fragmentUsseMemSize;
	le_t<u32> fragmentUsseOffset;
};

enum SceGxmRenderTargetFlags : u32
{
	SCE_GXM_RENDER_TARGET_CUSTOM_MULTISAMPLE_LOCATIONS = 1 << 0,
};

struct SceGxmRenderTargetParams
{
	le_t<u32> flags; // SceGxmRenderTargetFlags
	le_t<u16> width;
	le_t<u16> height;
	le_t<u16> scenesPerFrame;
	le_t<u16> multisampleMode; // SceGxmMultisampleMode
	le_t<u32> multisampleLocations;
	vm::lptr<void> hostMem;
	le_t<u32> hostMemSize;
	le_t<s32> driverMemBlock;
};

extern psv_log_base sceGxm;
