summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/image.c
diff options
context:
space:
mode:
authorXiang, Haihao <[email protected]>2008-11-19 11:22:35 +0800
committerXiang, Haihao <[email protected]>2008-11-19 11:30:30 +0800
commit2f9ceb158afffe5ea390b909261988267e663e36 (patch)
treecd7ac67f37ccbe2ffff5d1de187e12883b191c97 /src/mesa/main/image.c
parent80d6379722a1249ce13db79a898d340644936f67 (diff)
mesa: clamp luminance if needed.
This fixes glReadPixels(GL_LUMINANCE, GL_FLOAT)/glGetTexImage(GL_LUMINANCE, GL_FLOAT) issue on fixed-point color buffers.
Diffstat (limited to 'src/mesa/main/image.c')
-rw-r--r--src/mesa/main/image.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index 1a6e864b98d..4551b4a3b5b 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -1689,7 +1689,7 @@ _mesa_pack_rgba_span_float(GLcontext *ctx, GLuint n, GLfloat rgba[][4],
if (dstFormat == GL_LUMINANCE || dstFormat == GL_LUMINANCE_ALPHA) {
/* compute luminance values */
- if (dstType != GL_FLOAT || ctx->Color.ClampReadColor == GL_TRUE) {
+ if (transferOps & IMAGE_CLAMP_BIT) {
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);