summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2011-08-26 12:20:00 -0700
committerIan Romanick <[email protected]>2011-08-29 11:07:49 -0700
commit55d232a81566cf7ab8855c42e2ef1a280276a04c (patch)
treeb38fc84b73db9c96e23fe69654f40770eb74e045 /src/mesa/main
parent0c1b71665487fcaeffa8f4d7b5ad0ba425a2c169 (diff)
mesa: Remove all mention of MESA_FORMAT_CI8
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 <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/debug.c1
-rw-r--r--src/mesa/main/fbobject.c2
-rw-r--r--src/mesa/main/formats.c20
-rw-r--r--src/mesa/main/formats.h1
-rw-r--r--src/mesa/main/texfetch.c7
-rw-r--r--src/mesa/main/texfetch_tmp.h82
-rw-r--r--src/mesa/main/texformat.c3
-rw-r--r--src/mesa/main/texstore.c45
8 files changed, 5 insertions, 156 deletions
diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c
index ae07b957d1d..2bb37452d4f 100644
--- a/src/mesa/main/debug.c
+++ b/src/mesa/main/debug.c
@@ -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:
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 0b48fc7eab0..fd371aba83b 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 f9298d2d1e9..65c08f024d0 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -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;
@@ -331,15 +330,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 */
@@ -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;
diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h
index 5b8c01781a6..75d93debaca 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 72283eb68af..11cc8e0479d 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 d170adf2e00..548d50c8eda 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 c919a74e047..075c40c86fb 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 aac600e40de..e9915a7f070 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 },