diff options
author | Ian Romanick <[email protected]> | 2011-08-29 09:37:24 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2011-09-06 12:08:25 -0700 |
commit | eba527bf9ffc2fd67c44fb77104107556f509b49 (patch) | |
tree | 0cf5ef242a98a43f3293039b3dfb912ed6333865 /src/mesa/main/texgetimage.c | |
parent | becd54eedb26ec9076e6f5f98f485861b3e13a90 (diff) |
mesa: Remove API facing bits of EXT_paletted_texture and EXT_shared_texture_palette
This was also discussed at XDS 2010. However, actually making the
change was delayed because several drivers still exposed these
extensions to significant benefit (e.g., tdfx). Now that those
drivers have been removed, this code can be removed as well.
v2: A lot of bits that were missed in the previous patch have been removed.
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/texgetimage.c')
-rw-r--r-- | src/mesa/main/texgetimage.c | 65 |
1 files changed, 3 insertions, 62 deletions
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index b2ebb0de475..a64e1a01292 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -65,55 +65,6 @@ type_with_negative_values(GLenum type) /** - * glGetTexImage for color index pixels. - */ -static void -get_tex_color_index(struct gl_context *ctx, GLuint dimensions, - GLenum format, GLenum type, GLvoid *pixels, - const struct gl_texture_image *texImage) -{ - const GLint width = texImage->Width; - const GLint height = texImage->Height; - const GLint depth = texImage->Depth; - const GLint rowstride = texImage->RowStride; - const GLuint indexBits = - _mesa_get_format_bits(texImage->TexFormat, GL_TEXTURE_INDEX_SIZE_EXT); - const GLbitfield transferOps = 0x0; - GLint img, row, col; - - for (img = 0; img < depth; img++) { - for (row = 0; row < height; row++) { - GLuint indexRow[MAX_WIDTH] = { 0 }; - void *dest = _mesa_image_address(dimensions, &ctx->Pack, pixels, - width, height, format, type, - img, row, 0); - assert(dest); - - if (indexBits == 8) { - const GLubyte *src = (const GLubyte *) texImage->Data; - src += rowstride * (img * height + row); - for (col = 0; col < width; col++) { - indexRow[col] = src[col]; - } - } - else if (indexBits == 16) { - const GLushort *src = (const GLushort *) texImage->Data; - src += rowstride * (img * height + row); - for (col = 0; col < width; col++) { - indexRow[col] = src[col]; - } - } - else { - _mesa_problem(ctx, "Color index problem in _mesa_GetTexImage"); - } - _mesa_pack_index_span(ctx, width, type, dest, - indexRow, &ctx->Pack, transferOps); - } - } -} - - -/** * glGetTexImage for depth/Z pixels. */ static void @@ -457,9 +408,6 @@ _mesa_get_teximage(struct gl_context *ctx, GLenum target, GLint level, if (get_tex_memcpy(ctx, format, type, pixels, texObj, texImage)) { /* all done */ } - else if (format == GL_COLOR_INDEX) { - get_tex_color_index(ctx, dimensions, format, type, pixels, texImage); - } else if (format == GL_DEPTH_COMPONENT) { get_tex_depth(ctx, dimensions, format, type, pixels, texImage); } @@ -572,7 +520,7 @@ getteximage_error_check(struct gl_context *ctx, GLenum target, GLint level, return GL_TRUE; } - if (!ctx->Extensions.EXT_paletted_texture && _mesa_is_index_format(format)) { + if (_mesa_is_index_format(format)) { _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(format)"); return GL_TRUE; } @@ -615,17 +563,10 @@ getteximage_error_check(struct gl_context *ctx, GLenum target, GLint level, baseFormat = _mesa_get_format_base_format(texImage->TexFormat); /* Make sure the requested image format is compatible with the - * texture's format. Note that a color index texture can be converted - * to RGBA so that combo is allowed. + * texture's format. */ if (_mesa_is_color_format(format) - && !_mesa_is_color_format(baseFormat) - && !_mesa_is_index_format(baseFormat)) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); - return GL_TRUE; - } - else if (_mesa_is_index_format(format) - && !_mesa_is_index_format(baseFormat)) { + && !_mesa_is_color_format(baseFormat)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); return GL_TRUE; } |