From 704cd61120443501530279937a144a5dd4b6399e Mon Sep 17 00:00:00 2001 From: "Xiang, Haihao" Date: Wed, 21 Mar 2007 10:50:19 +0800 Subject: mesa: revert f9f79c8d770e696249bd98c68b563f887562c974 to fix #10232 Table6.1(in gl2.1) has been applied for glGetTexImage before calling into _mesa_pack_rgba_span_float. --- src/mesa/main/image.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'src/mesa/main/image.c') diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 44729b7419..394a7c65cd 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -1211,24 +1211,15 @@ _mesa_pack_rgba_span_float(GLcontext *ctx, GLuint n, GLfloat rgba[][4], if (dstFormat == GL_LUMINANCE || dstFormat == GL_LUMINANCE_ALPHA) { /* compute luminance values */ - if (transferOps & IMAGE_RED_TO_LUMINANCE) { - /* Luminance = Red (glGetTexImage) */ + if (dstType != GL_FLOAT || ctx->Color.ClampReadColor == GL_TRUE) { for (i = 0; i < n; i++) { - luminance[i] = rgba[i][RCOMP]; + GLfloat sum = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP]; + luminance[i] = CLAMP(sum, 0.0F, 1.0F); } } else { - /* Luminance = Red + Green + Blue (glReadPixels) */ - if (dstType != GL_FLOAT || ctx->Color.ClampReadColor == GL_TRUE) { - for (i = 0; i < n; i++) { - GLfloat sum = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP]; - luminance[i] = CLAMP(sum, 0.0F, 1.0F); - } - } - else { - for (i = 0; i < n; i++) { - luminance[i] = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP]; - } + for (i = 0; i < n; i++) { + luminance[i] = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP]; } } } -- cgit v1.2.3