mesa: Remove all mention of MESA_FORMAT_CI8
authorIan Romanick <ian.d.romanick@intel.com>
Fri, 26 Aug 2011 19:20:00 +0000 (12:20 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 29 Aug 2011 18:07:49 +0000 (11:07 -0700)
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.

Also clean out some GL_COLOR_INDEX comments in formats.c.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/common/texmem.c
src/mesa/drivers/dri/r200/r200_texstate.c
src/mesa/drivers/dri/radeon/radeon_texstate.c
src/mesa/main/debug.c
src/mesa/main/fbobject.c
src/mesa/main/formats.c
src/mesa/main/formats.h
src/mesa/main/texfetch.c
src/mesa/main/texfetch_tmp.h
src/mesa/main/texformat.c
src/mesa/main/texstore.c

index e927cf0addd6ad2006db1a392e5d932c0f28fd23..798ef1ee88138afbd14cf54205ca0863117e0cb8 100644 (file)
@@ -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;
 /*@}*/
index 8c9bd6d00b2855cde5f334c32a1df125051965e1..cb3f245c8546d1790a97c0932410b96ad62bc7f0 100644 (file)
@@ -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),
index 430309392a07b4a48b9b8a1b531f0a95bc0bd3b1..5c5cd8b176ff4e66369143a9b3ff0b5ff2e88e17 100644 (file)
@@ -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),
index ae07b957d1d4cdab66cbb654961e3c4f9c780574..2bb37452d4fb136ca3cf7220ec7d6da220485743 100644 (file)
@@ -588,7 +588,6 @@ _mesa_print_texture(struct gl_context *ctx, 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:
index 0b48fc7eab08242fa7c99004383dcbaf2184c2c2..fd371aba83bc3b5a347c2d3c635b89ece1ce755b 100644 (file)
@@ -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;
          }
index f9298d2d1e9b9697293a6537986fdd4ef12b93ad..65c08f024d089ef9386e12bb23a03a59b3fdd031 100644 (file)
@@ -42,8 +42,7 @@ struct gl_format_info
    /**
     * Base format is one of GL_RED, GL_RG, 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, GL_DUDV_ATI.
+    * GL_DEPTH_COMPONENT, GL_STENCIL_INDEX, GL_DEPTH_STENCIL, GL_DUDV_ATI.
     */
    GLenum BaseFormat;
 
@@ -330,15 +329,6 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
       0, 16, 0, 0, 0,              /* Lum/Int/Index/Depth/StencilBits */
       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 */
@@ -1223,10 +1213,9 @@ _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.
+ * 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_DEPTH_COMPONENT, GL_STENCIL_INDEX, GL_DEPTH_STENCIL.
  */
 GLenum
 _mesa_get_format_base_format(gl_format format)
@@ -1632,7 +1621,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;
index 5b8c01781a68290bb50c1d19cc58d5504b851d23..75d93debaca6a335fd95154072c5783244fa8da3 100644 (file)
@@ -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 */
index 72283eb68af96bd9e3c66d7055400928341889a1..11cc8e0479d1b2921a57e2bf9ed4fcf04a317863 100644 (file)
@@ -324,13 +324,6 @@ texfetch_funcs[MESA_FORMAT_COUNT] =
       fetch_texel_3d_f_i16,
       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,
index d170adf2e00c142cba9aa48423f427f20cb365b4..548d50c8edaa8ef025749ad91f19965bbd70ed29 100644 (file)
@@ -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,
index c919a74e0475f0f1635742df42da4723c53e95b8..075c40c86fba9ed33dbf2c2e28c6db947622ac1e 100644 (file)
@@ -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 */
    }
index aac600e40dee5f206ff562032fdfad1efa8ac365..e9915a7f0708fa539af162fda15db2c03e8eff93 100644 (file)
@@ -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 },