mesa: don't turn on GL_EXT_transform_feedback yet
[mesa.git] / src / mesa / main / formats.c
index a1a8ea88359c16e1fa48d70e27e68af5565a37a2..d0c9c0028b2cea90d3bc0bedbe2410523f092c1d 100644 (file)
@@ -27,7 +27,6 @@
 #include "imports.h"
 #include "formats.h"
 #include "config.h"
-#include "texstore.h"
 
 
 /**
@@ -37,9 +36,13 @@ struct gl_format_info
 {
    gl_format Name;
 
+   /** text name for debugging */
+   const char *StrName;
+
    /**
     * Base format is one of GL_RGB, GL_RGBA, GL_ALPHA, GL_LUMINANCE,
-    * GL_LUMINANCE_ALPHA, GL_INTENSITY, GL_COLOR_INDEX, GL_DEPTH_COMPONENT.
+    * GL_LUMINANCE_ALPHA, GL_INTENSITY, GL_YCBCR_MESA, GL_COLOR_INDEX,
+    * GL_DEPTH_COMPONENT, GL_STENCIL_INDEX, GL_DEPTH_STENCIL.
     */
    GLenum BaseFormat;
 
@@ -76,6 +79,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
 {
    {
       MESA_FORMAT_NONE,            /* Name */
+      "MESA_FORMAT_NONE",          /* StrName */
       GL_NONE,                     /* BaseFormat */
       GL_NONE,                     /* DataType */
       0, 0, 0, 0,                  /* Red/Green/Blue/AlphaBits */
@@ -84,6 +88,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_RGBA8888,        /* Name */
+      "MESA_FORMAT_RGBA8888",      /* StrName */
       GL_RGBA,                     /* BaseFormat */
       GL_UNSIGNED_NORMALIZED,      /* DataType */
       8, 8, 8, 8,                  /* Red/Green/Blue/AlphaBits */
@@ -92,6 +97,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_RGBA8888_REV,    /* Name */
+      "MESA_FORMAT_RGBA8888_REV",  /* StrName */
       GL_RGBA,                     /* BaseFormat */
       GL_UNSIGNED_NORMALIZED,      /* DataType */
       8, 8, 8, 8,                  /* Red/Green/Blue/AlphaBits */
@@ -100,6 +106,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_ARGB8888,        /* Name */
+      "MESA_FORMAT_ARGB8888",      /* StrName */
       GL_RGBA,                     /* BaseFormat */
       GL_UNSIGNED_NORMALIZED,      /* DataType */
       8, 8, 8, 8,                  /* Red/Green/Blue/AlphaBits */
@@ -108,14 +115,34 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_ARGB8888_REV,    /* Name */
+      "MESA_FORMAT_ARGB8888_REV",  /* StrName */
       GL_RGBA,                     /* BaseFormat */
       GL_UNSIGNED_NORMALIZED,      /* DataType */
       8, 8, 8, 8,                  /* Red/Green/Blue/AlphaBits */
       0, 0, 0, 0, 0,               /* Lum/Int/Index/Depth/StencilBits */
       1, 1, 4                      /* BlockWidth/Height,Bytes */
    },
+   {
+      MESA_FORMAT_XRGB8888,        /* Name */
+      "MESA_FORMAT_XRGB8888",      /* StrName */
+      GL_RGB,                      /* BaseFormat */
+      GL_UNSIGNED_NORMALIZED,      /* DataType */
+      8, 8, 8, 0,                  /* Red/Green/Blue/AlphaBits */
+      0, 0, 0, 0, 0,               /* Lum/Int/Index/Depth/StencilBits */
+      1, 1, 4                      /* BlockWidth/Height,Bytes */
+   },
+   {
+      MESA_FORMAT_XRGB8888_REV,    /* Name */
+      "MESA_FORMAT_XRGB8888_REV",  /* StrName */
+      GL_RGB,                      /* BaseFormat */
+      GL_UNSIGNED_NORMALIZED,      /* DataType */
+      8, 8, 8, 0,                  /* Red/Green/Blue/AlphaBits */
+      0, 0, 0, 0, 0,               /* Lum/Int/Index/Depth/StencilBits */
+      1, 1, 4                      /* BlockWidth/Height,Bytes */
+   },
    {
       MESA_FORMAT_RGB888,          /* Name */
+      "MESA_FORMAT_RGB888",        /* StrName */
       GL_RGB,                      /* BaseFormat */
       GL_UNSIGNED_NORMALIZED,      /* DataType */
       8, 8, 8, 0,                  /* Red/Green/Blue/AlphaBits */
@@ -124,6 +151,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_BGR888,          /* Name */
+      "MESA_FORMAT_BGR888",        /* StrName */
       GL_RGB,                      /* BaseFormat */
       GL_UNSIGNED_NORMALIZED,      /* DataType */
       8, 8, 8, 0,                  /* Red/Green/Blue/AlphaBits */
@@ -132,6 +160,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_RGB565,          /* Name */
+      "MESA_FORMAT_RGB565",        /* StrName */
       GL_RGB,                      /* BaseFormat */
       GL_UNSIGNED_NORMALIZED,      /* DataType */
       5, 6, 5, 0,                  /* Red/Green/Blue/AlphaBits */
@@ -140,6 +169,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_RGB565_REV,      /* Name */
+      "MESA_FORMAT_RGB565_REV",    /* StrName */
       GL_RGB,                      /* BaseFormat */
       GL_UNSIGNED_NORMALIZED,      /* DataType */
       5, 6, 5, 0,                  /* Red/Green/Blue/AlphaBits */
@@ -148,6 +178,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_ARGB4444,        /* Name */
+      "MESA_FORMAT_ARGB4444",      /* StrName */
       GL_RGBA,                     /* BaseFormat */
       GL_UNSIGNED_NORMALIZED,      /* DataType */
       4, 4, 4, 4,                  /* Red/Green/Blue/AlphaBits */
@@ -156,6 +187,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_ARGB4444_REV,    /* Name */
+      "MESA_FORMAT_ARGB4444_REV",  /* StrName */
       GL_RGBA,                     /* BaseFormat */
       GL_UNSIGNED_NORMALIZED,      /* DataType */
       4, 4, 4, 4,                  /* Red/Green/Blue/AlphaBits */
@@ -164,6 +196,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_RGBA5551,        /* Name */
+      "MESA_FORMAT_RGBA5551",      /* StrName */
       GL_RGBA,                     /* BaseFormat */
       GL_UNSIGNED_NORMALIZED,      /* DataType */
       5, 5, 5, 1,                  /* Red/Green/Blue/AlphaBits */
@@ -172,6 +205,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_ARGB1555,        /* Name */
+      "MESA_FORMAT_ARGB1555",      /* StrName */
       GL_RGBA,                     /* BaseFormat */
       GL_UNSIGNED_NORMALIZED,      /* DataType */
       5, 5, 5, 1,                  /* Red/Green/Blue/AlphaBits */
@@ -180,6 +214,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_ARGB1555_REV,    /* Name */
+      "MESA_FORMAT_ARGB1555_REV",  /* StrName */
       GL_RGBA,                     /* BaseFormat */
       GL_UNSIGNED_NORMALIZED,      /* DataType */
       5, 5, 5, 1,                  /* Red/Green/Blue/AlphaBits */
@@ -188,6 +223,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_AL88,            /* Name */
+      "MESA_FORMAT_AL88",          /* StrName */
       GL_LUMINANCE_ALPHA,          /* BaseFormat */
       GL_UNSIGNED_NORMALIZED,      /* DataType */
       0, 0, 0, 8,                  /* Red/Green/Blue/AlphaBits */
@@ -196,14 +232,34 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_AL88_REV,        /* Name */
+      "MESA_FORMAT_AL88_REV",      /* StrName */
       GL_LUMINANCE_ALPHA,          /* BaseFormat */
       GL_UNSIGNED_NORMALIZED,      /* DataType */
       0, 0, 0, 8,                  /* Red/Green/Blue/AlphaBits */
       8, 0, 0, 0, 0,               /* Lum/Int/Index/Depth/StencilBits */
       1, 1, 2                      /* BlockWidth/Height,Bytes */
    },
+   {
+      MESA_FORMAT_AL1616,          /* Name */
+      "MESA_FORMAT_AL1616",        /* StrName */
+      GL_LUMINANCE_ALPHA,          /* BaseFormat */
+      GL_UNSIGNED_NORMALIZED,      /* DataType */
+      0, 0, 0, 16,                 /* Red/Green/Blue/AlphaBits */
+      16, 0, 0, 0, 0,              /* Lum/Int/Index/Depth/StencilBits */
+      1, 1, 4                      /* BlockWidth/Height,Bytes */
+   },
+   {
+      MESA_FORMAT_AL1616_REV,      /* Name */
+      "MESA_FORMAT_AL1616_REV",    /* StrName */
+      GL_LUMINANCE_ALPHA,          /* BaseFormat */
+      GL_UNSIGNED_NORMALIZED,      /* DataType */
+      0, 0, 0, 16,                 /* Red/Green/Blue/AlphaBits */
+      16, 0, 0, 0, 0,              /* Lum/Int/Index/Depth/StencilBits */
+      1, 1, 4                      /* BlockWidth/Height,Bytes */
+   },
    {
       MESA_FORMAT_RGB332,          /* Name */
+      "MESA_FORMAT_RGB332",        /* StrName */
       GL_RGB,                      /* BaseFormat */
       GL_UNSIGNED_NORMALIZED,      /* DataType */
       3, 3, 2, 0,                  /* Red/Green/Blue/AlphaBits */
@@ -212,6 +268,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_A8,              /* Name */
+      "MESA_FORMAT_A8",            /* StrName */
       GL_ALPHA,                    /* BaseFormat */
       GL_UNSIGNED_NORMALIZED,      /* DataType */
       0, 0, 0, 8,                  /* Red/Green/Blue/AlphaBits */
@@ -220,6 +277,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_L8,              /* Name */
+      "MESA_FORMAT_L8",            /* StrName */
       GL_LUMINANCE,                /* BaseFormat */
       GL_UNSIGNED_NORMALIZED,      /* DataType */
       0, 0, 0, 0,                  /* Red/Green/Blue/AlphaBits */
@@ -228,6 +286,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_I8,              /* Name */
+      "MESA_FORMAT_I8",            /* StrName */
       GL_INTENSITY,                /* BaseFormat */
       GL_UNSIGNED_NORMALIZED,      /* DataType */
       0, 0, 0, 0,                  /* Red/Green/Blue/AlphaBits */
@@ -236,6 +295,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_CI8,             /* Name */
+      "MESA_FORMAT_CI8",           /* StrName */
       GL_COLOR_INDEX,              /* BaseFormat */
       GL_UNSIGNED_INT,             /* DataType */
       0, 0, 0, 0,                  /* Red/Green/Blue/AlphaBits */
@@ -244,6 +304,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_YCBCR,           /* Name */
+      "MESA_FORMAT_YCBCR",         /* StrName */
       GL_YCBCR_MESA,               /* BaseFormat */
       GL_UNSIGNED_NORMALIZED,      /* DataType */
       0, 0, 0, 0,                  /* Red/Green/Blue/AlphaBits */
@@ -252,6 +313,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_YCBCR_REV,       /* Name */
+      "MESA_FORMAT_YCBCR_REV",     /* StrName */
       GL_YCBCR_MESA,               /* BaseFormat */
       GL_UNSIGNED_NORMALIZED,      /* DataType */
       0, 0, 0, 0,                  /* Red/Green/Blue/AlphaBits */
@@ -260,6 +322,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_Z24_S8,          /* Name */
+      "MESA_FORMAT_Z24_S8",        /* StrName */
       GL_DEPTH_STENCIL,            /* BaseFormat */
       GL_UNSIGNED_INT,             /* DataType */
       0, 0, 0, 0,                  /* Red/Green/Blue/AlphaBits */
@@ -268,6 +331,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_S8_Z24,          /* Name */
+      "MESA_FORMAT_S8_Z24",        /* StrName */
       GL_DEPTH_STENCIL,            /* BaseFormat */
       GL_UNSIGNED_INT,             /* DataType */
       0, 0, 0, 0,                  /* Red/Green/Blue/AlphaBits */
@@ -276,14 +340,34 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_Z16,             /* Name */
+      "MESA_FORMAT_Z16",           /* StrName */
       GL_DEPTH_COMPONENT,          /* BaseFormat */
       GL_UNSIGNED_INT,             /* DataType */
       0, 0, 0, 0,                  /* Red/Green/Blue/AlphaBits */
       0, 0, 0, 16, 0,              /* Lum/Int/Index/Depth/StencilBits */
       1, 1, 2                      /* BlockWidth/Height,Bytes */
    },
+   {
+      MESA_FORMAT_X8_Z24,          /* Name */
+      "MESA_FORMAT_X8_Z24",        /* StrName */
+      GL_DEPTH_COMPONENT,          /* BaseFormat */
+      GL_UNSIGNED_INT,             /* DataType */
+      0, 0, 0, 0,                  /* Red/Green/Blue/AlphaBits */
+      0, 0, 0, 24, 0,              /* Lum/Int/Index/Depth/StencilBits */
+      1, 1, 4                      /* BlockWidth/Height,Bytes */
+   },
+   {
+      MESA_FORMAT_Z24_X8,          /* Name */
+      "MESA_FORMAT_Z24_X8",        /* StrName */
+      GL_DEPTH_COMPONENT,          /* BaseFormat */
+      GL_UNSIGNED_INT,             /* DataType */
+      0, 0, 0, 0,                  /* Red/Green/Blue/AlphaBits */
+      0, 0, 0, 24, 0,              /* Lum/Int/Index/Depth/StencilBits */
+      1, 1, 4                      /* BlockWidth/Height,Bytes */
+   },
    {
       MESA_FORMAT_Z32,             /* Name */
+      "MESA_FORMAT_Z32",           /* StrName */
       GL_DEPTH_COMPONENT,          /* BaseFormat */
       GL_UNSIGNED_INT,             /* DataType */
       0, 0, 0, 0,                  /* Red/Green/Blue/AlphaBits */
@@ -292,6 +376,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_S8,              /* Name */
+      "MESA_FORMAT_S8",            /* StrName */
       GL_STENCIL_INDEX,            /* BaseFormat */
       GL_UNSIGNED_INT,             /* DataType */
       0, 0, 0, 0,                  /* Red/Green/Blue/AlphaBits */
@@ -300,6 +385,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_SRGB8,
+      "MESA_FORMAT_SRGB8",
       GL_RGB,
       GL_UNSIGNED_NORMALIZED,
       8, 8, 8, 0,
@@ -308,6 +394,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_SRGBA8,
+      "MESA_FORMAT_SRGBA8",
       GL_RGBA,
       GL_UNSIGNED_NORMALIZED,    
       8, 8, 8, 8,
@@ -316,6 +403,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_SARGB8,
+      "MESA_FORMAT_SARGB8",
       GL_RGBA,
       GL_UNSIGNED_NORMALIZED,    
       8, 8, 8, 8,
@@ -324,14 +412,16 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_SL8,
-      GL_LUMINANCE_ALPHA,
+      "MESA_FORMAT_SL8",
+      GL_LUMINANCE,
       GL_UNSIGNED_NORMALIZED,    
-      0, 0, 0, 8,
+      0, 0, 0, 0,
       8, 0, 0, 0, 0,
-      1, 1, 2
+      1, 1, 1
    },
    {
       MESA_FORMAT_SLA8,
+      "MESA_FORMAT_SLA8",
       GL_LUMINANCE_ALPHA,
       GL_UNSIGNED_NORMALIZED,    
       0, 0, 0, 8,
@@ -340,6 +430,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_SRGB_DXT1,       /* Name */
+      "MESA_FORMAT_SRGB_DXT1",     /* StrName */
       GL_RGB,                      /* BaseFormat */
       GL_UNSIGNED_NORMALIZED,      /* DataType */
       4, 4, 4, 0,                  /* approx Red/Green/Blue/AlphaBits */
@@ -348,6 +439,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_SRGBA_DXT1,
+      "MESA_FORMAT_SRGBA_DXT1",
       GL_RGBA,
       GL_UNSIGNED_NORMALIZED,
       4, 4, 4, 4,
@@ -356,6 +448,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_SRGBA_DXT3,
+      "MESA_FORMAT_SRGBA_DXT3",
       GL_RGBA,
       GL_UNSIGNED_NORMALIZED,
       4, 4, 4, 4,
@@ -364,6 +457,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_SRGBA_DXT5,
+      "MESA_FORMAT_SRGBA_DXT5",
       GL_RGBA,
       GL_UNSIGNED_NORMALIZED,
       4, 4, 4, 4,
@@ -373,23 +467,26 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
 
    {
       MESA_FORMAT_RGB_FXT1,
+      "MESA_FORMAT_RGB_FXT1",
       GL_RGB,
       GL_UNSIGNED_NORMALIZED,
-      8, 8, 8, 0,
+      4, 4, 4, 0,                  /* approx Red/Green/BlueBits */
       0, 0, 0, 0, 0,
       8, 4, 16                     /* 16 bytes per 8x4 block */
    },
    {
       MESA_FORMAT_RGBA_FXT1,
+      "MESA_FORMAT_RGBA_FXT1",
       GL_RGBA,
       GL_UNSIGNED_NORMALIZED,
-      8, 8, 8, 8,
+      4, 4, 4, 1,                  /* approx Red/Green/Blue/AlphaBits */
       0, 0, 0, 0, 0,
       8, 4, 16                     /* 16 bytes per 8x4 block */
    },
 
    {
       MESA_FORMAT_RGB_DXT1,        /* Name */
+      "MESA_FORMAT_RGB_DXT1",      /* StrName */
       GL_RGB,                      /* BaseFormat */
       GL_UNSIGNED_NORMALIZED,      /* DataType */
       4, 4, 4, 0,                  /* approx Red/Green/Blue/AlphaBits */
@@ -398,6 +495,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_RGBA_DXT1,
+      "MESA_FORMAT_RGBA_DXT1",
       GL_RGBA,
       GL_UNSIGNED_NORMALIZED,    
       4, 4, 4, 4,
@@ -406,6 +504,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_RGBA_DXT3,
+      "MESA_FORMAT_RGBA_DXT3",
       GL_RGBA,
       GL_UNSIGNED_NORMALIZED,    
       4, 4, 4, 4,
@@ -414,6 +513,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_RGBA_DXT5,
+      "MESA_FORMAT_RGBA_DXT5",
       GL_RGBA,
       GL_UNSIGNED_NORMALIZED,    
       4, 4, 4, 4,
@@ -422,6 +522,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_RGBA_FLOAT32,
+      "MESA_FORMAT_RGBA_FLOAT32",
       GL_RGBA,
       GL_FLOAT,
       32, 32, 32, 32,
@@ -430,6 +531,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_RGBA_FLOAT16,
+      "MESA_FORMAT_RGBA_FLOAT16",
       GL_RGBA,
       GL_FLOAT,
       16, 16, 16, 16,
@@ -438,6 +540,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_RGB_FLOAT32,
+      "MESA_FORMAT_RGB_FLOAT32",
       GL_RGB,
       GL_FLOAT,
       32, 32, 32, 0,
@@ -446,6 +549,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_RGB_FLOAT16,
+      "MESA_FORMAT_RGB_FLOAT16",
       GL_RGB,
       GL_FLOAT,
       16, 16, 16, 0,
@@ -454,6 +558,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_ALPHA_FLOAT32,
+      "MESA_FORMAT_ALPHA_FLOAT32",
       GL_ALPHA,
       GL_FLOAT,
       0, 0, 0, 32,
@@ -462,6 +567,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_ALPHA_FLOAT16,
+      "MESA_FORMAT_ALPHA_FLOAT16",
       GL_ALPHA,
       GL_FLOAT,
       0, 0, 0, 16,
@@ -470,6 +576,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_LUMINANCE_FLOAT32,
+      "MESA_FORMAT_LUMINANCE_FLOAT32",
       GL_ALPHA,
       GL_FLOAT,
       0, 0, 0, 0,
@@ -478,6 +585,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_LUMINANCE_FLOAT16,
+      "MESA_FORMAT_LUMINANCE_FLOAT16",
       GL_ALPHA,
       GL_FLOAT,
       0, 0, 0, 0,
@@ -486,6 +594,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32,
+      "MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32",
       GL_LUMINANCE_ALPHA,
       GL_FLOAT,
       0, 0, 0, 32,
@@ -494,6 +603,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16,
+      "MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16",
       GL_LUMINANCE_ALPHA,
       GL_FLOAT,
       0, 0, 0, 16,
@@ -502,6 +612,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_INTENSITY_FLOAT32,
+      "MESA_FORMAT_INTENSITY_FLOAT32",
       GL_INTENSITY,
       GL_FLOAT,
       0, 0, 0, 0,
@@ -510,6 +621,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_INTENSITY_FLOAT16,
+      "MESA_FORMAT_INTENSITY_FLOAT16",
       GL_INTENSITY,
       GL_FLOAT,
       0, 0, 0, 0,
@@ -518,6 +630,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_DUDV8,
+      "MESA_FORMAT_DUDV8",
       GL_DUDV_ATI,
       GL_SIGNED_NORMALIZED,
       0, 0, 0, 0,
@@ -526,6 +639,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_SIGNED_RGBA8888,
+      "MESA_FORMAT_SIGNED_RGBA8888",
       GL_RGBA,
       GL_SIGNED_NORMALIZED,
       8, 8, 8, 8,
@@ -534,6 +648,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_SIGNED_RGBA8888_REV,
+      "MESA_FORMAT_SIGNED_RGBA8888_REV",
       GL_RGBA,
       GL_SIGNED_NORMALIZED,
       8, 8, 8, 8,
@@ -542,6 +657,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
    },
    {
       MESA_FORMAT_SIGNED_RGBA_16,
+      "MESA_FORMAT_SIGNED_RGBA_16",
       GL_RGBA,
       GL_SIGNED_NORMALIZED,
       16, 16, 16, 16,
@@ -561,6 +677,22 @@ _mesa_get_format_info(gl_format format)
 }
 
 
+/** Return string name of format (for debugging) */
+const char *
+_mesa_get_format_name(gl_format format)
+{
+   const struct gl_format_info *info = _mesa_get_format_info(format);
+   ASSERT(info->BytesPerBlock);
+   return info->StrName;
+}
+
+
+
+/**
+ * Return bytes needed to store a block of pixels in the given format.
+ * Normally, a block is 1x1 (a single pixel).  But for compressed formats
+ * a block may be 4x4 or 8x4, etc.
+ */
 GLuint
 _mesa_get_format_bytes(gl_format format)
 {
@@ -570,6 +702,11 @@ _mesa_get_format_bytes(gl_format format)
 }
 
 
+/**
+ * Return bits per component for the given format.
+ * \param format  one of MESA_FORMAT_x
+ * \param pname  the component, such as GL_RED_BITS, GL_TEXTURE_BLUE_BITS, etc.
+ */
 GLint
 _mesa_get_format_bits(gl_format format, GLenum pname)
 {
@@ -620,6 +757,15 @@ _mesa_get_format_bits(gl_format format, GLenum pname)
 }
 
 
+/**
+ * Return the data type (or more specifically, the data representation)
+ * for the given format.
+ * The return value will be one of:
+ *    GL_UNSIGNED_NORMALIZED = unsigned int representing [0,1]
+ *    GL_SIGNED_NORMALIZED = signed int representing [-1, 1]
+ *    GL_UNSIGNED_INT = an ordinary unsigned integer
+ *    GL_FLOAT = an ordinary float
+ */
 GLenum
 _mesa_get_format_datatype(gl_format format)
 {
@@ -628,6 +774,12 @@ _mesa_get_format_datatype(gl_format format)
 }
 
 
+/**
+ * Return the basic format for the given type.  The result will be
+ * one of GL_RGB, GL_RGBA, GL_ALPHA, GL_LUMINANCE, GL_LUMINANCE_ALPHA,
+ * GL_INTENSITY, GL_YCBCR_MESA, GL_COLOR_INDEX, GL_DEPTH_COMPONENT,
+ * GL_STENCIL_INDEX, GL_DEPTH_STENCIL.
+ */
 GLenum
 _mesa_get_format_base_format(gl_format format)
 {
@@ -636,6 +788,23 @@ _mesa_get_format_base_format(gl_format format)
 }
 
 
+/**
+ * Return the block size (in pixels) for the given format.  Normally
+ * the block size is 1x1.  But compressed formats will have block sizes
+ * of 4x4 or 8x4 pixels, etc.
+ * \param bw  returns block width in pixels
+ * \param bh  returns block height in pixels
+ */
+void
+_mesa_get_format_block_size(gl_format format, GLuint *bw, GLuint *bh)
+{
+   const struct gl_format_info *info = _mesa_get_format_info(format);
+   *bw = info->BlockWidth;
+   *bh = info->BlockHeight;
+}
+
+
+/** Is the given format a compressed format? */
 GLboolean
 _mesa_is_format_compressed(gl_format format)
 {
@@ -740,6 +909,7 @@ _mesa_test_formats(void)
             GLuint t = info->RedBits + info->GreenBits
                + info->BlueBits + info->AlphaBits;
             assert(t / 8 == info->BytesPerBlock);
+            (void) t;
          }
       }
 
@@ -799,6 +969,7 @@ _mesa_format_to_type_and_comps(gl_format format,
    case MESA_FORMAT_RGBA8888_REV:
    case MESA_FORMAT_ARGB8888:
    case MESA_FORMAT_ARGB8888_REV:
+   case MESA_FORMAT_XRGB8888:
       *datatype = GL_UNSIGNED_BYTE;
       *comps = 4;
       return;
@@ -830,6 +1001,13 @@ _mesa_format_to_type_and_comps(gl_format format,
       *datatype = GL_UNSIGNED_BYTE;
       *comps = 2;
       return;
+
+   case MESA_FORMAT_AL1616:
+   case MESA_FORMAT_AL1616_REV:
+      *datatype = GL_UNSIGNED_SHORT;
+      *comps = 2;
+      return;
+
    case MESA_FORMAT_RGB332:
       *datatype = GL_UNSIGNED_BYTE_3_3_2;
       *comps = 3;
@@ -864,6 +1042,16 @@ _mesa_format_to_type_and_comps(gl_format format,
       *comps = 1;
       return;
 
+   case MESA_FORMAT_X8_Z24:
+      *datatype = GL_UNSIGNED_INT;
+      *comps = 1;
+      return;
+
+   case MESA_FORMAT_Z24_X8:
+      *datatype = GL_UNSIGNED_INT;
+      *comps = 1;
+      return;
+
    case MESA_FORMAT_Z32:
       *datatype = GL_UNSIGNED_INT;
       *comps = 1;
@@ -879,6 +1067,10 @@ _mesa_format_to_type_and_comps(gl_format format,
       *datatype = GL_BYTE;
       *comps = 4;
       return;
+   case MESA_FORMAT_SIGNED_RGBA_16:
+      *datatype = GL_SHORT;
+      *comps = 4;
+      return;
 
 #if FEATURE_EXT_texture_sRGB
    case MESA_FORMAT_SRGB8: