Mesa (master): AL1616: Add formats for GL_LUMINANCE16_ALPHA16 textures

Ian Romanick idr at kemper.freedesktop.org
Mon Nov 16 23:27:52 UTC 2009


Module: Mesa
Branch: master
Commit: eb437fabe017611e1f855fffa45f59cd38709be8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=eb437fabe017611e1f855fffa45f59cd38709be8

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Mon Nov 16 14:49:40 2009 -0800

AL1616: Add formats for GL_LUMINANCE16_ALPHA16 textures

---

 src/mesa/main/formats.c |   25 +++++++++++++++++++++++++
 src/mesa/main/formats.h |    2 ++
 2 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index 7d0e2d2..7d64c46 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -232,6 +232,24 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
       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 */
@@ -974,6 +992,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;
diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h
index fa6359f..d3ac436 100644
--- a/src/mesa/main/formats.h
+++ b/src/mesa/main/formats.h
@@ -66,6 +66,8 @@ typedef enum
    MESA_FORMAT_ARGB1555_REV,	/*                     GGGB BBBB ARRR RRGG */
    MESA_FORMAT_AL88,		/*                     AAAA AAAA LLLL LLLL */
    MESA_FORMAT_AL88_REV,	/*                     LLLL LLLL AAAA AAAA */
+   MESA_FORMAT_AL1616,          /* AAAA AAAA AAAA AAAA LLLL LLLL LLLL LLLL */
+   MESA_FORMAT_AL1616_REV,      /* LLLL LLLL LLLL LLLL AAAA AAAA AAAA AAAA */
    MESA_FORMAT_RGB332,		/*                               RRRG GGBB */
    MESA_FORMAT_A8,		/*                               AAAA AAAA */
    MESA_FORMAT_L8,		/*                               LLLL LLLL */




More information about the mesa-commit mailing list