mesa: Branch 'master'
Brian Paul
brianp at kemper.freedesktop.org
Sat Mar 17 15:42:41 UTC 2007
src/mesa/main/texstore.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+)
New commits:
diff-tree ee5b7f0574c6c5bce9ab75a2825f1fe089a57fa5 (from 6a9b0cd0b43ba01b24871ec1fa155e192ddeaa56)
Author: Haihao Xiang <haihao.xiang at intel.com>
Date: Sat Mar 17 09:42:36 2007 -0600
fix some format conversion bugs in glGetTexImage(), bug 10288
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 994fb16..2098bdd 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -3608,6 +3608,25 @@ _mesa_get_teximage(GLcontext *ctx, GLenu
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,
More information about the mesa-commit
mailing list