diff options
author | marha <marha@users.sourceforge.net> | 2011-09-08 11:05:14 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-09-08 11:05:14 +0200 |
commit | 32071a97fb69e2cb5a5dc86016b181a5afd2a87b (patch) | |
tree | 23a05e63a91e56c1c97a3c7b991e3acf46893e2f /mesalib/src/mesa/main/texgetimage.c | |
parent | 553aee48675d816bf041a61ab01bb73f8602d365 (diff) | |
parent | 23a7aebae0a742d94ffe2304357dcc1234a99155 (diff) | |
download | vcxsrv-32071a97fb69e2cb5a5dc86016b181a5afd2a87b.tar.gz vcxsrv-32071a97fb69e2cb5a5dc86016b181a5afd2a87b.tar.bz2 vcxsrv-32071a97fb69e2cb5a5dc86016b181a5afd2a87b.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
mesalib/docs/relnotes.html
mesalib/scons/gallium.py
mesalib/src/mesa/drivers/common/driverfuncs.c
mesalib/src/mesa/main/colortab.c
mesalib/src/mesa/main/dd.h
mesalib/src/mesa/main/enable.c
mesalib/src/mesa/main/formats.c
mesalib/src/mesa/main/framebuffer.c
mesalib/src/mesa/main/get.c
mesalib/src/mesa/main/mtypes.h
mesalib/src/mesa/main/pack.c
mesalib/src/mesa/main/texgetimage.c
mesalib/src/mesa/main/teximage.c
mesalib/src/mesa/main/texobj.c
mesalib/src/mesa/main/texparam.c
mesalib/src/mesa/main/texstate.c
mesalib/src/mesa/swrast/s_drawpix.c
mesalib/src/mesa/vbo/vbo_attrib_tmp.h
Diffstat (limited to 'mesalib/src/mesa/main/texgetimage.c')
-rw-r--r-- | mesalib/src/mesa/main/texgetimage.c | 71 |
1 files changed, 4 insertions, 67 deletions
diff --git a/mesalib/src/mesa/main/texgetimage.c b/mesalib/src/mesa/main/texgetimage.c index 5374c1a1a..46e38d7bc 100644 --- a/mesalib/src/mesa/main/texgetimage.c +++ b/mesalib/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);
}
@@ -567,16 +515,12 @@ getteximage_error_check(struct gl_context *ctx, GLenum target, GLint level, }
if (_mesa_components_in_format(format) <= 0 ||
- format == GL_STENCIL_INDEX) {
+ format == GL_STENCIL_INDEX ||
+ format == GL_COLOR_INDEX) {
_mesa_error( ctx, GL_INVALID_ENUM, "glGetTexImage(format)" );
return GL_TRUE;
}
- if (!ctx->Extensions.EXT_paletted_texture && _mesa_is_index_format(format)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(format)");
- return GL_TRUE;
- }
-
if (!ctx->Extensions.ARB_depth_texture && _mesa_is_depth_format(format)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(format)");
return GL_TRUE;
@@ -615,17 +559,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;
}
|