[Mesa-dev] [PATCH 2/2] mesa: Remove all mention of MESA_FORMAT_CI8

Ian Romanick idr at freedesktop.org
Fri Aug 26 23:47:16 PDT 2011


From: Ian Romanick <ian.d.romanick at intel.com>

Nothing in Mesa supports color-index textures, and most of the other
infrastructure that could allow such support has already been removed.
This puts the final nail in the coffin.
---
 src/mesa/drivers/dri/common/texmem.c          |    1 -
 src/mesa/drivers/dri/r200/r200_texstate.c     |    2 -
 src/mesa/drivers/dri/radeon/radeon_texstate.c |    1 -
 src/mesa/main/debug.c                         |    1 -
 src/mesa/main/fbobject.c                      |    2 +-
 src/mesa/main/formats.c                       |   10 ---
 src/mesa/main/formats.h                       |    1 -
 src/mesa/main/texfetch.c                      |    7 --
 src/mesa/main/texfetch_tmp.h                  |   82 -------------------------
 src/mesa/main/texformat.c                     |    3 -
 src/mesa/main/texstore.c                      |   45 --------------
 11 files changed, 1 insertions(+), 154 deletions(-)

diff --git a/src/mesa/drivers/dri/common/texmem.c b/src/mesa/drivers/dri/common/texmem.c
index e927cf0..798ef1e 100644
--- a/src/mesa/drivers/dri/common/texmem.c
+++ b/src/mesa/drivers/dri/common/texmem.c
@@ -1310,7 +1310,6 @@ gl_format _dri_texformat_argb4444 = MESA_FORMAT_NONE;
 gl_format _dri_texformat_argb1555 = MESA_FORMAT_NONE;
 gl_format _dri_texformat_al88 = MESA_FORMAT_NONE;
 gl_format _dri_texformat_a8 = MESA_FORMAT_A8;
-gl_format _dri_texformat_ci8 = MESA_FORMAT_CI8;
 gl_format _dri_texformat_i8 = MESA_FORMAT_I8;
 gl_format _dri_texformat_l8 = MESA_FORMAT_L8;
 /*@}*/
diff --git a/src/mesa/drivers/dri/r200/r200_texstate.c b/src/mesa/drivers/dri/r200/r200_texstate.c
index 8c9bd6d..cb3f245 100644
--- a/src/mesa/drivers/dri/r200/r200_texstate.c
+++ b/src/mesa/drivers/dri/r200/r200_texstate.c
@@ -97,7 +97,6 @@ static const struct tx_table tx_table_be[] =
    _ALPHA(A8),
    _COLOR(L8),
    _ALPHA(I8),
-   _INVALID(CI8),
    _YUV(YCBCR),
    _YUV(YCBCR_REV),
    _INVALID(RGB_FXT1),
@@ -126,7 +125,6 @@ static const struct tx_table tx_table_le[] =
    _ALPHA(A8),
    _COLOR(L8),
    _ALPHA(I8),
-   _INVALID(CI8),
    _YUV(YCBCR),
    _YUV(YCBCR_REV),
    _INVALID(RGB_FXT1),
diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c
index 4303093..5c5cd8b 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texstate.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c
@@ -101,7 +101,6 @@ static const struct tx_table tx_table[] =
    _ALPHA(A8),
    _COLOR(L8),
    _ALPHA(I8),
-   _INVALID(CI8),
    _YUV(YCBCR),
    _YUV(YCBCR_REV),
    _INVALID(RGB_FXT1),
diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c
index b1fc096..267da70 100644
--- a/src/mesa/main/debug.c
+++ b/src/mesa/main/debug.c
@@ -584,7 +584,6 @@ _mesa_print_texture(struct gl_context *ctx, const struct gl_texture_image *img)
       case MESA_FORMAT_A8:
       case MESA_FORMAT_L8:
       case MESA_FORMAT_I8:
