mesa: implement new texture format L16
[mesa.git] / src / mesa / main / formats.c
index efbd4a2c25de20dbea532d6da684e4a3d2645f31..81d907f7a0e259807384904065386f5d80fcd07d 100644 (file)
@@ -302,6 +302,15 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
       8, 0, 0, 0, 0,               /* Lum/Int/Index/Depth/StencilBits */
       1, 1, 1                      /* BlockWidth/Height,Bytes */
    },
+   {
+      MESA_FORMAT_L16,             /* Name */
+      "MESA_FORMAT_L16",           /* StrName */
+      GL_LUMINANCE,                /* BaseFormat */
+      GL_UNSIGNED_NORMALIZED,      /* DataType */
+      0, 0, 0, 0,                  /* Red/Green/Blue/AlphaBits */
+      16, 0, 0, 0, 0,              /* Lum/Int/Index/Depth/StencilBits */
+      1, 1, 2                      /* BlockWidth/Height,Bytes */
+   },
    {
       MESA_FORMAT_I8,              /* Name */
       "MESA_FORMAT_I8",            /* StrName */
@@ -1307,6 +1316,7 @@ _mesa_format_to_type_and_comps(gl_format format,
 
    case MESA_FORMAT_R16:
    case MESA_FORMAT_A16:
+   case MESA_FORMAT_L16:
       *datatype = GL_UNSIGNED_SHORT;
       *comps = 1;
       return;