summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texstore.c
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-03-21 11:57:30 -0600
committerBrian <[email protected]>2007-03-21 11:57:30 -0600
commit23d31efc167f09d47635352f697ffcb087d3ebbd (patch)
tree782f5bdcda8a4374501cae05a94a024fe1c26777 /src/mesa/main/texstore.c
parent180cc2f8458c13ce415f7cdf9a425ae59cb6ad8b (diff)
parent88db19a48412cbe89196b1cc06e8ecf8ccae78b0 (diff)
merge from master
Diffstat (limited to 'src/mesa/main/texstore.c')
-rw-r--r--src/mesa/main/texstore.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 994fb167306..a570525155b 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -3608,10 +3608,29 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level,
GLint col;
for (col = 0; col < width; col++) {
(*texImage->FetchTexelf)(texImage, col, row, img, rgba[col]);
+ if (texImage->TexFormat->BaseFormat == GL_ALPHA) {
+ rgba[col][RCOMP] = 0.0;
+ rgba[col][GCOMP] = 0.0;
+ rgba[col][BCOMP] = 0.0;
+ }
+ else if (texImage->TexFormat->BaseFormat == GL_LUMINANCE) {
+ rgba[col][GCOMP] = 0.0;
+ rgba[col][BCOMP] = 0.0;
+ rgba[col][ACOMP] = 1.0;
+ }
+ else if (texImage->TexFormat->BaseFormat == GL_LUMINANCE_ALPHA) {
+ rgba[col][GCOMP] = 0.0;
+ rgba[col][BCOMP] = 0.0;
+ }
+ else if (texImage->TexFormat->BaseFormat == GL_INTENSITY) {
+ rgba[col][GCOMP] = 0.0;
+ rgba[col][BCOMP] = 0.0;
+ rgba[col][ACOMP] = 1.0;
+ }
}
_mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba,
format, type, dest,
- &ctx->Pack, IMAGE_RED_TO_LUMINANCE);
+ &ctx->Pack, 0x0 /*image xfer ops*/);
} /* format */
} /* row */
} /* img */