aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/texgetimage.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-01-28 13:55:41 +0100
committermarha <marha@users.sourceforge.net>2012-01-28 13:55:41 +0100
commit1aee8dafb5391e093f3a111f906ab0d8b6775510 (patch)
tree3fd4cc1783510fb6ce17c4c42b4d012014008e5b /mesalib/src/mesa/main/texgetimage.c
parentc6a1477b0092762299491d79b3a8cb094c6456da (diff)
downloadvcxsrv-1aee8dafb5391e093f3a111f906ab0d8b6775510.tar.gz
vcxsrv-1aee8dafb5391e093f3a111f906ab0d8b6775510.tar.bz2
vcxsrv-1aee8dafb5391e093f3a111f906ab0d8b6775510.zip
mesa xserver git update 28 jan 2012
Diffstat (limited to 'mesalib/src/mesa/main/texgetimage.c')
-rw-r--r--mesalib/src/mesa/main/texgetimage.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/mesalib/src/mesa/main/texgetimage.c b/mesalib/src/mesa/main/texgetimage.c
index 818deb8e4..42495c8c7 100644
--- a/mesalib/src/mesa/main/texgetimage.c
+++ b/mesalib/src/mesa/main/texgetimage.c
@@ -462,6 +462,15 @@ get_tex_rgba(struct gl_context *ctx, GLuint dimensions,
transferOps |= IMAGE_CLAMP_BIT;
}
}
+ /* This applies to RGB, RGBA textures. if the format is either LUMINANCE
+ * or LUMINANCE ALPHA, luminance (L) is computed as L=R+G+B .we need to
+ * clamp the sum to [0,1].
+ */
+ else if ((format == GL_LUMINANCE ||
+ format == GL_LUMINANCE_ALPHA) &&
+ dataType == GL_UNSIGNED_NORMALIZED) {
+ transferOps |= IMAGE_CLAMP_BIT;
+ }
if (_mesa_is_format_compressed(texImage->TexFormat)) {
get_tex_rgba_compressed(ctx, dimensions, format, type,