fix some format conversion bugs in glGetTexImage(), bug 10288

This commit is contained in:
Haihao Xiang
2007-03-17 09:42:36 -06:00
committed by Brian
parent 6a9b0cd0b4
commit ee5b7f0574
+19
View File
@@ -3608,6 +3608,25 @@ _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,