Update XGL_FORMAT.
authorJeremy Hayes <jeremy@lunarg.com>
Fri, 23 Jan 2015 15:51:43 +0000 (08:51 -0700)
committerCourtney Goeltzenleuchter <courtney@LunarG.com>
Thu, 5 Feb 2015 00:58:09 +0000 (17:58 -0700)
demos/cube.c
demos/tri.c
demos/xglinfo.c
icd/common/icd-format.c
icd/common/icd-format.h
include/xgl.h

index 8c68e3178f2e1866816356898f3e62113f4a60b5..b02e443bc477067599783c9e2e12f5dccd313954 100644 (file)
@@ -449,7 +449,7 @@ static void demo_prepare_buffers(struct demo *demo)
 
 static void demo_prepare_depth(struct demo *demo)
 {
-    const XGL_FORMAT depth_format = { XGL_CH_FMT_R16, XGL_NUM_FMT_DS };
+    const XGL_FORMAT depth_format = XGL_FMT_D16_UNORM;
     const XGL_IMAGE_CREATE_INFO image = {
         .sType = XGL_STRUCTURE_TYPE_IMAGE_CREATE_INFO,
         .pNext = NULL,
@@ -687,7 +687,7 @@ bool loadTexture(char *filename, XGL_UINT8 *rgba_data,
 
 static void demo_prepare_textures(struct demo *demo)
 {
-    const XGL_FORMAT tex_format = { XGL_CH_FMT_R8G8B8A8, XGL_NUM_FMT_UNORM };
+    const XGL_FORMAT tex_format = XGL_FMT_R8G8B8A8_UNORM;
     XGL_INT tex_width;
     XGL_INT tex_height;
     XGL_RESULT err;
@@ -1523,8 +1523,7 @@ static void demo_init(struct demo *demo)
 
     demo->width = 500;
     demo->height = 500;
-    demo->format.channelFormat = XGL_CH_FMT_B8G8R8A8;
-    demo->format.numericFormat = XGL_NUM_FMT_UNORM;
+    demo->format = XGL_FMT_B8G8R8A8_UNORM;
 
     demo->spin_angle = 0.01f;
     demo->spin_increment = 0.01f;
index 413431fcedc0a66fca9b71757cd088aaa473482d..19a591b9c82ed5805cca4c7755377215a44a468b 100644 (file)
@@ -267,7 +267,7 @@ static void demo_prepare_buffers(struct demo *demo)
 
 static void demo_prepare_depth(struct demo *demo)
 {
-    const XGL_FORMAT depth_format = { XGL_CH_FMT_R16, XGL_NUM_FMT_DS };
+    const XGL_FORMAT depth_format = XGL_FMT_D16_UNORM;
     const XGL_IMAGE_CREATE_INFO image = {
         .sType = XGL_STRUCTURE_TYPE_IMAGE_CREATE_INFO,
         .pNext = NULL,
@@ -358,7 +358,7 @@ static void demo_prepare_depth(struct demo *demo)
 
 static void demo_prepare_textures(struct demo *demo)
 {
-    const XGL_FORMAT tex_format = { XGL_CH_FMT_B8G8R8A8, XGL_NUM_FMT_UNORM };
+    const XGL_FORMAT tex_format = XGL_FMT_B8G8R8A8_UNORM;
     const XGL_INT tex_width = 2;
     const XGL_INT tex_height = 2;
     const uint32_t tex_colors[DEMO_TEXTURE_COUNT][2] = {
@@ -595,13 +595,11 @@ static void demo_prepare_vertices(struct demo *demo)
     demo->vertices.vi_bindings[0].stepRate = XGL_VERTEX_INPUT_STEP_RATE_VERTEX;
 
     demo->vertices.vi_attrs[0].binding = 0;
-    demo->vertices.vi_attrs[0].format.channelFormat = XGL_CH_FMT_R32G32B32;
-    demo->vertices.vi_attrs[0].format.numericFormat = XGL_NUM_FMT_FLOAT;
+    demo->vertices.vi_attrs[0].format = XGL_FMT_R32G32B32_SFLOAT;
     demo->vertices.vi_attrs[0].offsetInBytes = 0;
 
     demo->vertices.vi_attrs[1].binding = 0;
-    demo->vertices.vi_attrs[1].format.channelFormat = XGL_CH_FMT_R32G32;
-    demo->vertices.vi_attrs[1].format.numericFormat = XGL_NUM_FMT_FLOAT;
+    demo->vertices.vi_attrs[1].format = XGL_FMT_R32G32_SFLOAT;
     demo->vertices.vi_attrs[1].offsetInBytes = sizeof(float) * 3;
 }
 
@@ -1076,8 +1074,7 @@ static void demo_init(struct demo *demo)
 
     demo->width = 300;
     demo->height = 300;
-    demo->format.channelFormat = XGL_CH_FMT_B8G8R8A8;
-    demo->format.numericFormat = XGL_NUM_FMT_UNORM;
+    demo->format = XGL_FMT_B8G8R8A8_UNORM;
 }
 
 static void demo_cleanup(struct demo *demo)
index 8fa0d1c8beeab5182df80df978501e2744a68c94..d37917f5e9d8ff1a57bbf92ca9ce974842cbabb4 100644 (file)
@@ -48,7 +48,7 @@ struct app_dev {
     XGL_DEVICE obj;
 
 
-    XGL_FORMAT_PROPERTIES format_props[XGL_MAX_CH_FMT][XGL_MAX_NUM_FMT];
+    XGL_FORMAT_PROPERTIES format_props[XGL_NUM_FMT];
 };
 
 struct app_gpu {
@@ -132,96 +132,200 @@ static const char *xgl_gpu_type_string(XGL_PHYSICAL_GPU_TYPE type)
     }
 }
 
-static const char *xgl_channel_format_string(XGL_CHANNEL_FORMAT ch)
+static const char *xgl_format_string(XGL_FORMAT fmt)
 {
-    switch (ch) {
-#define STR(r) case XGL_CH_FMT_ ##r: return #r
+    switch (fmt) {
+#define STR(r) case XGL_FMT_ ##r: return #r
     STR(UNDEFINED);
-    STR(R4G4);
-    STR(R4G4B4A4);
-    STR(R5G6B5);
-    STR(B5G6R5);
-    STR(R5G5B5A1);
-    STR(R8);
-    STR(R8G8);
-    STR(R8G8B8A8);
-    STR(B8G8R8A8);
-    STR(R10G11B11);
-    STR(R11G11B10);
-    STR(R10G10B10A2);
-    STR(R16);
-    STR(R16G16);
-    STR(R16G16B16A16);
-    STR(R32);
-    STR(R32G32);
-    STR(R32G32B32);
-    STR(R32G32B32A32);
-    STR(R16G8);
-    STR(R32G8);
-    STR(R9G9B9E5);
-    STR(BC1);
-    STR(BC2);
-    STR(BC3);
-    STR(BC4);
-    STR(BC5);
-    STR(BC6U);
-    STR(BC6S);
-    STR(BC7);
-    STR(R8G8B8);
-    STR(R16G16B16);
-    STR(B10G10R10A2);
-    STR(R64);
-    STR(R64G64);
-    STR(R64G64B64);
-    STR(R64G64B64A64);
+    STR(R4G4_UNORM);
+    STR(R4G4_USCALED);
+    STR(R4G4B4A4_UNORM);
+    STR(R4G4B4A4_USCALED);
+    STR(R5G6B5_UNORM);
+    STR(R5G6B5_USCALED);
+    STR(R5G5B5A1_UNORM);
+    STR(R5G5B5A1_USCALED);
+    STR(R8_UNORM);
+    STR(R8_SNORM);
+    STR(R8_USCALED);
+    STR(R8_SSCALED);
+    STR(R8_UINT);
+    STR(R8_SINT);
+    STR(R8_SRGB);
+    STR(R8G8_UNORM);
+    STR(R8G8_SNORM);
+    STR(R8G8_USCALED);
+    STR(R8G8_SSCALED);
+    STR(R8G8_UINT);
+    STR(R8G8_SINT);
+    STR(R8G8_SRGB);
+    STR(R8G8B8_UNORM);
+    STR(R8G8B8_SNORM);
+    STR(R8G8B8_USCALED);
+    STR(R8G8B8_SSCALED);
+    STR(R8G8B8_UINT);
+    STR(R8G8B8_SINT);
+    STR(R8G8B8_SRGB);
+    STR(R8G8B8A8_UNORM);
+    STR(R8G8B8A8_SNORM);
+    STR(R8G8B8A8_USCALED);
+    STR(R8G8B8A8_SSCALED);
+    STR(R8G8B8A8_UINT);
+    STR(R8G8B8A8_SINT);
+    STR(R8G8B8A8_SRGB);
+    STR(R10G10B10A2_UNORM);
+    STR(R10G10B10A2_SNORM);
+    STR(R10G10B10A2_USCALED);
+    STR(R10G10B10A2_SSCALED);
+    STR(R10G10B10A2_UINT);
+    STR(R10G10B10A2_SINT);
+    STR(R16_UNORM);
+    STR(R16_SNORM);
+    STR(R16_USCALED);
+    STR(R16_SSCALED);
+    STR(R16_UINT);
+    STR(R16_SINT);
+    STR(R16_SFLOAT);
+    STR(R16G16_UNORM);
+    STR(R16G16_SNORM);
+    STR(R16G16_USCALED);
+    STR(R16G16_SSCALED);
+    STR(R16G16_UINT);
+    STR(R16G16_SINT);
+    STR(R16G16_SFLOAT);
+    STR(R16G16B16_UNORM);
+    STR(R16G16B16_SNORM);
+    STR(R16G16B16_USCALED);
+    STR(R16G16B16_SSCALED);
+    STR(R16G16B16_UINT);
+    STR(R16G16B16_SINT);
+    STR(R16G16B16_SFLOAT);
+    STR(R16G16B16A16_UNORM);
+    STR(R16G16B16A16_SNORM);
+    STR(R16G16B16A16_USCALED);
+    STR(R16G16B16A16_SSCALED);
+    STR(R16G16B16A16_UINT);
+    STR(R16G16B16A16_SINT);
+    STR(R16G16B16A16_SFLOAT);
+    STR(R32_UINT);
+    STR(R32_SINT);
+    STR(R32_SFLOAT);
+    STR(R32G32_UINT);
+    STR(R32G32_SINT);
+    STR(R32G32_SFLOAT);
+    STR(R32G32B32_UINT);
+    STR(R32G32B32_SINT);
+    STR(R32G32B32_SFLOAT);
+    STR(R32G32B32A32_UINT);
+    STR(R32G32B32A32_SINT);
+    STR(R32G32B32A32_SFLOAT);
+    STR(R64_SFLOAT);
+    STR(R64G64_SFLOAT);
+    STR(R64G64B64_SFLOAT);
+    STR(R64G64B64A64_SFLOAT);
+    STR(R11G11B10_UFLOAT);
+    STR(R9G9B9E5_UFLOAT);
+    STR(D16_UNORM);
+    STR(D24_UNORM);
+    STR(D32_SFLOAT);
+    STR(S8_UINT);
+    STR(D16_UNORM_S8_UINT);
+    STR(D24_UNORM_S8_UINT);
+    STR(D32_SFLOAT_S8_UINT);
+    STR(BC1_UNORM);
+    STR(BC1_SRGB);
+    STR(BC2_UNORM);
+    STR(BC2_SRGB);
+    STR(BC3_UNORM);
+    STR(BC3_SRGB);
+    STR(BC4_UNORM);
+    STR(BC4_SNORM);
+    STR(BC5_UNORM);
+    STR(BC5_SNORM);
+    STR(BC6H_UFLOAT);
+    STR(BC6H_SFLOAT);
+    STR(BC7_UNORM);
+    STR(BC7_SRGB);
+    STR(ETC2_R8G8B8_UNORM);
+    STR(ETC2_R8G8B8A1_UNORM);
+    STR(ETC2_R8G8B8A8_UNORM);
+    STR(EAC_R11_UNORM);
+    STR(EAC_R11_SNORM);
+    STR(EAC_R11G11_UNORM);
+    STR(EAC_R11G11_SNORM);
+    STR(ASTC_4x4_UNORM);
+    STR(ASTC_4x4_SRGB);
+    STR(ASTC_4x5_UNORM);
+    STR(ASTC_4x5_SRGB);
+    STR(ASTC_5x5_UNORM);
+    STR(ASTC_5x5_SRGB);
+    STR(ASTC_6x5_UNORM);
+    STR(ASTC_6x5_SRGB);
+    STR(ASTC_6x6_UNORM);
+    STR(ASTC_6x6_SRGB);
+    STR(ASTC_8x5_UNORM);
+    STR(ASTC_8x5_SRGB);
+    STR(ASTC_8x6_UNORM);
+    STR(ASTC_8x6_SRGB);
+    STR(ASTC_8x8_UNORM);
+    STR(ASTC_8x8_SRGB);
+    STR(ASTC_10x5_UNORM);
+    STR(ASTC_10x5_SRGB);
+    STR(ASTC_10x6_UNORM);
+    STR(ASTC_10x6_SRGB);
+    STR(ASTC_10x8_UNORM);
+    STR(ASTC_10x8_SRGB);
+    STR(ASTC_10x10_UNORM);
+    STR(ASTC_10x10_SRGB);
+    STR(ASTC_12x10_UNORM);
+    STR(ASTC_12x10_SRGB);
+    STR(ASTC_12x12_UNORM);
+    STR(ASTC_12x12_SRGB);
+    STR(B5G6R5_UNORM);
+    STR(B5G6R5_USCALED);
+    STR(B8G8R8_UNORM);
+    STR(B8G8R8_SNORM);
+    STR(B8G8R8_USCALED);
+    STR(B8G8R8_SSCALED);
+    STR(B8G8R8_UINT);
+    STR(B8G8R8_SINT);
+    STR(B8G8R8_SRGB);
+    STR(B8G8R8A8_UNORM);
+    STR(B8G8R8A8_SNORM);
+    STR(B8G8R8A8_USCALED);
+    STR(B8G8R8A8_SSCALED);
+    STR(B8G8R8A8_UINT);
+    STR(B8G8R8A8_SINT);
+    STR(B8G8R8A8_SRGB);
+    STR(B10G10R10A2_UNORM);
+    STR(B10G10R10A2_SNORM);
+    STR(B10G10R10A2_USCALED);
+    STR(B10G10R10A2_SSCALED);
+    STR(B10G10R10A2_UINT);
+    STR(B10G10R10A2_SINT);
 #undef STR
-    default: return "UNKNOWN_CH";
-    }
-}
-
-static const char *xgl_numeric_format_string(XGL_NUM_FORMAT num)
-{
-    switch (num) {
-#define STR(r) case XGL_NUM_FMT_ ##r: return #r
-    STR(UNDEFINED);
-    STR(UNORM);
-    STR(SNORM);
-    STR(UINT);
-    STR(SINT);
-    STR(FLOAT);
-    STR(SRGB);
-    STR(DS);
-    STR(USCALED);
-    STR(SSCALED);
-#undef STR
-    default: return "UNKNOWN_NUM";
+    default: return "UNKNOWN_FORMAT";
     }
 }
 
 static void app_dev_init_formats(struct app_dev *dev)
 {
-    XGL_CHANNEL_FORMAT ch;
-    XGL_NUM_FORMAT num;
-
-    for (ch = 0; ch < XGL_MAX_CH_FMT; ch++) {
-        for (num = 0; num < XGL_MAX_NUM_FMT; num++) {
-            const XGL_FORMAT fmt = {
-                .channelFormat = ch,
-                .numericFormat = num,
-            };
-            XGL_RESULT err;
-            XGL_SIZE size = sizeof(dev->format_props[ch][num]);
-
-            err = xglGetFormatInfo(dev->obj, fmt,
-                                   XGL_INFO_TYPE_FORMAT_PROPERTIES,
-                                   &size, &dev->format_props[ch][num]);
-            if (err) {
-                memset(&dev->format_props[ch][num], 0,
-                       sizeof(dev->format_props[ch][num]));
-            }
-            else if (size != sizeof(dev->format_props[ch][num])) {
-                ERR_EXIT(XGL_ERROR_UNKNOWN);
-            }
+    XGL_FORMAT f;
+
+    for (f = 0; f < XGL_NUM_FMT; f++) {
+        const XGL_FORMAT fmt = f;
+        XGL_RESULT err;
+        XGL_SIZE size = sizeof(dev->format_props[f]);
+
+        err = xglGetFormatInfo(dev->obj, fmt,
+                               XGL_INFO_TYPE_FORMAT_PROPERTIES,
+                               &size, &dev->format_props[f]);
+        if (err) {
+            memset(&dev->format_props[f], 0,
+                   sizeof(dev->format_props[f]));
+        }
+        else if (size != sizeof(dev->format_props[f])) {
+            ERR_EXIT(XGL_ERROR_UNKNOWN);
         }
     }
 }
@@ -360,9 +464,9 @@ static void app_gpu_destroy(struct app_gpu *gpu)
     free(gpu->queue_props);
 }
 
-static void app_dev_dump_format_props(const struct app_dev *dev, XGL_CHANNEL_FORMAT ch, XGL_NUM_FORMAT num)
+static void app_dev_dump_format_props(const struct app_dev *dev, XGL_FORMAT fmt)
 {
-    const XGL_FORMAT_PROPERTIES *props = &dev->format_props[ch][num];
+    const XGL_FORMAT_PROPERTIES *props = &dev->format_props[fmt];
     struct {
         const char *name;
         XGL_FLAGS flags;
@@ -377,8 +481,7 @@ static void app_dev_dump_format_props(const struct app_dev *dev, XGL_CHANNEL_FOR
     tilings[1].name = "optimal";
     tilings[1].flags = props->optimalTilingFeatures;
 
-    printf("FORMAT_%s_%s\n", xgl_channel_format_string(ch),
-            xgl_numeric_format_string(num));
+    printf("FORMAT_%s\n", xgl_format_string(fmt));
     for (i = 0; i < ARRAY_SIZE(tilings); i++) {
         if (!tilings[i].flags)
             continue;
@@ -404,12 +507,10 @@ static void app_dev_dump_format_props(const struct app_dev *dev, XGL_CHANNEL_FOR
 static void
 app_dev_dump(const struct app_dev *dev)
 {
-    XGL_CHANNEL_FORMAT ch;
-    XGL_NUM_FORMAT num;
+    XGL_FORMAT fmt;
 
-    for (ch = 0; ch < XGL_MAX_CH_FMT; ch++) {
-        for (num = 0; num < XGL_MAX_NUM_FMT; num++)
-            app_dev_dump_format_props(dev, ch, num);
+    for (fmt = 0; fmt < XGL_NUM_FMT; fmt++) {
+        app_dev_dump_format_props(dev, fmt);
     }
 }
 
index 688ab4fc465b4802953309fd9ea648d5fb05e2f2..4119de11bede4b45f48b5f727fa93c3ff25f9e49 100644 (file)
 static const struct icd_format_info {
     XGL_SIZE size;
     XGL_UINT channel_count;
-} icd_format_table[XGL_MAX_CH_FMT + 1] = {
-    [XGL_CH_FMT_UNDEFINED]      = { 0,  0 },
-    [XGL_CH_FMT_R4G4]           = { 1,  2 },
-    [XGL_CH_FMT_R4G4B4A4]       = { 2,  4 },
-    [XGL_CH_FMT_R5G6B5]         = { 2,  3 },
-    [XGL_CH_FMT_B5G6R5]         = { 2,  3 },
-    [XGL_CH_FMT_R5G5B5A1]       = { 2,  4 },
-    [XGL_CH_FMT_R8]             = { 1,  1 },
-    [XGL_CH_FMT_R8G8]           = { 2,  2 },
-    [XGL_CH_FMT_R8G8B8A8]       = { 4,  4 },
-    [XGL_CH_FMT_B8G8R8A8]       = { 4,  4 },
-    [XGL_CH_FMT_R10G11B11]      = { 4,  3 },
-    [XGL_CH_FMT_R11G11B10]      = { 4,  3 },
-    [XGL_CH_FMT_R10G10B10A2]    = { 4,  4 },
-    [XGL_CH_FMT_R16]            = { 2,  1 },
-    [XGL_CH_FMT_R16G16]         = { 4,  2 },
-    [XGL_CH_FMT_R16G16B16A16]   = { 8,  4 },
-    [XGL_CH_FMT_R32]            = { 4,  1 },
-    [XGL_CH_FMT_R32G32]         = { 8,  2 },
-    [XGL_CH_FMT_R32G32B32]      = { 12, 3 },
-    [XGL_CH_FMT_R32G32B32A32]   = { 16, 4 },
-    [XGL_CH_FMT_R16G8]          = { 3,  2 },
-    [XGL_CH_FMT_R32G8]          = { 5,  2 },
-    [XGL_CH_FMT_R9G9B9E5]       = { 4,  3 },
-    [XGL_CH_FMT_BC1]            = { 8,  4 },
-    [XGL_CH_FMT_BC2]            = { 16, 4 },
-    [XGL_CH_FMT_BC3]            = { 16, 4 },
-    [XGL_CH_FMT_BC4]            = { 8,  4 },
-    [XGL_CH_FMT_BC5]            = { 16, 4 },
-    [XGL_CH_FMT_BC6U]           = { 16, 4 },
-    [XGL_CH_FMT_BC6S]           = { 16, 4 },
-    [XGL_CH_FMT_BC7]            = { 16, 4 },
-    [XGL_CH_FMT_R8G8B8]         = { 3,  3 },
-    [XGL_CH_FMT_R16G16B16]      = { 6,  3 },
-    [XGL_CH_FMT_B10G10R10A2]    = { 4,  4 },
-    [XGL_CH_FMT_R64]            = { 8,  1 },
-    [XGL_CH_FMT_R64G64]         = { 16, 2 },
-    [XGL_CH_FMT_R64G64B64]      = { 24, 3 },
-    [XGL_CH_FMT_R64G64B64A64]   = { 32, 4 },
+} icd_format_table[XGL_NUM_FMT] = {
+    [XGL_FMT_UNDEFINED]            = { 0,  0 },
+    [XGL_FMT_R4G4_UNORM]           = { 1,  2 },
+    [XGL_FMT_R4G4_USCALED]         = { 1,  2 },
+    [XGL_FMT_R4G4B4A4_UNORM]       = { 2,  4 },
+    [XGL_FMT_R4G4B4A4_USCALED]     = { 2,  4 },
+    [XGL_FMT_R5G6B5_UNORM]         = { 2,  3 },
+    [XGL_FMT_R5G6B5_USCALED]       = { 2,  3 },
+    [XGL_FMT_R5G5B5A1_UNORM]       = { 2,  4 },
+    [XGL_FMT_R5G5B5A1_USCALED]     = { 2,  4 },
+    [XGL_FMT_R8_UNORM]             = { 1,  1 },
+    [XGL_FMT_R8_SNORM]             = { 1,  1 },
+    [XGL_FMT_R8_USCALED]           = { 1,  1 },
+    [XGL_FMT_R8_SSCALED]           = { 1,  1 },
+    [XGL_FMT_R8_UINT]              = { 1,  1 },
+    [XGL_FMT_R8_SINT]              = { 1,  1 },
+    [XGL_FMT_R8_SRGB]              = { 1,  1 },
+    [XGL_FMT_R8G8_UNORM]           = { 2,  2 },
+    [XGL_FMT_R8G8_SNORM]           = { 2,  2 },
+    [XGL_FMT_R8G8_USCALED]         = { 2,  2 },
+    [XGL_FMT_R8G8_SSCALED]         = { 2,  2 },
+    [XGL_FMT_R8G8_UINT]            = { 2,  2 },
+    [XGL_FMT_R8G8_SINT]            = { 2,  2 },
+    [XGL_FMT_R8G8_SRGB]            = { 2,  2 },
+    [XGL_FMT_R8G8B8_UNORM]         = { 3,  3 },
+    [XGL_FMT_R8G8B8_SNORM]         = { 3,  3 },
+    [XGL_FMT_R8G8B8_USCALED]       = { 3,  3 },
+    [XGL_FMT_R8G8B8_SSCALED]       = { 3,  3 },
+    [XGL_FMT_R8G8B8_UINT]          = { 3,  3 },
+    [XGL_FMT_R8G8B8_SINT]          = { 3,  3 },
+    [XGL_FMT_R8G8B8_SRGB]          = { 3,  3 },
+    [XGL_FMT_R8G8B8A8_UNORM]       = { 4,  4 },
+    [XGL_FMT_R8G8B8A8_SNORM]       = { 4,  4 },
+    [XGL_FMT_R8G8B8A8_USCALED]     = { 4,  4 },
+    [XGL_FMT_R8G8B8A8_SSCALED]     = { 4,  4 },
+    [XGL_FMT_R8G8B8A8_UINT]        = { 4,  4 },
+    [XGL_FMT_R8G8B8A8_SINT]        = { 4,  4 },
+    [XGL_FMT_R8G8B8A8_SRGB]        = { 4,  4 },
+    [XGL_FMT_R10G10B10A2_UNORM]    = { 4,  4 },
+    [XGL_FMT_R10G10B10A2_SNORM]    = { 4,  4 },
+    [XGL_FMT_R10G10B10A2_USCALED]  = { 4,  4 },
+    [XGL_FMT_R10G10B10A2_SSCALED]  = { 4,  4 },
+    [XGL_FMT_R10G10B10A2_UINT]     = { 4,  4 },
+    [XGL_FMT_R10G10B10A2_SINT]     = { 4,  4 },
+    [XGL_FMT_R16_UNORM]            = { 2,  1 },
+    [XGL_FMT_R16_SNORM]            = { 2,  1 },
+    [XGL_FMT_R16_USCALED]          = { 2,  1 },
+    [XGL_FMT_R16_SSCALED]          = { 2,  1 },
+    [XGL_FMT_R16_UINT]             = { 2,  1 },
+    [XGL_FMT_R16_SINT]             = { 2,  1 },
+    [XGL_FMT_R16_SFLOAT]           = { 2,  1 },
+    [XGL_FMT_R16G16_UNORM]         = { 4,  2 },
+    [XGL_FMT_R16G16_SNORM]         = { 4,  2 },
+    [XGL_FMT_R16G16_USCALED]       = { 4,  2 },
+    [XGL_FMT_R16G16_SSCALED]       = { 4,  2 },
+    [XGL_FMT_R16G16_UINT]          = { 4,  2 },
+    [XGL_FMT_R16G16_SINT]          = { 4,  2 },
+    [XGL_FMT_R16G16_SFLOAT]        = { 4,  2 },
+    [XGL_FMT_R16G16B16_UNORM]      = { 6,  3 },
+    [XGL_FMT_R16G16B16_SNORM]      = { 6,  3 },
+    [XGL_FMT_R16G16B16_USCALED]    = { 6,  3 },
+    [XGL_FMT_R16G16B16_SSCALED]    = { 6,  3 },
+    [XGL_FMT_R16G16B16_UINT]       = { 6,  3 },
+    [XGL_FMT_R16G16B16_SINT]       = { 6,  3 },
+    [XGL_FMT_R16G16B16_SFLOAT]     = { 6,  3 },
+    [XGL_FMT_R16G16B16A16_UNORM]   = { 8,  4 },
+    [XGL_FMT_R16G16B16A16_SNORM]   = { 8,  4 },
+    [XGL_FMT_R16G16B16A16_USCALED] = { 8,  4 },
+    [XGL_FMT_R16G16B16A16_SSCALED] = { 8,  4 },
+    [XGL_FMT_R16G16B16A16_UINT]    = { 8,  4 },
+    [XGL_FMT_R16G16B16A16_SINT]    = { 8,  4 },
+    [XGL_FMT_R16G16B16A16_SFLOAT]  = { 8,  4 },
+    [XGL_FMT_R32_UINT]             = { 4,  1 },
+    [XGL_FMT_R32_SINT]             = { 4,  1 },
+    [XGL_FMT_R32_SFLOAT]           = { 4,  1 },
+    [XGL_FMT_R32G32_UINT]          = { 8,  2 },
+    [XGL_FMT_R32G32_SINT]          = { 8,  2 },
+    [XGL_FMT_R32G32_SFLOAT]        = { 8,  2 },
+    [XGL_FMT_R32G32B32_UINT]       = { 12, 3 },
+    [XGL_FMT_R32G32B32_SINT]       = { 12, 3 },
+    [XGL_FMT_R32G32B32_SFLOAT]     = { 12, 3 },
+    [XGL_FMT_R32G32B32A32_UINT]    = { 16, 4 },
+    [XGL_FMT_R32G32B32A32_SINT]    = { 16, 4 },
+    [XGL_FMT_R32G32B32A32_SFLOAT]  = { 16, 4 },
+    [XGL_FMT_R64_SFLOAT]           = { 8,  1 },
+    [XGL_FMT_R64G64_SFLOAT]        = { 16, 2 },
+    [XGL_FMT_R64G64B64_SFLOAT]     = { 24, 3 },
+    [XGL_FMT_R64G64B64A64_SFLOAT]  = { 32, 4 },
+    [XGL_FMT_R11G11B10_UFLOAT]     = { 4,  3 },
+    [XGL_FMT_R9G9B9E5_UFLOAT]      = { 4,  3 },
+    [XGL_FMT_D16_UNORM]            = { 2,  1 },
+    [XGL_FMT_D24_UNORM]            = { 3,  1 },
+    [XGL_FMT_D32_SFLOAT]           = { 4,  1 },
+    [XGL_FMT_S8_UINT]              = { 1,  1 },
+    [XGL_FMT_D16_UNORM_S8_UINT]    = { 3,  2 },
+    [XGL_FMT_D24_UNORM_S8_UINT]    = { 4,  2 },
+    [XGL_FMT_D32_SFLOAT_S8_UINT]   = { 4,  2 },
+    [XGL_FMT_BC1_UNORM]            = { 8,  4 },
+    [XGL_FMT_BC1_SRGB]             = { 8,  4 },
+    [XGL_FMT_BC2_UNORM]            = { 16, 4 },
+    [XGL_FMT_BC2_SRGB]             = { 16, 4 },
+    [XGL_FMT_BC3_UNORM]            = { 16, 4 },
+    [XGL_FMT_BC3_SRGB]             = { 16, 4 },
+    [XGL_FMT_BC4_UNORM]            = { 8,  4 },
+    [XGL_FMT_BC4_SNORM]            = { 8,  4 },
+    [XGL_FMT_BC5_UNORM]            = { 16, 4 },
+    [XGL_FMT_BC5_SNORM]            = { 16, 4 },
+    [XGL_FMT_BC6H_UFLOAT]          = { 16, 4 },
+    [XGL_FMT_BC6H_SFLOAT]          = { 16, 4 },
+    [XGL_FMT_BC7_UNORM]            = { 16, 4 },
+    [XGL_FMT_BC7_SRGB]             = { 16, 4 },
+    /* TODO: Initialize remaining compressed formats. */
+    [XGL_FMT_ETC2_R8G8B8_UNORM]    = { 0, 0 },
+    [XGL_FMT_ETC2_R8G8B8A1_UNORM]  = { 0, 0 },
+    [XGL_FMT_ETC2_R8G8B8A8_UNORM]  = { 0, 0 },
+    [XGL_FMT_EAC_R11_UNORM]        = { 0, 0 },
+    [XGL_FMT_EAC_R11_SNORM]        = { 0, 0 },
+    [XGL_FMT_EAC_R11G11_UNORM]     = { 0, 0 },
+    [XGL_FMT_EAC_R11G11_SNORM]     = { 0, 0 },
+    [XGL_FMT_ASTC_4x4_UNORM]       = { 0, 0 },
+    [XGL_FMT_ASTC_4x4_SRGB]        = { 0, 0 },
+    [XGL_FMT_ASTC_4x5_UNORM]       = { 0, 0 },
+    [XGL_FMT_ASTC_4x5_SRGB]        = { 0, 0 },
+    [XGL_FMT_ASTC_5x5_UNORM]       = { 0, 0 },
+    [XGL_FMT_ASTC_5x5_SRGB]        = { 0, 0 },
+    [XGL_FMT_ASTC_6x5_UNORM]       = { 0, 0 },
+    [XGL_FMT_ASTC_6x5_SRGB]        = { 0, 0 },
+    [XGL_FMT_ASTC_6x6_UNORM]       = { 0, 0 },
+    [XGL_FMT_ASTC_6x6_SRGB]        = { 0, 0 },
+    [XGL_FMT_ASTC_8x5_UNORM]       = { 0, 0 },
+    [XGL_FMT_ASTC_8x5_SRGB]        = { 0, 0 },
+    [XGL_FMT_ASTC_8x6_UNORM]       = { 0, 0 },
+    [XGL_FMT_ASTC_8x6_SRGB]        = { 0, 0 },
+    [XGL_FMT_ASTC_8x8_UNORM]       = { 0, 0 },
+    [XGL_FMT_ASTC_8x8_SRGB]        = { 0, 0 },
+    [XGL_FMT_ASTC_10x5_UNORM]      = { 0, 0 },
+    [XGL_FMT_ASTC_10x5_SRGB]       = { 0, 0 },
+    [XGL_FMT_ASTC_10x6_UNORM]      = { 0, 0 },
+    [XGL_FMT_ASTC_10x6_SRGB]       = { 0, 0 },
+    [XGL_FMT_ASTC_10x8_UNORM]      = { 0, 0 },
+    [XGL_FMT_ASTC_10x8_SRGB]       = { 0, 0 },
+    [XGL_FMT_ASTC_10x10_UNORM]     = { 0, 0 },
+    [XGL_FMT_ASTC_10x10_SRGB]      = { 0, 0 },
+    [XGL_FMT_ASTC_12x10_UNORM]     = { 0, 0 },
+    [XGL_FMT_ASTC_12x10_SRGB]      = { 0, 0 },
+    [XGL_FMT_ASTC_12x12_UNORM]     = { 0, 0 },
+    [XGL_FMT_ASTC_12x12_SRGB]      = { 0, 0 },
+    [XGL_FMT_B5G6R5_UNORM]         = { 2, 3 },
+    [XGL_FMT_B5G6R5_USCALED]       = { 2, 3 },
+    [XGL_FMT_B8G8R8_UNORM]         = { 3, 3 },
+    [XGL_FMT_B8G8R8_SNORM]         = { 3, 3 },
+    [XGL_FMT_B8G8R8_USCALED]       = { 3, 3 },
+    [XGL_FMT_B8G8R8_SSCALED]       = { 3, 3 },
+    [XGL_FMT_B8G8R8_UINT]          = { 3, 3 },
+    [XGL_FMT_B8G8R8_SINT]          = { 3, 3 },
+    [XGL_FMT_B8G8R8_SRGB]          = { 3, 3 },
+    [XGL_FMT_B8G8R8A8_UNORM]       = { 4, 4 },
+    [XGL_FMT_B8G8R8A8_SNORM]       = { 4, 4 },
+    [XGL_FMT_B8G8R8A8_USCALED]     = { 4, 4 },
+    [XGL_FMT_B8G8R8A8_SSCALED]     = { 4, 4 },
+    [XGL_FMT_B8G8R8A8_UINT]        = { 4, 4 },
+    [XGL_FMT_B8G8R8A8_SINT]        = { 4, 4 },
+    [XGL_FMT_B8G8R8A8_SRGB]        = { 4, 4 },
+    [XGL_FMT_B10G10R10A2_UNORM]    = { 4, 4 },
+    [XGL_FMT_B10G10R10A2_SNORM]    = { 4, 4 },
+    [XGL_FMT_B10G10R10A2_USCALED]  = { 4, 4 },
+    [XGL_FMT_B10G10R10A2_SSCALED]  = { 4, 4 },
+    [XGL_FMT_B10G10R10A2_UINT]     = { 4, 4 },
+    [XGL_FMT_B10G10R10A2_SINT]     = { 4, 4 },
 };
 
+bool icd_format_is_ds(XGL_FORMAT format)
+{
+    bool is_ds = false;
+
+    switch (format) {
+    case XGL_FMT_D16_UNORM:
+    case XGL_FMT_D24_UNORM:
+    case XGL_FMT_D32_SFLOAT:
+    case XGL_FMT_S8_UINT:
+    case XGL_FMT_D16_UNORM_S8_UINT:
+    case XGL_FMT_D24_UNORM_S8_UINT:
+    case XGL_FMT_D32_SFLOAT_S8_UINT:
+        is_ds = true;
+        break;
+    default:
+        break;
+    }
+
+    return is_ds;
+}
+
+bool icd_format_is_norm(XGL_FORMAT format)
+{
+    bool is_norm = false;
+
+    switch (format) {
+    case XGL_FMT_R4G4_UNORM:
+    case XGL_FMT_R4G4B4A4_UNORM:
+    case XGL_FMT_R5G6B5_UNORM:
+    case XGL_FMT_R5G5B5A1_UNORM:
+    case XGL_FMT_R8_UNORM:
+    case XGL_FMT_R8_SNORM:
+    case XGL_FMT_R8G8_UNORM:
+    case XGL_FMT_R8G8_SNORM:
+    case XGL_FMT_R8G8B8_UNORM:
+    case XGL_FMT_R8G8B8_SNORM:
+    case XGL_FMT_R8G8B8A8_UNORM:
+    case XGL_FMT_R8G8B8A8_SNORM:
+    case XGL_FMT_R10G10B10A2_UNORM:
+    case XGL_FMT_R10G10B10A2_SNORM:
+    case XGL_FMT_R16_UNORM:
+    case XGL_FMT_R16_SNORM:
+    case XGL_FMT_R16G16_UNORM:
+    case XGL_FMT_R16G16_SNORM:
+    case XGL_FMT_R16G16B16_UNORM:
+    case XGL_FMT_R16G16B16_SNORM:
+    case XGL_FMT_R16G16B16A16_UNORM:
+    case XGL_FMT_R16G16B16A16_SNORM:
+    case XGL_FMT_BC1_UNORM:
+    case XGL_FMT_BC2_UNORM:
+    case XGL_FMT_BC3_UNORM:
+    case XGL_FMT_BC4_UNORM:
+    case XGL_FMT_BC4_SNORM:
+    case XGL_FMT_BC5_UNORM:
+    case XGL_FMT_BC5_SNORM:
+    case XGL_FMT_BC7_UNORM:
+    case XGL_FMT_ETC2_R8G8B8_UNORM:
+    case XGL_FMT_ETC2_R8G8B8A1_UNORM:
+    case XGL_FMT_ETC2_R8G8B8A8_UNORM:
+    case XGL_FMT_EAC_R11_UNORM:
+    case XGL_FMT_EAC_R11_SNORM:
+    case XGL_FMT_EAC_R11G11_UNORM:
+    case XGL_FMT_EAC_R11G11_SNORM:
+    case XGL_FMT_ASTC_4x4_UNORM:
+    case XGL_FMT_ASTC_4x5_UNORM:
+    case XGL_FMT_ASTC_5x5_UNORM:
+    case XGL_FMT_ASTC_6x5_UNORM:
+    case XGL_FMT_ASTC_6x6_UNORM:
+    case XGL_FMT_ASTC_8x5_UNORM:
+    case XGL_FMT_ASTC_8x6_UNORM:
+    case XGL_FMT_ASTC_8x8_UNORM:
+    case XGL_FMT_ASTC_10x5_UNORM:
+    case XGL_FMT_ASTC_10x6_UNORM:
+    case XGL_FMT_ASTC_10x8_UNORM:
+    case XGL_FMT_ASTC_10x10_UNORM:
+    case XGL_FMT_ASTC_12x10_UNORM:
+    case XGL_FMT_ASTC_12x12_UNORM:
+    case XGL_FMT_B5G6R5_UNORM:
+    case XGL_FMT_B8G8R8_UNORM:
+    case XGL_FMT_B8G8R8_SNORM:
+    case XGL_FMT_B8G8R8A8_UNORM:
+    case XGL_FMT_B8G8R8A8_SNORM:
+    case XGL_FMT_B10G10R10A2_UNORM:
+    case XGL_FMT_B10G10R10A2_SNORM:
+        is_norm = true;
+        break;
+    default:
+        break;
+    }
+
+    return is_norm;
+};
+
+bool icd_format_is_int(XGL_FORMAT format)
+{
+    bool is_int = false;
+
+    switch (format) {
+    case XGL_FMT_R8_UINT:
+    case XGL_FMT_R8_SINT:
+    case XGL_FMT_R8G8_UINT:
+    case XGL_FMT_R8G8_SINT:
+    case XGL_FMT_R8G8B8_UINT:
+    case XGL_FMT_R8G8B8_SINT:
+    case XGL_FMT_R8G8B8A8_UINT:
+    case XGL_FMT_R8G8B8A8_SINT:
+    case XGL_FMT_R10G10B10A2_UINT:
+    case XGL_FMT_R10G10B10A2_SINT:
+    case XGL_FMT_R16_UINT:
+    case XGL_FMT_R16_SINT:
+    case XGL_FMT_R16G16_UINT:
+    case XGL_FMT_R16G16_SINT:
+    case XGL_FMT_R16G16B16_UINT:
+    case XGL_FMT_R16G16B16_SINT:
+    case XGL_FMT_R16G16B16A16_UINT:
+    case XGL_FMT_R16G16B16A16_SINT:
+    case XGL_FMT_R32_UINT:
+    case XGL_FMT_R32_SINT:
+    case XGL_FMT_R32G32_UINT:
+    case XGL_FMT_R32G32_SINT:
+    case XGL_FMT_R32G32B32_UINT:
+    case XGL_FMT_R32G32B32_SINT:
+    case XGL_FMT_R32G32B32A32_UINT:
+    case XGL_FMT_R32G32B32A32_SINT:
+    case XGL_FMT_B8G8R8_UINT:
+    case XGL_FMT_B8G8R8_SINT:
+    case XGL_FMT_B8G8R8A8_UINT:
+    case XGL_FMT_B8G8R8A8_SINT:
+    case XGL_FMT_B10G10R10A2_UINT:
+    case XGL_FMT_B10G10R10A2_SINT:
+        is_int = true;
+        break;
+    default:
+        break;
+    }
+
+    return is_int;
+}
+
+bool icd_format_is_float(XGL_FORMAT format)
+{
+    bool is_float = false;
+
+    switch (format) {
+    case XGL_FMT_R16_SFLOAT:
+    case XGL_FMT_R16G16_SFLOAT:
+    case XGL_FMT_R16G16B16_SFLOAT:
+    case XGL_FMT_R16G16B16A16_SFLOAT:
+    case XGL_FMT_R32_SFLOAT:
+    case XGL_FMT_R32G32_SFLOAT:
+    case XGL_FMT_R32G32B32_SFLOAT:
+    case XGL_FMT_R32G32B32A32_SFLOAT:
+    case XGL_FMT_R64_SFLOAT:
+    case XGL_FMT_R64G64_SFLOAT:
+    case XGL_FMT_R64G64B64_SFLOAT:
+    case XGL_FMT_R64G64B64A64_SFLOAT:
+    case XGL_FMT_R11G11B10_UFLOAT:
+    case XGL_FMT_R9G9B9E5_UFLOAT:
+    case XGL_FMT_BC6H_UFLOAT:
+    case XGL_FMT_BC6H_SFLOAT:
+        is_float = true;
+        break;
+    default:
+        break;
+    }
+
+    return is_float;
+}
+
+bool icd_format_is_srgb(XGL_FORMAT format)
+{
+    bool is_srgb = false;
+
+    switch (format) {
+    case XGL_FMT_R8_SRGB:
+    case XGL_FMT_R8G8_SRGB:
+    case XGL_FMT_R8G8B8_SRGB:
+    case XGL_FMT_R8G8B8A8_SRGB:
+    case XGL_FMT_BC1_SRGB:
+    case XGL_FMT_BC2_SRGB:
+    case XGL_FMT_BC3_SRGB:
+    case XGL_FMT_BC7_SRGB:
+    case XGL_FMT_ASTC_4x4_SRGB:
+    case XGL_FMT_ASTC_4x5_SRGB:
+    case XGL_FMT_ASTC_5x5_SRGB:
+    case XGL_FMT_ASTC_6x5_SRGB:
+    case XGL_FMT_ASTC_6x6_SRGB:
+    case XGL_FMT_ASTC_8x5_SRGB:
+    case XGL_FMT_ASTC_8x6_SRGB:
+    case XGL_FMT_ASTC_8x8_SRGB:
+    case XGL_FMT_ASTC_10x5_SRGB:
+    case XGL_FMT_ASTC_10x6_SRGB:
+    case XGL_FMT_ASTC_10x8_SRGB:
+    case XGL_FMT_ASTC_10x10_SRGB:
+    case XGL_FMT_ASTC_12x10_SRGB:
+    case XGL_FMT_ASTC_12x12_SRGB:
+    case XGL_FMT_B8G8R8_SRGB:
+    case XGL_FMT_B8G8R8A8_SRGB:
+        is_srgb = true;
+        break;
+    default:
+        break;
+    }
+
+    return is_srgb;
+}
+
+bool icd_format_is_compressed(XGL_FORMAT format)
+{
+    switch (format) {
+    case XGL_FMT_BC1_UNORM:
+    case XGL_FMT_BC1_SRGB:
+    case XGL_FMT_BC2_UNORM:
+    case XGL_FMT_BC2_SRGB:
+    case XGL_FMT_BC3_UNORM:
+    case XGL_FMT_BC3_SRGB:
+    case XGL_FMT_BC4_UNORM:
+    case XGL_FMT_BC4_SNORM:
+    case XGL_FMT_BC5_UNORM:
+    case XGL_FMT_BC5_SNORM:
+    case XGL_FMT_BC6H_UFLOAT:
+    case XGL_FMT_BC6H_SFLOAT:
+    case XGL_FMT_BC7_UNORM:
+    case XGL_FMT_BC7_SRGB:
+    case XGL_FMT_ETC2_R8G8B8_UNORM:
+    case XGL_FMT_ETC2_R8G8B8A1_UNORM:
+    case XGL_FMT_ETC2_R8G8B8A8_UNORM:
+    case XGL_FMT_EAC_R11_UNORM:
+    case XGL_FMT_EAC_R11_SNORM:
+    case XGL_FMT_EAC_R11G11_UNORM:
+    case XGL_FMT_EAC_R11G11_SNORM:
+    case XGL_FMT_ASTC_4x4_UNORM:
+    case XGL_FMT_ASTC_4x4_SRGB:
+    case XGL_FMT_ASTC_4x5_UNORM:
+    case XGL_FMT_ASTC_4x5_SRGB:
+    case XGL_FMT_ASTC_5x5_UNORM:
+    case XGL_FMT_ASTC_5x5_SRGB:
+    case XGL_FMT_ASTC_6x5_UNORM:
+    case XGL_FMT_ASTC_6x5_SRGB:
+    case XGL_FMT_ASTC_6x6_UNORM:
+    case XGL_FMT_ASTC_6x6_SRGB:
+    case XGL_FMT_ASTC_8x5_UNORM:
+    case XGL_FMT_ASTC_8x5_SRGB:
+    case XGL_FMT_ASTC_8x6_UNORM:
+    case XGL_FMT_ASTC_8x6_SRGB:
+    case XGL_FMT_ASTC_8x8_UNORM:
+    case XGL_FMT_ASTC_8x8_SRGB:
+    case XGL_FMT_ASTC_10x5_UNORM:
+    case XGL_FMT_ASTC_10x5_SRGB:
+    case XGL_FMT_ASTC_10x6_UNORM:
+    case XGL_FMT_ASTC_10x6_SRGB:
+    case XGL_FMT_ASTC_10x8_UNORM:
+    case XGL_FMT_ASTC_10x8_SRGB:
+    case XGL_FMT_ASTC_10x10_UNORM:
+    case XGL_FMT_ASTC_10x10_SRGB:
+    case XGL_FMT_ASTC_12x10_UNORM:
+    case XGL_FMT_ASTC_12x10_SRGB:
+    case XGL_FMT_ASTC_12x12_UNORM:
+    case XGL_FMT_ASTC_12x12_SRGB:
+        return true;
+    default:
+        return false;
+    }
+}
+
 size_t icd_format_get_size(XGL_FORMAT format)
 {
-    return icd_format_table[format.channelFormat].size;
+    return icd_format_table[format].size;
 }
 
 XGL_IMAGE_FORMAT_CLASS icd_format_get_class(XGL_FORMAT format)
@@ -146,7 +541,7 @@ XGL_IMAGE_FORMAT_CLASS icd_format_get_class(XGL_FORMAT format)
 
 unsigned int icd_format_get_channel_count(XGL_FORMAT format)
 {
-    return icd_format_table[format.channelFormat].channel_count;
+    return icd_format_table[format].channel_count;
 }
 
 /**
@@ -158,157 +553,229 @@ void icd_format_get_raw_value(XGL_FORMAT format,
                               void *value)
 {
     /* assume little-endian */
-    switch (format.channelFormat) {
-    case XGL_CH_FMT_UNDEFINED:
+    switch (format) {
+    case XGL_FMT_UNDEFINED:
         break;
-    case XGL_CH_FMT_R4G4:
+    case XGL_FMT_R4G4_UNORM:
+    case XGL_FMT_R4G4_USCALED:
         ((uint8_t *) value)[0]  = (color[0] & 0xf) << 0   |
                                   (color[1] & 0xf) << 4;
         break;
-    case XGL_CH_FMT_R4G4B4A4:
+    case XGL_FMT_R4G4B4A4_UNORM:
+    case XGL_FMT_R4G4B4A4_USCALED:
         ((uint16_t *) value)[0] = (color[0] & 0xf) << 0   |
                                   (color[1] & 0xf) << 4   |
                                   (color[2] & 0xf) << 8   |
                                   (color[3] & 0xf) << 12;
         break;
-    case XGL_CH_FMT_R5G6B5:
+    case XGL_FMT_R5G6B5_UNORM:
+    case XGL_FMT_R5G6B5_USCALED:
         ((uint16_t *) value)[0] = (color[0] & 0x1f) << 0  |
                                   (color[1] & 0x3f) << 5  |
                                   (color[2] & 0x1f) << 11;
         break;
-    case XGL_CH_FMT_B5G6R5:
+    case XGL_FMT_B5G6R5_UNORM:
         ((uint16_t *) value)[0] = (color[2] & 0x1f) << 0  |
                                   (color[1] & 0x3f) << 5  |
                                   (color[0] & 0x1f) << 11;
         break;
-    case XGL_CH_FMT_R5G5B5A1:
+    case XGL_FMT_R5G5B5A1_UNORM:
+    case XGL_FMT_R5G5B5A1_USCALED:
         ((uint16_t *) value)[0] = (color[0] & 0x1f) << 0  |
                                   (color[1] & 0x1f) << 5  |
                                   (color[2] & 0x1f) << 10 |
                                   (color[3] & 0x1)  << 15;
         break;
-    case XGL_CH_FMT_R8:
+    case XGL_FMT_R8_UNORM:
+    case XGL_FMT_R8_SNORM:
+    case XGL_FMT_R8_USCALED:
+    case XGL_FMT_R8_SSCALED:
+    case XGL_FMT_R8_UINT:
+    case XGL_FMT_R8_SINT:
+    case XGL_FMT_R8_SRGB:
         ((uint8_t *) value)[0]  = (uint8_t) color[0];
         break;
-    case XGL_CH_FMT_R8G8:
+    case XGL_FMT_R8G8_UNORM:
+    case XGL_FMT_R8G8_SNORM:
+    case XGL_FMT_R8G8_USCALED:
+    case XGL_FMT_R8G8_SSCALED:
+    case XGL_FMT_R8G8_UINT:
+    case XGL_FMT_R8G8_SINT:
+    case XGL_FMT_R8G8_SRGB:
         ((uint8_t *) value)[0]  = (uint8_t) color[0];
         ((uint8_t *) value)[1]  = (uint8_t) color[1];
         break;
-    case XGL_CH_FMT_R8G8B8A8:
+    case XGL_FMT_R8G8B8A8_UNORM:
+    case XGL_FMT_R8G8B8A8_SNORM:
+    case XGL_FMT_R8G8B8A8_USCALED:
+    case XGL_FMT_R8G8B8A8_SSCALED:
+    case XGL_FMT_R8G8B8A8_UINT:
+    case XGL_FMT_R8G8B8A8_SINT:
+    case XGL_FMT_R8G8B8A8_SRGB:
         ((uint8_t *) value)[0]  = (uint8_t) color[0];
         ((uint8_t *) value)[1]  = (uint8_t) color[1];
         ((uint8_t *) value)[2]  = (uint8_t) color[2];
         ((uint8_t *) value)[3]  = (uint8_t) color[3];
         break;
-    case XGL_CH_FMT_B8G8R8A8:
+    case XGL_FMT_B8G8R8A8_UNORM:
+    case XGL_FMT_B8G8R8A8_SRGB:
         ((uint8_t *) value)[0]  = (uint8_t) color[2];
         ((uint8_t *) value)[1]  = (uint8_t) color[1];
         ((uint8_t *) value)[2]  = (uint8_t) color[0];
         ((uint8_t *) value)[3]  = (uint8_t) color[3];
         break;
-    case XGL_CH_FMT_R10G11B11:
-        ((uint32_t *) value)[0] = (color[0] & 0x3ff) << 0  |
-                                  (color[1] & 0x7ff) << 10 |
-                                  (color[2] & 0x7ff) << 21;
-        break;
-    case XGL_CH_FMT_R11G11B10:
+    case XGL_FMT_R11G11B10_UFLOAT:
         ((uint32_t *) value)[0] = (color[0] & 0x7ff) << 0  |
                                   (color[1] & 0x7ff) << 11 |
                                   (color[2] & 0x3ff) << 22;
         break;
-    case XGL_CH_FMT_R10G10B10A2:
+    case XGL_FMT_R10G10B10A2_UNORM:
+    case XGL_FMT_R10G10B10A2_SNORM:
+    case XGL_FMT_R10G10B10A2_USCALED:
+    case XGL_FMT_R10G10B10A2_SSCALED:
+    case XGL_FMT_R10G10B10A2_UINT:
+    case XGL_FMT_R10G10B10A2_SINT:
         ((uint32_t *) value)[0] = (color[0] & 0x3ff) << 0  |
                                   (color[1] & 0x3ff) << 10 |
                                   (color[2] & 0x3ff) << 20 |
                                   (color[3] & 0x3)   << 30;
         break;
-    case XGL_CH_FMT_R16:
+    case XGL_FMT_R16_UNORM:
+    case XGL_FMT_R16_SNORM:
+    case XGL_FMT_R16_USCALED:
+    case XGL_FMT_R16_SSCALED:
+    case XGL_FMT_R16_UINT:
+    case XGL_FMT_R16_SINT:
+    case XGL_FMT_R16_SFLOAT:
         ((uint16_t *) value)[0] = (uint16_t) color[0];
         break;
-    case XGL_CH_FMT_R16G16:
+    case XGL_FMT_R16G16_UNORM:
+    case XGL_FMT_R16G16_SNORM:
+    case XGL_FMT_R16G16_USCALED:
+    case XGL_FMT_R16G16_SSCALED:
+    case XGL_FMT_R16G16_UINT:
+    case XGL_FMT_R16G16_SINT:
+    case XGL_FMT_R16G16_SFLOAT:
         ((uint16_t *) value)[0] = (uint16_t) color[0];
         ((uint16_t *) value)[1] = (uint16_t) color[1];
         break;
-    case XGL_CH_FMT_R16G16B16A16:
+    case XGL_FMT_R16G16B16A16_UNORM:
+    case XGL_FMT_R16G16B16A16_SNORM:
+    case XGL_FMT_R16G16B16A16_USCALED:
+    case XGL_FMT_R16G16B16A16_SSCALED:
+    case XGL_FMT_R16G16B16A16_UINT:
+    case XGL_FMT_R16G16B16A16_SINT:
+    case XGL_FMT_R16G16B16A16_SFLOAT:
         ((uint16_t *) value)[0] = (uint16_t) color[0];
         ((uint16_t *) value)[1] = (uint16_t) color[1];
         ((uint16_t *) value)[2] = (uint16_t) color[2];
         ((uint16_t *) value)[3] = (uint16_t) color[3];
         break;
-    case XGL_CH_FMT_R32:
+    case XGL_FMT_R32_UINT:
+    case XGL_FMT_R32_SINT:
+    case XGL_FMT_R32_SFLOAT:
         ((uint32_t *) value)[0] = color[0];
         break;
-    case XGL_CH_FMT_R32G32:
+    case XGL_FMT_R32G32_UINT:
+    case XGL_FMT_R32G32_SINT:
+    case XGL_FMT_R32G32_SFLOAT:
         ((uint32_t *) value)[0] = color[0];
         ((uint32_t *) value)[1] = color[1];
         break;
-    case XGL_CH_FMT_R32G32B32:
+    case XGL_FMT_R32G32B32_UINT:
+    case XGL_FMT_R32G32B32_SINT:
+    case XGL_FMT_R32G32B32_SFLOAT:
         ((uint32_t *) value)[0] = color[0];
         ((uint32_t *) value)[1] = color[1];
         ((uint32_t *) value)[2] = color[2];
         break;
-    case XGL_CH_FMT_R32G32B32A32:
+    case XGL_FMT_R32G32B32A32_UINT:
+    case XGL_FMT_R32G32B32A32_SINT:
+    case XGL_FMT_R32G32B32A32_SFLOAT:
         ((uint32_t *) value)[0] = color[0];
         ((uint32_t *) value)[1] = color[1];
         ((uint32_t *) value)[2] = color[2];
         ((uint32_t *) value)[3] = color[3];
         break;
-    case XGL_CH_FMT_R16G8:
+    case XGL_FMT_D16_UNORM_S8_UINT:
         ((uint16_t *) value)[0] = (uint16_t) color[0];
         ((char *) value)[2] = (uint8_t) color[1];
         break;
-    case XGL_CH_FMT_R32G8:
+    case XGL_FMT_D32_SFLOAT_S8_UINT:
         ((uint32_t *) value)[0] = (uint32_t) color[0];
         ((char *) value)[4] = (uint8_t) color[1];
         break;
-    case XGL_CH_FMT_R9G9B9E5:
+    case XGL_FMT_R9G9B9E5_UFLOAT:
         ((uint32_t *) value)[0] = (color[0] & 0x1ff) << 0  |
                                   (color[1] & 0x1ff) << 9  |
                                   (color[2] & 0x1ff) << 18 |
                                   (color[3] & 0x1f)  << 27;
         break;
-    case XGL_CH_FMT_BC1:
-    case XGL_CH_FMT_BC4:
+    case XGL_FMT_BC1_UNORM:
+    case XGL_FMT_BC1_SRGB:
+    case XGL_FMT_BC4_UNORM:
+    case XGL_FMT_BC4_SNORM:
         memcpy(value, color, 8);
         break;
-    case XGL_CH_FMT_BC2:
-    case XGL_CH_FMT_BC3:
-    case XGL_CH_FMT_BC5:
-    case XGL_CH_FMT_BC6U:
-    case XGL_CH_FMT_BC6S:
-    case XGL_CH_FMT_BC7:
+    case XGL_FMT_BC2_UNORM:
+    case XGL_FMT_BC2_SRGB:
+    case XGL_FMT_BC3_UNORM:
+    case XGL_FMT_BC3_SRGB:
+    case XGL_FMT_BC5_UNORM:
+    case XGL_FMT_BC5_SNORM:
+    case XGL_FMT_BC6H_UFLOAT:
+    case XGL_FMT_BC6H_SFLOAT:
+    case XGL_FMT_BC7_UNORM:
+    case XGL_FMT_BC7_SRGB:
         memcpy(value, color, 16);
         break;
-    case XGL_CH_FMT_R8G8B8:
+    case XGL_FMT_R8G8B8_UNORM:
+    case XGL_FMT_R8G8B8_SNORM:
+    case XGL_FMT_R8G8B8_USCALED:
+    case XGL_FMT_R8G8B8_SSCALED:
+    case XGL_FMT_R8G8B8_UINT:
+    case XGL_FMT_R8G8B8_SINT:
+    case XGL_FMT_R8G8B8_SRGB:
         ((uint8_t *) value)[0]  = (uint8_t) color[0];
         ((uint8_t *) value)[1]  = (uint8_t) color[1];
         ((uint8_t *) value)[2]  = (uint8_t) color[2];
         break;
-    case XGL_CH_FMT_R16G16B16:
+    case XGL_FMT_R16G16B16_UNORM:
+    case XGL_FMT_R16G16B16_SNORM:
+    case XGL_FMT_R16G16B16_USCALED:
+    case XGL_FMT_R16G16B16_SSCALED:
+    case XGL_FMT_R16G16B16_UINT:
+    case XGL_FMT_R16G16B16_SINT:
+    case XGL_FMT_R16G16B16_SFLOAT:
         ((uint16_t *) value)[0] = (uint16_t) color[0];
         ((uint16_t *) value)[1] = (uint16_t) color[1];
         ((uint16_t *) value)[2] = (uint16_t) color[2];
         break;
-    case XGL_CH_FMT_B10G10R10A2:
+    case XGL_FMT_B10G10R10A2_UNORM:
+    case XGL_FMT_B10G10R10A2_SNORM:
+    case XGL_FMT_B10G10R10A2_USCALED:
+    case XGL_FMT_B10G10R10A2_SSCALED:
+    case XGL_FMT_B10G10R10A2_UINT:
+    case XGL_FMT_B10G10R10A2_SINT:
         ((uint32_t *) value)[0] = (color[2] & 0x3ff) << 0  |
                                   (color[1] & 0x3ff) << 10 |
                                   (color[0] & 0x3ff) << 20 |
                                   (color[3] & 0x3)   << 30;
         break;
-    case XGL_CH_FMT_R64:
+    case XGL_FMT_R64_SFLOAT:
         /* higher 32 bits always 0 */
         ((uint64_t *) value)[0] = color[0];
         break;
-    case XGL_CH_FMT_R64G64:
+    case XGL_FMT_R64G64_SFLOAT:
         ((uint64_t *) value)[0] = color[0];
         ((uint64_t *) value)[1] = color[1];
         break;
-    case XGL_CH_FMT_R64G64B64:
+    case XGL_FMT_R64G64B64_SFLOAT:
         ((uint64_t *) value)[0] = color[0];
         ((uint64_t *) value)[1] = color[1];
         ((uint64_t *) value)[2] = color[2];
         break;
-    case XGL_CH_FMT_R64G64B64A64:
+    case XGL_FMT_R64G64B64A64_SFLOAT:
         ((uint64_t *) value)[0] = color[0];
         ((uint64_t *) value)[1] = color[1];
         ((uint64_t *) value)[2] = color[2];
index 9c4170017ddd7a907e120b8836fc368227424814..f1825f6610e66e411dda56c3e1aafe8c2208705f 100644 (file)
 
 static inline bool icd_format_is_undef(XGL_FORMAT format)
 {
-    return (format.numericFormat == XGL_NUM_FMT_UNDEFINED);
+    return (format == XGL_FMT_UNDEFINED);
 }
 
-static inline bool icd_format_is_ds(XGL_FORMAT format)
-{
-    return (format.numericFormat == XGL_NUM_FMT_DS);
-}
+bool icd_format_is_ds(XGL_FORMAT format);
 
 static inline bool icd_format_is_color(XGL_FORMAT format)
 {
     return !(icd_format_is_undef(format) || icd_format_is_ds(format));
 }
 
-static inline bool icd_format_is_norm(XGL_FORMAT format)
-{
-    return (format.numericFormat == XGL_NUM_FMT_UNORM ||
-            format.numericFormat == XGL_NUM_FMT_SNORM);
-};
+bool icd_format_is_norm(XGL_FORMAT format);
 
-static inline bool icd_format_is_int(XGL_FORMAT format)
-{
-    return (format.numericFormat == XGL_NUM_FMT_UINT ||
-            format.numericFormat == XGL_NUM_FMT_SINT);
-}
+bool icd_format_is_int(XGL_FORMAT format);
 
-static inline bool icd_format_is_float(XGL_FORMAT format)
-{
-    return (format.numericFormat == XGL_NUM_FMT_FLOAT);
-}
+bool icd_format_is_float(XGL_FORMAT format);
 
-static inline bool icd_format_is_srgb(XGL_FORMAT format)
-{
-    return (format.numericFormat == XGL_NUM_FMT_SRGB);
-}
+bool icd_format_is_srgb(XGL_FORMAT format);
 
-static inline bool icd_format_is_scaled(XGL_FORMAT format)
-{
-    return (format.numericFormat == XGL_NUM_FMT_USCALED ||
-            format.numericFormat == XGL_NUM_FMT_SSCALED);
-}
-
-static inline bool icd_format_is_compressed(XGL_FORMAT format)
-{
-    switch (format.channelFormat) {
-    case XGL_CH_FMT_BC1:
-    case XGL_CH_FMT_BC2:
-    case XGL_CH_FMT_BC3:
-    case XGL_CH_FMT_BC4:
-    case XGL_CH_FMT_BC5:
-    case XGL_CH_FMT_BC6U:
-    case XGL_CH_FMT_BC6S:
-    case XGL_CH_FMT_BC7:
-        return true;
-    default:
-        return false;
-    }
-}
-
-static inline bool icd_format_is_equal(XGL_FORMAT a, XGL_FORMAT b)
-{
-    return (a.channelFormat == b.channelFormat &&
-            a.numericFormat == b.numericFormat);
-}
+bool icd_format_is_compressed(XGL_FORMAT format);
 
 static inline int icd_format_get_block_width(XGL_FORMAT format)
 {
index 1452433081762b64b8b21e0b32e94675f13f3db1..95201905b5ca92a0a4ec735f0fbd3f3d24e2472f 100644 (file)
@@ -54,7 +54,7 @@
 #include "xglPlatform.h"
 
 // XGL API version supported by this file
-#define XGL_API_VERSION XGL_MAKE_VERSION(0, 30, 7)
+#define XGL_API_VERSION XGL_MAKE_VERSION(0, 30, 8)
 
 #ifdef __cplusplus
 extern "C"
@@ -800,65 +800,6 @@ typedef enum _XGL_RESULT_CODE
 // ------------------------------------------------------------------------------------------------
 // XGL format definitions
 
-typedef enum _XGL_CHANNEL_FORMAT
-{
-    XGL_CH_FMT_UNDEFINED                                    = 0,
-    XGL_CH_FMT_R4G4                                         = 1,
-    XGL_CH_FMT_R4G4B4A4                                     = 2,
-    XGL_CH_FMT_R5G6B5                                       = 3,
-    XGL_CH_FMT_B5G6R5                                       = 4,
-    XGL_CH_FMT_R5G5B5A1                                     = 5,
-    XGL_CH_FMT_R8                                           = 6,
-    XGL_CH_FMT_R8G8                                         = 7,
-    XGL_CH_FMT_R8G8B8A8                                     = 8,
-    XGL_CH_FMT_B8G8R8A8                                     = 9,
-    XGL_CH_FMT_R10G11B11                                    = 10,
-    XGL_CH_FMT_R11G11B10                                    = 11,
-    XGL_CH_FMT_R10G10B10A2                                  = 12,
-    XGL_CH_FMT_R16                                          = 13,
-    XGL_CH_FMT_R16G16                                       = 14,
-    XGL_CH_FMT_R16G16B16A16                                 = 15,
-    XGL_CH_FMT_R32                                          = 16,
-    XGL_CH_FMT_R32G32                                       = 17,
-    XGL_CH_FMT_R32G32B32                                    = 18,
-    XGL_CH_FMT_R32G32B32A32                                 = 19,
-    XGL_CH_FMT_R16G8                                        = 20,
-    XGL_CH_FMT_R32G8                                        = 21,
-    XGL_CH_FMT_R9G9B9E5                                     = 22,
-    XGL_CH_FMT_BC1                                          = 23,
-    XGL_CH_FMT_BC2                                          = 24,
-    XGL_CH_FMT_BC3                                          = 25,
-    XGL_CH_FMT_BC4                                          = 26,
-    XGL_CH_FMT_BC5                                          = 27,
-    XGL_CH_FMT_BC6U                                         = 28,
-    XGL_CH_FMT_BC6S                                         = 29,
-    XGL_CH_FMT_BC7                                          = 30,
-    XGL_CH_FMT_R8G8B8                                       = 31,
-    XGL_CH_FMT_R16G16B16                                    = 32,
-    XGL_CH_FMT_B10G10R10A2                                  = 33,
-    XGL_CH_FMT_R64                                          = 34, // Optional
-    XGL_CH_FMT_R64G64                                       = 35, // Optional
-    XGL_CH_FMT_R64G64B64                                    = 36, // Optional
-    XGL_CH_FMT_R64G64B64A64                                 = 37, // Optional
-    XGL_MAX_CH_FMT                                          = XGL_CH_FMT_R64G64B64A64,
-    XGL_MAX_ENUM(_XGL_CHANNEL_FORMAT)
-} XGL_CHANNEL_FORMAT;
-
-typedef enum _XGL_NUM_FORMAT
-{
-    XGL_NUM_FMT_UNDEFINED                                   = 0,
-    XGL_NUM_FMT_UNORM                                       = 1,
-    XGL_NUM_FMT_SNORM                                       = 2,
-    XGL_NUM_FMT_UINT                                        = 3,
-    XGL_NUM_FMT_SINT                                        = 4,
-    XGL_NUM_FMT_FLOAT                                       = 5,
-    XGL_NUM_FMT_SRGB                                        = 6,
-    XGL_NUM_FMT_DS                                          = 7,
-    XGL_NUM_FMT_USCALED                                     = 8,
-    XGL_NUM_FMT_SSCALED                                     = 9,
-    XGL_MAX_NUM_FMT                                         = XGL_NUM_FMT_SSCALED,
-    XGL_MAX_ENUM(_XGL_NUM_FORMAT)
-} XGL_NUM_FORMAT;
 
 typedef enum _XGL_VERTEX_INPUT_STEP_RATE
 {
@@ -872,14 +813,180 @@ typedef enum _XGL_VERTEX_INPUT_STEP_RATE
     XGL_MAX_ENUM(_XGL_VERTEX_INPUT_STEP_RATE)
 } XGL_VERTEX_INPUT_STEP_RATE;
 
-typedef struct _XGL_FORMAT
-{
-    XGL_CHANNEL_FORMAT  channelFormat;
-    XGL_NUM_FORMAT      numericFormat;
-
-//    XGL_FMT_BEGIN_RANGE                                     = XGL_FMT_UNDEFINED,   ////LUGMAL
-//    XGL_FMT_END_RANGE                                       = XGL_FMT_ASTC_12x12_SRGB,
-//    XGL_NUM_FMT                                             = (XGL_FMT_END_RANGE - XGL_FMT_BEGIN_RANGE + 1),
+typedef enum _XGL_FORMAT
+{
+    XGL_FMT_UNDEFINED                                       = 0x00000000,
+    XGL_FMT_R4G4_UNORM                                      = 0x00000001,
+    XGL_FMT_R4G4_USCALED                                    = 0x00000002,
+    XGL_FMT_R4G4B4A4_UNORM                                  = 0x00000003,
+    XGL_FMT_R4G4B4A4_USCALED                                = 0x00000004,
+    XGL_FMT_R5G6B5_UNORM                                    = 0x00000005,
+    XGL_FMT_R5G6B5_USCALED                                  = 0x00000006,
+    XGL_FMT_R5G5B5A1_UNORM                                  = 0x00000007,
+    XGL_FMT_R5G5B5A1_USCALED                                = 0x00000008,
+    XGL_FMT_R8_UNORM                                        = 0x00000009,
+    XGL_FMT_R8_SNORM                                        = 0x0000000A,
+    XGL_FMT_R8_USCALED                                      = 0x0000000B,
+    XGL_FMT_R8_SSCALED                                      = 0x0000000C,
+    XGL_FMT_R8_UINT                                         = 0x0000000D,
+    XGL_FMT_R8_SINT                                         = 0x0000000E,
+    XGL_FMT_R8_SRGB                                         = 0x0000000F,
+    XGL_FMT_R8G8_UNORM                                      = 0x00000010,
+    XGL_FMT_R8G8_SNORM                                      = 0x00000011,
+    XGL_FMT_R8G8_USCALED                                    = 0x00000012,
+    XGL_FMT_R8G8_SSCALED                                    = 0x00000013,
+    XGL_FMT_R8G8_UINT                                       = 0x00000014,
+    XGL_FMT_R8G8_SINT                                       = 0x00000015,
+    XGL_FMT_R8G8_SRGB                                       = 0x00000016,
+    XGL_FMT_R8G8B8_UNORM                                    = 0x00000017,
+    XGL_FMT_R8G8B8_SNORM                                    = 0x00000018,
+    XGL_FMT_R8G8B8_USCALED                                  = 0x00000019,
+    XGL_FMT_R8G8B8_SSCALED                                  = 0x0000001A,
+    XGL_FMT_R8G8B8_UINT                                     = 0x0000001B,
+    XGL_FMT_R8G8B8_SINT                                     = 0x0000001C,
+    XGL_FMT_R8G8B8_SRGB                                     = 0x0000001D,
+    XGL_FMT_R8G8B8A8_UNORM                                  = 0x0000001E,
+    XGL_FMT_R8G8B8A8_SNORM                                  = 0x0000001F,
+    XGL_FMT_R8G8B8A8_USCALED                                = 0x00000020,
+    XGL_FMT_R8G8B8A8_SSCALED                                = 0x00000021,
+    XGL_FMT_R8G8B8A8_UINT                                   = 0x00000022,
+    XGL_FMT_R8G8B8A8_SINT                                   = 0x00000023,
+    XGL_FMT_R8G8B8A8_SRGB                                   = 0x00000024,
+    XGL_FMT_R10G10B10A2_UNORM                               = 0x00000025,
+    XGL_FMT_R10G10B10A2_SNORM                               = 0x00000026,
+    XGL_FMT_R10G10B10A2_USCALED                             = 0x00000027,
+    XGL_FMT_R10G10B10A2_SSCALED                             = 0x00000028,
+    XGL_FMT_R10G10B10A2_UINT                                = 0x00000029,
+    XGL_FMT_R10G10B10A2_SINT                                = 0x0000002A,
+    XGL_FMT_R16_UNORM                                       = 0x0000002B,
+    XGL_FMT_R16_SNORM                                       = 0x0000002C,
+    XGL_FMT_R16_USCALED                                     = 0x0000002D,
+    XGL_FMT_R16_SSCALED                                     = 0x0000002E,
+    XGL_FMT_R16_UINT                                        = 0x0000002F,
+    XGL_FMT_R16_SINT                                        = 0x00000030,
+    XGL_FMT_R16_SFLOAT                                      = 0x00000031,
+    XGL_FMT_R16G16_UNORM                                    = 0x00000032,
+    XGL_FMT_R16G16_SNORM                                    = 0x00000033,
+    XGL_FMT_R16G16_USCALED                                  = 0x00000034,
+    XGL_FMT_R16G16_SSCALED                                  = 0x00000035,
+    XGL_FMT_R16G16_UINT                                     = 0x00000036,
+    XGL_FMT_R16G16_SINT                                     = 0x00000037,
+    XGL_FMT_R16G16_SFLOAT                                   = 0x00000038,
+    XGL_FMT_R16G16B16_UNORM                                 = 0x00000039,
+    XGL_FMT_R16G16B16_SNORM                                 = 0x0000003A,
+    XGL_FMT_R16G16B16_USCALED                               = 0x0000003B,
+    XGL_FMT_R16G16B16_SSCALED                               = 0x0000003C,
+    XGL_FMT_R16G16B16_UINT                                  = 0x0000003D,
+    XGL_FMT_R16G16B16_SINT                                  = 0x0000003E,
+    XGL_FMT_R16G16B16_SFLOAT                                = 0x0000003F,
+    XGL_FMT_R16G16B16A16_UNORM                              = 0x00000040,
+    XGL_FMT_R16G16B16A16_SNORM                              = 0x00000041,
+    XGL_FMT_R16G16B16A16_USCALED                            = 0x00000042,
+    XGL_FMT_R16G16B16A16_SSCALED                            = 0x00000043,
+    XGL_FMT_R16G16B16A16_UINT                               = 0x00000044,
+    XGL_FMT_R16G16B16A16_SINT                               = 0x00000045,
+    XGL_FMT_R16G16B16A16_SFLOAT                             = 0x00000046,
+    XGL_FMT_R32_UINT                                        = 0x00000047,
+    XGL_FMT_R32_SINT                                        = 0x00000048,
+    XGL_FMT_R32_SFLOAT                                      = 0x00000049,
+    XGL_FMT_R32G32_UINT                                     = 0x0000004A,
+    XGL_FMT_R32G32_SINT                                     = 0x0000004B,
+    XGL_FMT_R32G32_SFLOAT                                   = 0x0000004C,
+    XGL_FMT_R32G32B32_UINT                                  = 0x0000004D,
+    XGL_FMT_R32G32B32_SINT                                  = 0x0000004E,
+    XGL_FMT_R32G32B32_SFLOAT                                = 0x0000004F,
+    XGL_FMT_R32G32B32A32_UINT                               = 0x00000050,
+    XGL_FMT_R32G32B32A32_SINT                               = 0x00000051,
+    XGL_FMT_R32G32B32A32_SFLOAT                             = 0x00000052,
+    XGL_FMT_R64_SFLOAT                                      = 0x00000053,
+    XGL_FMT_R64G64_SFLOAT                                   = 0x00000054,
+    XGL_FMT_R64G64B64_SFLOAT                                = 0x00000055,
+    XGL_FMT_R64G64B64A64_SFLOAT                             = 0x00000056,
+    XGL_FMT_R11G11B10_UFLOAT                                = 0x00000057,
+    XGL_FMT_R9G9B9E5_UFLOAT                                 = 0x00000058,
+    XGL_FMT_D16_UNORM                                       = 0x00000059,
+    XGL_FMT_D24_UNORM                                       = 0x0000005A,
+    XGL_FMT_D32_SFLOAT                                      = 0x0000005B,
+    XGL_FMT_S8_UINT                                         = 0x0000005C,
+    XGL_FMT_D16_UNORM_S8_UINT                               = 0x0000005D,
+    XGL_FMT_D24_UNORM_S8_UINT                               = 0x0000005E,
+    XGL_FMT_D32_SFLOAT_S8_UINT                              = 0x0000005F,
+    XGL_FMT_BC1_UNORM                                       = 0x00000060,
+    XGL_FMT_BC1_SRGB                                        = 0x00000061,
+    XGL_FMT_BC2_UNORM                                       = 0x00000062,
+    XGL_FMT_BC2_SRGB                                        = 0x00000063,
+    XGL_FMT_BC3_UNORM                                       = 0x00000064,
+    XGL_FMT_BC3_SRGB                                        = 0x00000065,
+    XGL_FMT_BC4_UNORM                                       = 0x00000066,
+    XGL_FMT_BC4_SNORM                                       = 0x00000067,
+    XGL_FMT_BC5_UNORM                                       = 0x00000068,
+    XGL_FMT_BC5_SNORM                                       = 0x00000069,
+    XGL_FMT_BC6H_UFLOAT                                     = 0x0000006A,
+    XGL_FMT_BC6H_SFLOAT                                     = 0x0000006B,
+    XGL_FMT_BC7_UNORM                                       = 0x0000006C,
+    XGL_FMT_BC7_SRGB                                        = 0x0000006D,
+    XGL_FMT_ETC2_R8G8B8_UNORM                               = 0x0000006E,
+    XGL_FMT_ETC2_R8G8B8A1_UNORM                             = 0x0000006F,
+    XGL_FMT_ETC2_R8G8B8A8_UNORM                             = 0x00000070,
+    XGL_FMT_EAC_R11_UNORM                                   = 0x00000071,
+    XGL_FMT_EAC_R11_SNORM                                   = 0x00000072,
+    XGL_FMT_EAC_R11G11_UNORM                                = 0x00000073,
+    XGL_FMT_EAC_R11G11_SNORM                                = 0x00000074,
+    XGL_FMT_ASTC_4x4_UNORM                                  = 0x00000075,
+    XGL_FMT_ASTC_4x4_SRGB                                   = 0x00000076,
+    XGL_FMT_ASTC_4x5_UNORM                                  = 0x00000077,
+    XGL_FMT_ASTC_4x5_SRGB                                   = 0x00000078,
+    XGL_FMT_ASTC_5x5_UNORM                                  = 0x00000079,
+    XGL_FMT_ASTC_5x5_SRGB                                   = 0x0000007A,
+    XGL_FMT_ASTC_6x5_UNORM                                  = 0x0000007B,
+    XGL_FMT_ASTC_6x5_SRGB                                   = 0x0000007C,
+    XGL_FMT_ASTC_6x6_UNORM                                  = 0x0000007D,
+    XGL_FMT_ASTC_6x6_SRGB                                   = 0x0000007E,
+    XGL_FMT_ASTC_8x5_UNORM                                  = 0x0000007F,
+    XGL_FMT_ASTC_8x5_SRGB                                   = 0x00000080,
+    XGL_FMT_ASTC_8x6_UNORM                                  = 0x00000081,
+    XGL_FMT_ASTC_8x6_SRGB                                   = 0x00000082,
+    XGL_FMT_ASTC_8x8_UNORM                                  = 0x00000083,
+    XGL_FMT_ASTC_8x8_SRGB                                   = 0x00000084,
+    XGL_FMT_ASTC_10x5_UNORM                                 = 0x00000085,
+    XGL_FMT_ASTC_10x5_SRGB                                  = 0x00000086,
+    XGL_FMT_ASTC_10x6_UNORM                                 = 0x00000087,
+    XGL_FMT_ASTC_10x6_SRGB                                  = 0x00000088,
+    XGL_FMT_ASTC_10x8_UNORM                                 = 0x00000089,
+    XGL_FMT_ASTC_10x8_SRGB                                  = 0x0000008A,
+    XGL_FMT_ASTC_10x10_UNORM                                = 0x0000008B,
+    XGL_FMT_ASTC_10x10_SRGB                                 = 0x0000008C,
+    XGL_FMT_ASTC_12x10_UNORM                                = 0x0000008D,
+    XGL_FMT_ASTC_12x10_SRGB                                 = 0x0000008E,
+    XGL_FMT_ASTC_12x12_UNORM                                = 0x0000008F,
+    XGL_FMT_ASTC_12x12_SRGB                                 = 0x00000090,
+    XGL_FMT_B5G6R5_UNORM                                    = 0x00000091,
+    XGL_FMT_B5G6R5_USCALED                                  = 0x00000092,
+    XGL_FMT_B8G8R8_UNORM                                    = 0x00000093,
+    XGL_FMT_B8G8R8_SNORM                                    = 0x00000094,
+    XGL_FMT_B8G8R8_USCALED                                  = 0x00000095,
+    XGL_FMT_B8G8R8_SSCALED                                  = 0x00000096,
+    XGL_FMT_B8G8R8_UINT                                     = 0x00000097,
+    XGL_FMT_B8G8R8_SINT                                     = 0x00000098,
+    XGL_FMT_B8G8R8_SRGB                                     = 0x00000099,
+    XGL_FMT_B8G8R8A8_UNORM                                  = 0x0000009A,
+    XGL_FMT_B8G8R8A8_SNORM                                  = 0x0000009B,
+    XGL_FMT_B8G8R8A8_USCALED                                = 0x0000009C,
+    XGL_FMT_B8G8R8A8_SSCALED                                = 0x0000009D,
+    XGL_FMT_B8G8R8A8_UINT                                   = 0x0000009E,
+    XGL_FMT_B8G8R8A8_SINT                                   = 0x0000009F,
+    XGL_FMT_B8G8R8A8_SRGB                                   = 0x000000A0,
+    XGL_FMT_B10G10R10A2_UNORM                               = 0x000000A1,
+    XGL_FMT_B10G10R10A2_SNORM                               = 0x000000A2,
+    XGL_FMT_B10G10R10A2_USCALED                             = 0x000000A3,
+    XGL_FMT_B10G10R10A2_SSCALED                             = 0x000000A4,
+    XGL_FMT_B10G10R10A2_UINT                                = 0x000000A5,
+    XGL_FMT_B10G10R10A2_SINT                                = 0x000000A6,
+
+    XGL_FMT_BEGIN_RANGE                                     = XGL_FMT_UNDEFINED,
+    XGL_FMT_END_RANGE                                       = XGL_FMT_B10G10R10A2_SINT,
+    XGL_NUM_FMT                                             = (XGL_FMT_END_RANGE - XGL_FMT_BEGIN_RANGE + 1),
+    XGL_MAX_ENUM(_XGL_FORMAT)
 } XGL_FORMAT;
 
 // Shader stage enumerant