-      case MESA_FORMAT_CI8:
          c = 1;
          break;
       case MESA_FORMAT_AL88:
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 0b48fc7..fd371ab 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -2321,7 +2321,7 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
       }
       else {
          gl_format format = att->Renderbuffer->Format;
-         if (format == MESA_FORMAT_CI8 || format == MESA_FORMAT_S8) {
+         if (format == MESA_FORMAT_S8) {
             /* special cases */
             *params = GL_INDEX;
          }
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index f9298d2..20e638d 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -331,15 +331,6 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
       1, 1, 2                      /* BlockWidth/Height,Bytes */
    },
    {
-      MESA_FORMAT_CI8,             /* Name */
-      "MESA_FORMAT_CI8",           /* StrName */
-      GL_COLOR_INDEX,              /* BaseFormat */
-      GL_UNSIGNED_INT,             /* DataType */
-      0, 0, 0, 0,                  /* Red/Green/Blue/AlphaBits */
-      0, 0, 8, 0, 0,               /* Lum/Int/Index/Depth/StencilBits */
-      1, 1, 1                      /* BlockWidth/Height,Bytes */
-   },
-   {
       MESA_FORMAT_YCBCR,           /* Name */
       "MESA_FORMAT_YCBCR",         /* StrName */
       GL_YCBCR_MESA,               /* BaseFormat */
@@ -1632,7 +1623,6 @@ _mesa_format_to_type_and_comps(gl_format format,
    case MESA_FORMAT_A8:
    case MESA_FORMAT_L8:
    case MESA_FORMAT_I8:
-   case MESA_FORMAT_CI8:
    case MESA_FORMAT_R8:
    case MESA_FORMAT_S8:
       *datatype = GL_UNSIGNED_BYTE;
diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h
index 5b8c017..75d93de 100644
--- a/src/mesa/main/formats.h
+++ b/src/mesa/main/formats.h
@@ -80,7 +80,6 @@ typedef enum
    MESA_FORMAT_L16,             /*                     LLLL LLLL LLLL LLLL */
    MESA_FORMAT_I8,		/*                               IIII IIII */
    MESA_FORMAT_I16,             /*                     IIII IIII IIII IIII */
-   MESA_FORMAT_CI8,		/*                               CCCC CCCC */
    MESA_FORMAT_YCBCR,		/*                     YYYY YYYY UorV UorV */
    MESA_FORMAT_YCBCR_REV,	/*                     UorV UorV YYYY YYYY */
    MESA_FORMAT_R8,		/*                               RRRR RRRR */
diff --git a/src/mesa/main/texfetch.c b/src/mesa/main/texfetch.c
index 72283eb..11cc8e0 100644
--- a/src/mesa/main/texfetch.c
+++ b/src/mesa/main/texfetch.c
@@ -325,13 +325,6 @@ texfetch_funcs[MESA_FORMAT_COUNT] =
       store_texel_i16
    },
    {
-      MESA_FORMAT_CI8,
-      fetch_texel_1d_f_ci8,
-      fetch_texel_2d_f_ci8,
-      fetch_texel_3d_f_ci8,
-      store_texel_ci8
-   },
-   {
       MESA_FORMAT_YCBCR,
       fetch_texel_1d_f_ycbcr,
       fetch_texel_2d_f_ycbcr,
diff --git a/src/mesa/main/texfetch_tmp.h b/src/mesa/main/texfetch_tmp.h
index d170adf..548d50c 100644
--- a/src/mesa/main/texfetch_tmp.h
+++ b/src/mesa/main/texfetch_tmp.h
@@ -1379,88 +1379,6 @@ static void store_texel_i16(struct gl_texture_image *texImage,
 #endif
 
 
-/* MESA_FORMAT_CI8 ***********************************************************/
-
-/* Fetch CI texel from 1D, 2D or 3D ci8 texture, lookup the index in a
- * color table, and return 4 GLchans.
- */
-static void FETCH(f_ci8)( const struct gl_texture_image *texImage,
-                          GLint i, GLint j, GLint k, GLfloat *texel )
-{
-   const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1);
-   const struct gl_color_table *palette;
-   GLuint index;
-   GET_CURRENT_CONTEXT(ctx);
-
-   if (ctx->Texture.SharedPalette) {
-      palette = &ctx->Texture.Palette;
-   }
-   else {
-      palette = &texImage->TexObject->Palette;
-   }
-   if (palette->Size == 0)
-      return; /* undefined results */
-
-   /* Mask the index against size of palette to avoid going out of bounds */
-   index = (*src) & (palette->Size - 1);
-
-   {
-      const GLfloat *table = palette->TableF;
-      switch (palette->_BaseFormat) {
-      case GL_ALPHA:
-         texel[RCOMP] =
-         texel[GCOMP] =
-         texel[BCOMP] = 0.0F;
-         texel[ACOMP] = table[index];
-         break;
-      case GL_LUMINANCE:
-         texel[RCOMP] =
-         texel[GCOMP] =
-         texel[BCOMP] = table[index];
-         texel[ACOMP] = 1.0F;
-         break;
-      case GL_INTENSITY:
-         texel[RCOMP] =
-         texel[GCOMP] =
-         texel[BCOMP] =
-         texel[ACOMP] = table[index];
-         break;
-      case GL_LUMINANCE_ALPHA:
-         texel[RCOMP] =
-         texel[GCOMP] =
-         texel[BCOMP] = table[index * 2 + 0];
-         texel[ACOMP] = table[index * 2 + 1];
-         break;
-      case GL_RGB:
-         texel[RCOMP] = table[index * 3 + 0];
-         texel[GCOMP] = table[index * 3 + 1];
-         texel[BCOMP] = table[index * 3 + 2];
-         texel[ACOMP] = 1.0F;
-         break;
-      case GL_RGBA:
-         texel[RCOMP] = table[index * 4 + 0];
-         texel[GCOMP] = table[index * 4 + 1];
-         texel[BCOMP] = table[index * 4 + 2];
-         texel[ACOMP] = table[index * 4 + 3];
-         break;
-      default:
-         _mesa_problem(ctx, "Bad palette format in fetch_texel_ci8");
-         return;
-      }
-   }
-}
-
-#if DIM == 3
-static void store_texel_ci8(struct gl_texture_image *texImage,
-                            GLint i, GLint j, GLint k, const void *texel)
-{
-   const GLubyte *index = (const GLubyte *) texel;
-   GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1);
-   *dst = *index;
-}
-#endif
-
-
 /* Fetch texel from 1D, 2D or 3D srgb8 texture, return 4 GLfloats */
 /* Note: component order is same as for MESA_FORMAT_RGB888 */
 static void FETCH(srgb8)(const struct gl_texture_image *texImage,
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index c919a74..075c40c 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -204,9 +204,6 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
       case GL_COLOR_INDEX12_EXT:
       case GL_COLOR_INDEX16_EXT:
       case GL_COLOR_INDEX8_EXT:
-	 RETURN_IF_SUPPORTED(MESA_FORMAT_CI8);
-	 break;
-
       default:
          ; /* fallthrough */
    }
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index c4aeaa8..f5d7fb6 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -2724,50 +2724,6 @@ _mesa_texstore_unorm8(TEXSTORE_PARAMS)
 
 
 
-static GLboolean
-_mesa_texstore_ci8(TEXSTORE_PARAMS)
-{
-   const GLuint texelBytes = _mesa_get_format_bytes(dstFormat);
-
-   (void) dims; (void) baseInternalFormat;
-   ASSERT(dstFormat == MESA_FORMAT_CI8);
-   ASSERT(texelBytes == 1);
-   ASSERT(baseInternalFormat == GL_COLOR_INDEX);
-
-   if (!ctx->_ImageTransferState &&
-       !srcPacking->SwapBytes &&
-       srcFormat == GL_COLOR_INDEX &&
-       srcType == GL_UNSIGNED_BYTE) {
-      /* simple memcpy path */
-      memcpy_texture(ctx, dims,
-                     dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
-                     dstRowStride,
-                     dstImageOffsets,
-                     srcWidth, srcHeight, srcDepth, srcFormat, srcType,
-                     srcAddr, srcPacking);
-   }
-   else {
-      /* general path */
-      GLint img, row;
-      for (img = 0; img < srcDepth; img++) {
-         GLubyte *dstRow = (GLubyte *) dstAddr
-            + dstImageOffsets[dstZoffset + img] * texelBytes
-            + dstYoffset * dstRowStride
-            + dstXoffset * texelBytes;
-         for (row = 0; row < srcHeight; row++) {
-            const GLvoid *src = _mesa_image_address(dims, srcPacking,
-                srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, row, 0);
-            _mesa_unpack_index_span(ctx, srcWidth, GL_UNSIGNED_BYTE, dstRow,
-                                    srcType, src, srcPacking,
-                                    ctx->_ImageTransferState);
-            dstRow += dstRowStride;
-         }
-      }
-   }
-   return GL_TRUE;
-}
-
-
 /**
  * Texstore for _mesa_texformat_ycbcr or _mesa_texformat_ycbcr_REV.
  */
@@ -4392,7 +4348,6 @@ texstore_funcs[MESA_FORMAT_COUNT] =
    { MESA_FORMAT_L16, _mesa_texstore_unorm16 },
    { MESA_FORMAT_I8, _mesa_texstore_unorm8 },
    { MESA_FORMAT_I16, _mesa_texstore_unorm16 },
-   { MESA_FORMAT_CI8, _mesa_texstore_ci8 },
    { MESA_FORMAT_YCBCR, _mesa_texstore_ycbcr },
    { MESA_FORMAT_YCBCR_REV, _mesa_texstore_ycbcr },
    { MESA_FORMAT_R8, _mesa_texstore_unorm8 },
-- 
1.7.4.4



More information about the mesa-dev mailing list